Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 887475 - sys-libs/libapparmor-3.0.3-r1: would not compile using gcc with LTO
Summary: sys-libs/libapparmor-3.0.3-r1: would not compile using gcc with LTO
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Palimaka (kensington)
URL:
Whiteboard:
Keywords:
Depends on: 876965
Blocks: lto
  Show dependency tree
 
Reported: 2022-12-20 17:23 UTC by Jocelyn Mayer
Modified: 2022-12-24 07:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output from emerge --info =sys-libs/libapparmor-3.0.3-r1 (emerge-infos-libapparmor-3.0.3-r1,24.79 KB, text/plain)
2022-12-20 17:24 UTC, Jocelyn Mayer
Details
Emerge with gcc + LTO failure build log (libapparmor-3.0.3-r1.log,38.19 KB, text/plain)
2022-12-20 17:25 UTC, Jocelyn Mayer
Details
Emerge log while using clang + LTO flags set - OK (libapparmor-3.0.3-r1.clang.log,127.16 KB, text/plain)
2022-12-20 17:28 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2022-12-20 17:23:37 UTC
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 !
Comment 1 Jocelyn Mayer 2022-12-20 17:24:21 UTC
Created attachment 844219 [details]
Output from emerge --info =sys-libs/libapparmor-3.0.3-r1
Comment 2 Jocelyn Mayer 2022-12-20 17:25:02 UTC
Created attachment 844221 [details]
Emerge with gcc + LTO failure build log
Comment 3 Jocelyn Mayer 2022-12-20 17:28:19 UTC
Created attachment 844223 [details]
Emerge log while using clang + LTO flags set - OK
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-20 19:30:49 UTC
Looks like (unpackaged) sys-libs/libapparmor-3.0.6 will help once bumped to.
Comment 5 Jocelyn Mayer 2022-12-21 05:12:46 UTC
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.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-22 02:36:39 UTC
(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 :(
Comment 7 Jocelyn Mayer 2022-12-22 11:15:20 UTC
OK, thanks for this clarification
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-24 07:33:09 UTC
Fixed w/ bump to 3.0.8.