-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
LLVM fails to build on PPC with GCC>=9 and -fno-plt #51205
Comments
It always seems to happen at the same place, somewhere in tools/llvm-shlib/CMakeFiles/LLVM.dir/build; Note that LLVM 13.0.0-rc3 (like 11.1 before) also fails at the same point with GCC 9 (in this case 9.4.0). I haven't tested GCC 10 yet. |
Possible context of error(s): 2021-09-14T23:07:40.7220247Z [ 88%] Linking CXX shared library ../../lib/libLLVM-13.so |
*FLAGS: 2021-09-14T20:50:25.7942787Z +CFLAGS=-mcpu=power8 -mtune=power8 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/llvm-package-13.0.0.rc3 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix |
I realised that 11.1 is not necessarily the lower bound. It was just the first time that we in conda-forge had tried to use GCC >= 9 to compile LLVM. Therefore, the problem could have existed for longer already. |
PS. The build script currently in use by this feedstock (resp. my PR) can be found here: https://github.com/h-vetinari/llvmdev-feedstock/blob/rc/recipe/build.sh Happy to explain how to reconstruct/reproduce this. |
Try removing -fno-plt from C(XX)?FLAGS, or try appending -fplt to them to overwrite the existing -fno-plt. I'm not sure if this resolves the issue, but it can be said that the compiler option -fno-plt affects relocations in some manner. |
Thanks a lot for the suggestion, indeed the build runs through on GCC 9 when -fno-plt is removed! :) This helps take off the pressure a bit, though it should IMO still be solved, because IIUC it is a performance-relevant flag, and conda-forge has it on by default everywhere. |
I am really sorry that I didn't get to this until now... I don't foresee being able to build LLVM on PPC with an option such as -fno-plt since the PLT stubs are what allows calls to reach their destination functions. I think it would be interesting to see if there is actually a performance impact of this option on PPC - i.e. take the last known configuration that successfully builds with that option and build it also without that option. You should then be able to compare the performance of the two builds. |
No worries, thanks for helping now!
I don't claim to understand the details, but it did work in the past. What changed? It's maybe worth noting that only the LLVM-component of LLVM is affected by this. Clang/OpenMP/etc. build fine on PPC with
Benchmarking the library code seems like a very complex task that I don't think I'll be able to execute. If this issue is declared to lean towards WONTFIX, I'll check back with the core conda-forge folks what their thoughts are on this. |
Unfortunately, the fix for this would not be something this community can provide as the bug is in GCC. I do however think that removing the -fno-plt option for PPC builds is the correct course of action (irrespective of whether any GCC bugs with this option are ever fixed). |
Understood - is this a known bug or should it be raised with GCC?
Thanks for your help! |
I don't think they're aware of this issue so a bug report for GCC may be in order. However, I imagine it will be difficult to reduce this to something that is manageable in order to produce a reproducer for the GCC bug report. |
@tstellar Move to 13.0.1? |
I think this never got removed from 13.0.0, but since it has no patch/solution, I don't think it makes sense to add it to 13.0.1. |
Old build issue with old release |
Extended Description
Originally when building v11.1.0 for conda-forge (conda-forge/llvmdev-feedstock#115), there was an issue with using GCC 9 (only on PPC), so we kept using GCC 8.
Now, two major versions later, GCC 8 fails for other reaons (unrelated to LLVM), and I wanted to try upgrading the version again, see conda-forge/llvmdev-feedstock#131.
As it turns out the same error persists with GCC 11.1 & LLVM 13. I cannot tell where the fault lies exactly, because there's not much output from the linker to go on.
Sample CI run is here: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=376252
The text was updated successfully, but these errors were encountered: