-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang produces error on compiling assembly files when using plugins like polly #88173
Comments
@llvm/issue-subscribers-polly Author: StormBytePP (StormBytePP)
Suppose we have a simple test program called test.cxx and we have polly plugin LLVMPolly.so built dynamically along with LLVM (with `LLVM_POLLY_LINK_INTO_TOOLS=OFF`):
Compiling it with To test it, we create our test assembly
It seems that it is not loading the plugin and not recognizing the options that worked in previous phases (I assume because they are not needed/used when compiling assembly) I think this is a bug because in this case it is much better to load and ignore plugin rather than throw an error because polly use flag might be present in One real example of it is the LLVM library itself which when polly flags are used fails to compile with:
For more info look the Gentoo PR I did for trying to package |
Note: In a test it is discovered that if plugin is forced linked to LLVM library (with |
However, there are a lot of other flags that are ignored without warning even when not compiling C/C++/Obj-C (e.g. compile flags when only linking) because not all build tools care, and we could just add |
I'm using Gentoo build system, in concrete (as an example) I can see this line:
With toolchain file added by
The
I would thank this move, but not Other option would be not to ignore |
Plugins are not loaded without the -cc1 phase. Do not report them when running on a assembly file or when linking. Many build tools add these options to all driver invocations. See GH llvm#88173.
I created #88948. Note that for loading Polly, you should use |
Plugins are not loaded without the -cc1 phase. Do not report them when running on a assembly file or when linking. Many build tools add these options to all driver invocations. See GH llvm#88173.
Plugins are not loaded without the -cc1 phase. Do not report them when running on an assembly file or when linking. Many build tools add these options to all driver invocations, including LLVM's build system. Fixes #88173
@llvm/issue-subscribers-clang-driver Author: StormBytePP (StormBytePP)
Suppose we have a simple test program called test.cxx and we have polly plugin LLVMPolly.so built dynamically along with LLVM (with `LLVM_POLLY_LINK_INTO_TOOLS=OFF`):
Compiling it with To test it, we create our test assembly
It seems that it is not loading the plugin and not recognizing the options that worked in previous phases (I assume because they are not needed/used when compiling assembly) I think this is a bug because in this case it is much better to load and ignore plugin options if they are not used rather than throw an error because polly use flags might be present in One real example of it is the LLVM library itself which fails to compile when CXXFLAGS with polly options are used on some assembly files that LLVM compiles:
For more info look the Gentoo PR I did for trying to package Edit: It is worth to say that this affects all clang versions including 19 git version. |
I want to notice that the bug is still present if legacy options ( |
Suppose we have a simple test program called test.cxx and we have polly plugin LLVMPolly.so built dynamically along with LLVM (with
LLVM_POLLY_LINK_INTO_TOOLS=OFF
):Compiling it with
clang++ -fplugin=LLVMPolly.so -mllvm -polly -mllvm -polly-parallel -o test test.cxx
works as expected, but what happens when compiling assembly?To test it, we create our test assembly
test.S
withclang++ -fplugin=LLVMPolly.so -mllvm -polly -mllvm -polly-parallel -S -c -o test.S test.cxx
and then we try to compiletest.S
as object, then we get:It seems that it is not loading the plugin and not recognizing the options that worked in previous phases (I assume because they are not needed/used when compiling assembly)
I think this is a bug because in this case it is much better to load and ignore plugin options if they are not used rather than throw an error because polly use flags might be present in
C{XX}FLAGS
making the whole target program to fail to compile if it includes assembly files.One real example of it is the LLVM library itself which fails to compile when CXXFLAGS with polly options are used on some assembly files that LLVM compiles:
For more info look the Gentoo PR I did for trying to package
Polly
for GentooEdit: It is worth to say that this affects all clang versions including 19 git version.
The text was updated successfully, but these errors were encountered: