-
Notifications
You must be signed in to change notification settings - Fork 97
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-11 and friends fails with lto #619
Comments
Build LLVM/Clang with LLVM/Clang. |
what do youn mean? |
Build Clang 11 with Clang 10, same with LLVM. |
++ all LLVM tools and libs |
I have successfully built both clang:11 and libomp-11.0.0 with -flto. It's only llvm:11 that fails. I tried switching compiler to clang like this: /etc/portage/package.env: Then it builds but clang doesn't recognize any of these flags: So then it builds without lto. Which then tries to build llvm:11 with clang and -flto but then the build fails in the same way (it builds a broken llvm-tablegen which crashes when launched). |
I got them to successfully build with LTO by disabling |
Confirm this worked for me and building libomp/llvm/clang-11 with clang-10 allowed libomp to build with LTO. To whom should a bug report be sent for the no-as-needed switch with llvm/clang? |
I can also confirm that building llvm:11 with all flags from this overlay: Additionally I never had any problems with building clang, only llvm. As for libomp I have the "cuda" USE-flag enabled for that package which forces me to use <= GCC 9. |
Issue #619, build errors Signed-off-by: Shane Peelar <[email protected]>
I went ahead and disabled LTO on these packages as I'm strapped for time at the moment to deep dive and figure out where they are breaking. Normally LLVM builds fine with LTO, so this is surprising. |
Maybe you can try
|
in my opinion.i dont think it is a good idea to mixing compilers.well on local basics it is okay but not global like here |
they compile fine with clang --flto=full and -fwhole-program-vtables |
@barolo , how long will it take to build llvm and clang with -flto=full and -fwhole-program-vtables against -flto=thin ? |
@perfect7gentleman genlop says that it took 53 min for llvm and 54 for clang [ multilib ], on my 4 core APU |
I'm still getting build failures even with lto disabled
|
so, you wanna say that -flto=1 means it's disabled? |
I think it's because it's missing the prefix |
Yeah, That was the issue |
llvm requires -Wl,--no-as-needed due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55394#c7, fixed in gcc 11. it causes |
Testing -Wl,--no-as-needed it's only required for tablegen with sys-devel/llvm and sys-devel/clang and not sys-libs/libomp (when using LTO). Only build difference was libLLVM-11.so being linked to librt.so. |
okej . I Will remove my overides and check . |
i can confirm that llvm-11 and friends compiles with full LTO on gcc-11 |
FWIW, this issue is tracked in https://bugs.gentoo.org/749162, and there are patches there available for both LLVM and Clang that have been reported to fix LTO builds with GCC<11. |
With llvm 16.0.4 I have to turn off IPAPTA or it will fail to build with a stack trace. |
llvm-11 has been released and it fails with. affected packages :
` / # cat /etc/portage/package.cflags/ltolocalworkarounds.conf
BEGIN: LTO workarounds
sys-devel/llvm FLAGS-=-flto
sys-devel/clang FLAGS-=-flto
sys-libs/libomp FLAGS-=-flto
END: LTO not recommended
/ #
`
The text was updated successfully, but these errors were encountered: