Trying to emerge libapparmor with -flto would lead to an error: /var/tmp/portage/sys-libs/libapparmor-3.0.3-r1/temp/ccR4vNQH.s: Assembler messages: /var/tmp/portage/sys-libs/libapparmor-3.0.3-r1/temp/ccR4vNQH.s: Error: invalid attempt to declare external version name as default in symbol `change_hat@@APPARMOR_1.0' /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed Compiling with gcc and LTO disabled or using clang with LTO enabled merges fine Reproducible: Always Steps to Reproduce: 1. Make sure '-flto' is set in compilation flags 2. Emerge sys-libs/libapparmor Actual Results: Link failure Expected Results: Build to succeed !
Created attachment 844219 [details] Output from emerge --info =sys-libs/libapparmor-3.0.3-r1
Created attachment 844221 [details] Emerge with gcc + LTO failure build log
Created attachment 844223 [details] Emerge log while using clang + LTO flags set - OK
Looks like (unpackaged) sys-libs/libapparmor-3.0.6 will help once bumped to.
I did not saw the patch in the source repository, sorry, but as I look at it, I can see it's not actually optimal, if one could say, as it disable LTO in every case, not just for gcc. I will try to explain this to the maintainers.
(In reply to Jocelyn Mayer from comment #5) > I did not saw the patch in the source repository, sorry, > but as I look at it, I can see it's not actually optimal, if one could say, > as it disable LTO in every case, not just for gcc. > I will try to explain this to the maintainers. In general, if something requires forcing single partition, it means it's broken and unsafe to use with LTO anyway and they need to fix it properly :(
OK, thanks for this clarification
Fixed w/ bump to 3.0.8.