public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Using __gnu_lto_slim to detect -fno-fat-lto-objects
@ 2023-02-22  8:18 Florian Weimer
  2023-02-22  8:23 ` Richard Biener
  2023-03-02 23:57 ` Jeff Law
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Weimer @ 2023-02-22  8:18 UTC (permalink / raw)
  To: gcc

Can we use the COMMON symbol __gnu_lto_slim to detect
-fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
plugin)?

We currently build the distribution with -ffat-lto-objects, and I want
to switch away from that.  Packages will need to opt in to
-ffat-lto-objects if static objects they build escape the buildroot.
And to make sure that this opt-in happens, I want to fail the build if
there would be any -fno-fat-lto-objects objects leaking.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects
  2023-02-22  8:18 Using __gnu_lto_slim to detect -fno-fat-lto-objects Florian Weimer
@ 2023-02-22  8:23 ` Richard Biener
  2023-02-22  8:28   ` Florian Weimer
  2023-03-02 23:57 ` Jeff Law
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Biener @ 2023-02-22  8:23 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc

On Wed, Feb 22, 2023 at 9:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>
> Can we use the COMMON symbol __gnu_lto_slim to detect
> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
> plugin)?

Yes.

> We currently build the distribution with -ffat-lto-objects, and I want
> to switch away from that.  Packages will need to opt in to
> -ffat-lto-objects if static objects they build escape the buildroot.
> And to make sure that this opt-in happens, I want to fail the build if
> there would be any -fno-fat-lto-objects objects leaking.

For SUSE we're checking that no LTO bytecode leaks instead, thus we check
for __gnu_lto_v? (I think).  The reason is that even for static libraries
we do not want to ship LTO bytecode.

Richard.

> Thanks,
> Florian
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects
  2023-02-22  8:23 ` Richard Biener
@ 2023-02-22  8:28   ` Florian Weimer
  2023-02-22  8:58     ` Richard Biener
  2023-02-23  9:53     ` Martin Liška
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Weimer @ 2023-02-22  8:28 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc

* Richard Biener:

> On Wed, Feb 22, 2023 at 9:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>>
>> Can we use the COMMON symbol __gnu_lto_slim to detect
>> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
>> plugin)?
>
> Yes.

Great, thanks.

>> We currently build the distribution with -ffat-lto-objects, and I want
>> to switch away from that.  Packages will need to opt in to
>> -ffat-lto-objects if static objects they build escape the buildroot.
>> And to make sure that this opt-in happens, I want to fail the build if
>> there would be any -fno-fat-lto-objects objects leaking.
>
> For SUSE we're checking that no LTO bytecode leaks instead, thus we check
> for __gnu_lto_v? (I think).  The reason is that even for static libraries
> we do not want to ship LTO bytecode.

We build with -ffat-lto-objects, and this means we can create perfectly
fine object files by stripping the LTO data:

<https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-strip-lto>

This means that so far, we only had to fix LTO compilation problems in
the packages, but not teach individual packages about LTO and non-LTO
object files.  Of course it's wasteful because few packages actually
install the object files (without a final link into a program or shared
object), and that's what I want to fix.

Florian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects
  2023-02-22  8:28   ` Florian Weimer
@ 2023-02-22  8:58     ` Richard Biener
  2023-02-23  9:53     ` Martin Liška
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Biener @ 2023-02-22  8:58 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc

On Wed, Feb 22, 2023 at 9:28 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Richard Biener:
>
> > On Wed, Feb 22, 2023 at 9:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
> >>
> >> Can we use the COMMON symbol __gnu_lto_slim to detect
> >> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
> >> plugin)?
> >
> > Yes.
>
> Great, thanks.
>
> >> We currently build the distribution with -ffat-lto-objects, and I want
> >> to switch away from that.  Packages will need to opt in to
> >> -ffat-lto-objects if static objects they build escape the buildroot.
> >> And to make sure that this opt-in happens, I want to fail the build if
> >> there would be any -fno-fat-lto-objects objects leaking.
> >
> > For SUSE we're checking that no LTO bytecode leaks instead, thus we check
> > for __gnu_lto_v? (I think).  The reason is that even for static libraries
> > we do not want to ship LTO bytecode.
>
> We build with -ffat-lto-objects, and this means we can create perfectly
> fine object files by stripping the LTO data:
>
> <https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-strip-lto>
>
> This means that so far, we only had to fix LTO compilation problems in
> the packages, but not teach individual packages about LTO and non-LTO
> object files.  Of course it's wasteful because few packages actually
> install the object files (without a final link into a program or shared
> object), and that's what I want to fix.

Ah, I didn't notice that - I think we only scan static archives for LTO bytecode
and reject that case.

Richard.

> Florian
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects
  2023-02-22  8:28   ` Florian Weimer
  2023-02-22  8:58     ` Richard Biener
@ 2023-02-23  9:53     ` Martin Liška
  1 sibling, 0 replies; 6+ messages in thread
From: Martin Liška @ 2023-02-23  9:53 UTC (permalink / raw)
  To: Florian Weimer, Richard Biener; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 2462 bytes --]

On 2/22/23 09:28, Florian Weimer via Gcc wrote:
> * Richard Biener:
> 
>> On Wed, Feb 22, 2023 at 9:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>>>
>>> Can we use the COMMON symbol __gnu_lto_slim to detect
>>> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
>>> plugin)?
>>
>> Yes.
> 
> Great, thanks.
> 
>>> We currently build the distribution with -ffat-lto-objects, and I want
>>> to switch away from that.  Packages will need to opt in to
>>> -ffat-lto-objects if static objects they build escape the buildroot.

Hello.

We use the same approach where only a selected packages enable FAT lto objects.
You can take a look at our META bug where such packages are linked (in most cases):
https://bugzilla.opensuse.org/show_bug.cgi?id=1133084

Or one can easily grep it from here:
https://github.com/bmwiedemann/openSUSE

$ git grep 'fat-lto-objects'
(see attachment)

>>> And to make sure that this opt-in happens, I want to fail the build if
>>> there would be any -fno-fat-lto-objects objects leaking.
>>
>> For SUSE we're checking that no LTO bytecode leaks instead, thus we check
>> for __gnu_lto_v? (I think).  The reason is that even for static libraries
>> we do not want to ship LTO bytecode.
> 
> We build with -ffat-lto-objects, and this means we can create perfectly
> fine object files by stripping the LTO data:
> 
> <https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-strip-lto>

We strip this way:
https://github.com/openSUSE/brp-check-suse/blob/2f7add6f0b7f5c2e9698d180a4761a10fb808482/brp-15-strip-debug#L38

> 
> This means that so far, we only had to fix LTO compilation problems in
> the packages, but not teach individual packages about LTO and non-LTO
> object files.  Of course it's wasteful because few packages actually
> install the object files (without a final link into a program or shared
> object), and that's what I want to fix.

And we integrated a rpmlint check that checks we don't ship a LTO bytecode:
https://github.com/rpm-software-management/rpmlint/blob/aa1f710c1b3ff409e42068c2b067ab2eee200b1d/rpmlint/checks/BinariesCheck.py#L277-L283

and there's one related check where we look if a static library contains something:
https://github.com/rpm-software-management/rpmlint/blob/aa1f710c1b3ff409e42068c2b067ab2eee200b1d/rpmlint/checks/BinariesCheck.py#L230-L255

it can happen that it only contained bytecode that was eventually striped.

Cheers,
Martin

> 
> Florian
> 

[-- Attachment #2: fat.txt --]
[-- Type: text/plain, Size: 25481 bytes --]

packages/a/ade/ade.changes:- Use -ffat-lto-objects to provide a proper static library.
packages/a/ade/ade.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/a/adios/.rev:- Fix aarch64 LTO build with -ffat-lto-objects flag
packages/a/adios/adios.changes:- Fix aarch64 LTO build with -ffat-lto-objects flag
packages/a/adios/adios.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/a/aircrack-ng/aircrack-ng.spec:export CFLAGS="-ffat-lto-objects -fcommon"
packages/a/antlr/antlr-bootstrap.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/a/antlr/antlr.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/a/attr/attr.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/b/barcode/barcode.changes:- Build using -ffat-lto-objects
packages/b/barcode/barcode.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/b/binutils/.rev:    <comment>- Use -ffat-lto-objects in order to provide assembly for static libs
packages/b/binutils/binutils.changes:- Use -ffat-lto-objects in order to provide assembly for static libs
packages/b/bison/bison.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/b/boinc-client/.rev:    <comment>- Build boinc-client using -ffat-lto-objects</comment>
packages/b/boinc-client/boinc-client.changes:- Build boinc-client using -ffat-lto-objects
packages/b/boinc-client/boinc-client.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/b/bridge-utils/bridge-utils.changes:- Use -ffat-lto-objects when building static libraries.
packages/b/bridge-utils/bridge-utils.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/c/Catch2/Catch2.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/c/carla/carla.changes:  * Do not use -ffat-lto-objects
packages/c/cgns/cgns.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/c/coturn/coturn.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/c/criu/criu.changes:- Fix build on Tumbleweed: Add -ffat-lto-objects to lto cflags.
packages/d/dhcp/dhcp.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/d/dpkg/dpkg.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/d/dpkg/update-alternatives.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/e2fsprogs/e2fsprogs.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/elfutils/.rev:    [  123s] created with -ffat-lto-objects option.
packages/e/elfutils/.rev:  And adding -ffat-lto-objects breaks run-show-die-info.sh test. (forwarded request 834600 from Guillaume_G)</comment>
packages/e/elfutils/elfutils-debuginfod.changes:    [  123s] created with -ffat-lto-objects option.
packages/e/elfutils/elfutils-debuginfod.changes:  And adding -ffat-lto-objects breaks run-show-die-info.sh test.
packages/e/elfutils/elfutils.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/eppic/eppic.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/erfa/erfa.changes:- Use -ffat-lto-objects when building static libraries.
packages/e/erfa/erfa.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/erlang/erlang.changes:- Udate -ffat-lto-objects in order to properly build static libraries
packages/e/erlang/erlang.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/e/exiv2/exiv2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/f/Fragments/Fragments.changes:- Add _lto_cflags %%{?_lto_cflags} -ffat-lto-objects define, build
packages/f/Fragments/Fragments.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/f/festival/.rev:    <comment>- Use -ffat-lto-objects when building static libraries.
packages/f/festival/festival.changes:- Use -ffat-lto-objects when building static libraries.
packages/f/festival/festival.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/f/ffcall/.rev:- Use -ffat-lto-objects when building static libraries.</comment>
packages/f/ffcall/ffcall.changes:- Use -ffat-lto-objects when building static libraries.
packages/f/ffcall/ffcall.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/f/ffmpeg-4/ffmpeg-4.changes:- Add -ffat-lto-objects to _lto_cflags to fix configure checks
packages/f/ffmpeg-4/ffmpeg-4.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/f/ffmpeg-5/ffmpeg-5.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/f/fftw3/fftw3.changes:- Add -ffat-lto-objects to avoid build failure
packages/f/fftw3/fftw3.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/f/fixmath/fixmath.spec:export CFLAGS="${CFLAGS} -ffat-lto-objects"
packages/f/fixmath/fixmath.spec:export CXXFLAGS="${CXXFLAGS} -ffat-lto-objects"
packages/f/fltk/fltk.spec:  --with-optim="%{_lto_cflags} -ffat-lto-objects" \
packages/f/folly/folly.spec:%cmake -DCMAKE_CXX_FLAGS="%optflags -ffat-lto-objects" \
packages/f/frr/frr.spec:export CFLAGS="-ffat-lto-objects"
packages/f/fuse/fuse.changes:- Enable LTO (boo#1133101) and use -ffat-lto-objects.
packages/f/fuse/fuse.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/g/gamin/gamin-devel.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/genwqe-tools/genwqe-tools.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/gflags/gflags.changes:- Use -ffat-lto-objects when building static libraries.
packages/g/gflags/gflags.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/git-delta/git-delta.spec:CFLAGS+=' -ffat-lto-objects'
packages/g/git-delta/git-delta.spec:CFLAGS+=' -ffat-lto-objects'
packages/g/git-delta/git-delta.spec:CFLAGS+=' -ffat-lto-objects'
packages/g/glib2/glib2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/glslang/glslang.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/g/glslang/glslang.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/g/gperftools/gperftools.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/gtksourceview4/gtksourceview4.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/g/gtksourceview5/gtksourceview5.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/h/hdf5/hdf5.changes:- Use -ffat-lto-objects to provide a proper static library. 
packages/h/hdf5/hdf5.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/h/hwinfo/hwinfo.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/i/icecream/icecream.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/i/inn/.rev:    <comment>- Use -ffat-lto-objects when building static libraries. (forwarded request 729850 from cgiboudeaux)</comment>
packages/i/inn/inn.changes:- Use -ffat-lto-objects when building static libraries.
packages/i/inn/inn.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/i/iproute2/iproute2.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/k/kdstatemachineeditor/kdstatemachineeditor.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/k/kernel-source/dtb-aarch64.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/dtb-armv6l.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/dtb-armv7l.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/dtb-riscv64.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-64kb.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-debug.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-default.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-docs.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-kvmsmall.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-lpae.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-obs-build.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-obs-qa.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-pae.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-source.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-syms.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-vanilla.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kernel-source/kernel-zfcpdump.changes:- perf build: Don't use -ffat-lto-objects in the python feature
packages/k/kimap/kimap.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/k/ksh/ksh.changes:  -ffat-lto-objects
packages/k/ksh/ksh.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/k/kst/.rev:    <comment>- Use -ffat-lto-objects</comment>
packages/k/kst/kst.changes:- Use -ffat-lto-objects
packages/k/kst/kst.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/lapack/lapack.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/leveldb/leveldb.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/linphoneqt/linphoneqt.spec:  -DCMAKE_CXX_FLAGS="%{optflags} -fpic -ffat-lto-objects -fpermissive" \
packages/l/live555/live555.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/lsp-plugins/lsp-plugins.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/l/lua51/lua51.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/lua53/lua53.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/l/lzo/lzo.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/lib3/lib3270/lib3270.changes:- Use -ffat-lto-objects when building static libraries.
packages/liba/libatomic_ops/libatomic_ops.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/libb/libbobcat/libbobcat.spec:export CXXFLAGS="%{optflags} --std=c++2a -Werror -fdiagnostics-color=never -ffat-lto-objects"
packages/libb/libbobcat/libbobcat.spec:export CXXFLAGS="%{optflags} --std=c++2a -Werror -fdiagnostics-color=never -ffat-lto-objects"
packages/libb/libbpf/libbpf.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libb/libbsd/libbsd.spec:export CFLAGS="%{optflags} -ffat-lto-objects"
packages/libc/libcap/libcap.changes:- Build using -ffat-lto-objects for static library 
packages/libc/libcapi20/libcapi20.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libd/libdwarf/libdwarf.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libe/libevent/libevent.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libf/libfallocate/libfallocate.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libf/libfsapfs/libfsapfs.spec:%define _lto_cflags -ffat-lto-objects
packages/libg/libguestfs/libguestfs.changes:- Use -ffat-lto-objects when building static libraries.
packages/libo/liboping/liboping.changes:- Use -ffat-lto-objects when building static libraries.
packages/libo/liboping/liboping.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libp/libpcap/libpcap.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libp/libpfm/libpfm.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libq/libqt5-qtlocation/.rev:- Use -ffat-lto-objects (boo#1158510)
packages/libq/libqt5-qtlocation/libqt5-qtlocation.changes:- Use -ffat-lto-objects (boo#1158510)
packages/libq/libqt5-qtlocation/libqt5-qtlocation.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/libq/libqt5-qttools/.rev:    <comment>- Use -ffat-lto-objects in order to provide proper static library:
packages/libq/libqt5-qttools/libqt5-qttools.changes:- Use -ffat-lto-objects in order to provide proper static library:
packages/libq/libqt5-qttools/libqt5-qttools.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libq/libquo/libquo.changes:- Use -ffat-lto-objects when building static libraries.
packages/libq/libquo/libquo.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libr/libraw/libraw.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libr/libreadline5/libreadline5.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/libr/librtas/.rev:    <comment>- Add -ffat-lto-objects to avoid ppc64le build error (forwarded request 731073 from michel_mno)</comment>
packages/libr/librtas/librtas.changes:- Add -ffat-lto-objects to avoid ppc64le build error
packages/libr/librtas/librtas.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libs/libsemanage/libsemanage.changes:  * Enable LTO (Link Time Optimization) and build with -ffat-lto-objects
packages/libs/libsigsegv/libsigsegv.spec:%add_optflags -ffat-lto-objects
packages/libs/libsolv/.rev:    <comment>- Add -ffat-lto-objects to $optflags as the package provides
packages/libs/libsolv/libsolv.changes:- Add -ffat-lto-objects to $optflags as the package provides
packages/libs/libsolv/libsolv.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/libs/libstfl/libstfl.changes:- Use -ffat-lto-objects when building static libraries.
packages/libs/libstfl/libstfl.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libv/libv3270/libv3270.changes:- Use -ffat-lto-objects when building static libraries.
packages/libx/libXpresent/libXpresent.changes:- Add -ffat-lto-objects to _lto_cflags
packages/libx/libXpresent/libXpresent.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libx/libx86/libx86.changes:- Use -ffat-lto-objects when building static libraries.
packages/libx/libx86/libx86.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libx/libxdg-basedir/libxdg-basedir.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/liby/libyajl/libyajl.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/libz/libzio/libzio.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mariadb/mariadb.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mathgl/mathgl.changes:- Use -ffat-lto-objects when building static libraries.
packages/m/mathgl/mathgl.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mathomatic/mathomatic.spec:OPTFLAGS="%{optflags} -g -ffat-lto-objects"
packages/m/mold/mold.changes:  * mold can now handle GCC LTO files created with -ffat-lto-objects. (804b843)
packages/m/mozilla-nspr/mozilla-nspr.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mozilla-nss/mozilla-nss.changes:- Use -ffat-lto-objects in order to provide assembly for static libs.
packages/m/mozilla-nss/mozilla-nss.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mpc/mpc.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mpdecimal/mpdecimal.spec:# NOTE: without -ffat-lto-objects the inline assembly tests in ./configure
packages/m/mpdecimal/mpdecimal.spec:export CFLAGS="%optflags -ffat-lto-objects"
packages/m/mpiP/mpiP.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mpich/mpich.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mruby/mruby.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mujs/mujs.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mumps/mumps.changes:- Use -ffat-lto-objects to provide proper static library.
packages/m/mumps/mumps.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mupdf/mupdf.changes:- Use -ffat-lto-objects when building static libraries.
packages/m/mupdf/mupdf.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/m/mvapich2/mvapich2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/n/nagios/nagios.changes:- compile with -ffat-lto-objects to prevent build failure 
packages/n/nagios/nagios.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/n/ncurses/ncurses.spec:%global _lto_cflags_shared %{?_lto_cflags} -ffat-lto-objects
packages/n/netcdf-cxx4/netcdf-cxx4.changes:- Use -ffat-lto-objects to provide a proper static library.
packages/n/netcdf-cxx4/netcdf-cxx4.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/n/netcdf-fortran/netcdf-fortran.changes:- Add -ffat-lto-objects for static build.
packages/n/netcdf-fortran/netcdf-fortran.spec:%{?_lto_cflags: %global _lto_cflags %{?_lto_cflags} -ffat-lto-objects}
packages/n/netcdf/netcdf.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/n/newt/newt.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/ocfs2-tools/ocfs2-tools.changes:- Use -ffat-lto-objects when building static libraries.
packages/o/ocfs2-tools/ocfs2-tools.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/open-isns/Quiet-a-commpiler-warning.patch:[   33s] gcc -Wall -Wextra -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g -I. -Iinclude -I. -I./include -flto=auto -ffat-lto-objects -o tests/pauw4 tests/pauw4.o -L. -lisns -Wl,--as-needed -lcrypto
packages/o/open-isns/open-isns.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/o/openblas/openblas.changes:- Add -ffat-lto-objects to get proper static archives
packages/o/openblas/openblas.spec:# For static libraries use -ffat-lto-objects to make sure the 'regular'
packages/o/openblas/openblas.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openldap2/openldap2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openmpi1/openmpi1.changes:- Add -ffat-lto-objects in spec to avoid build error
packages/o/openmpi1/openmpi1.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openmpi2/openmpi2.changes:- Add -ffat-lto-objects in spec to avoid build error
packages/o/openmpi2/openmpi2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openmpi3/openmpi3.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openmpi4/openmpi4.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/o/openmpi5/openmpi5.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/paraview/paraview.changes:- Pass -ffat-lto-objects for static libs.
packages/p/paraview/paraview.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pcapplusplus/pcapplusplus.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pcre/pcre.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pcre2/pcre2.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pixmap/pixmap.changes:- Use -ffat-lto-objects to build pixmap
packages/p/pixmap/pixmap.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pnetcdf/pnetcdf.changes:- Use -ffat-lto-objects when building static libraries.
packages/p/pnetcdf/pnetcdf.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql10/postgresql10.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql11/postgresql11.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql12/postgresql12.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql13/postgresql13.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql14/postgresql14.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/postgresql15/postgresql15.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/p/pw3270/pw3270.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/q/qhull/qhull.changes:  built with "-ffat-lto-objects"; add this to CXXFLAGS.
packages/q/qhull/qhull.spec:export CXXFLAGS+=" -ffat-lto-objects"
packages/q/qt6-declarative/qt6-declarative.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/r/readline/readline.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/r/remind/.rev:- MINOR FIX: Don't use the -ffat-lto-objects if we're compiling with Clang.
packages/r/remind/remind.changes:- MINOR FIX: Don't use the -ffat-lto-objects if we're compiling with Clang.
packages/s/SDL2/SDL2.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/s/SILLY/SILLY.changes:- Use -ffat-lto-objects when building static libraries.
packages/s/SILLY/SILLY.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/SampleICC/SampleICC.changes:- Use -ffat-lto-objects when building static libraries.
packages/s/SampleICC/SampleICC.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/sbc/sbc.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/scalapack/scalapack.changes:- Use -ffat-lto-objects to provide a proper static library. 
packages/s/scalapack/scalapack.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/scheme48/scheme48.changes:- Use -ffat-lto-objects when building static libraries.
packages/s/scheme48/scheme48.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/scotch/scotch.changes:- Use -ffat-lto-objects to provide a proper static library.
packages/s/scotch/scotch.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/sdl12_compat/sdl12_compat.spec:%global _lto_cflags %_lto_cflags -ffat-lto-objects
packages/s/sendmail/sendmail.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/s/signon/signon.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/slang/slang.spec:# %%global _lto_cflags %%{_lto_cflags} -ffat-lto-objects
packages/s/slurm/.rev:  * Add -ffat-lto-objects to the build flags when LTO is set to
packages/s/slurm/slurm.changes:  * Add -ffat-lto-objects to the build flags when LTO is set to
packages/s/slurm/slurm.spec:# testsuite package we need to build with -ffat-lto-objects.
packages/s/slurm/slurm.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/squirrel/squirrel.changes:- Use -ffat-lto-objects when building static libraries.
packages/s/squirrel/squirrel.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/strace/.rev:    <comment>- Use -ffat-lto-objects to work around mpers.sh failure (forwarded request 758125 from Andreas_Schwab)</comment>
packages/s/strace/strace.changes:- Use -ffat-lto-objects to work around mpers.sh failure
packages/s/suitesparse/suitesparse.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/s/sysprof/sysprof.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tcl/tcl.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tcpd/tcpd.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tdom/tdom.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tensorflow-lite/tensorflow-lite.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/t/termcap/termcap.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tk/tk.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/tkimg/tkimg.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/t/trousers/.rev:  text section from libtddl.a. By passing -ffat-lto-objects the object format
packages/t/trousers/fix-lto.patch:+libtddl_a_CFLAGS=-ffat-lto-objects -DAPPID=\"TCSD\ TDDL\" -I${top_srcdir}/src/include -fPIE -DPIE
packages/t/trousers/trousers.changes:  text section from libtddl.a. By passing -ffat-lto-objects the object format
packages/t/trousers/trousers.spec:CFLAGS="%{optflags} -Wall -fno-strict-aliasing -fgnu89-inline -ffat-lto-objects"
packages/u/util-linux/util-linux.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/u/uudeview/uudeview.changes:- Use -ffat-lto-objects when building static libraries.
packages/u/uudeview/uudeview.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/v/Vc/Vc.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/v/vlc/vlc.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/v/vtk/vtk.changes:- Drop -ffat-lto-objects to avoid wasting disk space
packages/v/vtk/vtk.changes:- Use -ffat-lto-objects when building static libraries.
packages/w/webrtc-audio-processing/webrtc-audio-processing.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/x/xmgrace/xmgrace.changes:- Use -ffat-lto-objects to build xmgrace.
packages/x/xmgrace/xmgrace.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/x/xorg-x11-server/.rev:  * added &quot;%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects&quot;</comment>
packages/x/xorg-x11-server/xorg-x11-server.changes:  * added "%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects"
packages/x/xorg-x11-server/xorg-x11-server.spec:%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
packages/x/xz/xz.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/y/yasm/yasm.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/z/zlib/zlib.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
packages/z/zstd/zstd.spec:%global _lto_cflags %{_lto_cflags} -ffat-lto-objects

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Using __gnu_lto_slim to detect -fno-fat-lto-objects
  2023-02-22  8:18 Using __gnu_lto_slim to detect -fno-fat-lto-objects Florian Weimer
  2023-02-22  8:23 ` Richard Biener
@ 2023-03-02 23:57 ` Jeff Law
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Law @ 2023-03-02 23:57 UTC (permalink / raw)
  To: Florian Weimer, gcc



On 2/22/23 01:18, Florian Weimer via Gcc wrote:
> Can we use the COMMON symbol __gnu_lto_slim to detect
> -fno-fat-lto-objects on contemporary GNU/Linux (with the LTO linker
> plugin)?
> 
> We currently build the distribution with -ffat-lto-objects, and I want
> to switch away from that.  Packages will need to opt in to
> -ffat-lto-objects if static objects they build escape the buildroot.
> And to make sure that this opt-in happens, I want to fail the build if
> there would be any -fno-fat-lto-objects objects leaking.
Thanks for taking care of this.  It's one of the things I wish I'd had 
time to fix before leaving Red Hat.   We burn a fair amount of builder 
time due to this issue right now.

jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-02 23:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  8:18 Using __gnu_lto_slim to detect -fno-fat-lto-objects Florian Weimer
2023-02-22  8:23 ` Richard Biener
2023-02-22  8:28   ` Florian Weimer
2023-02-22  8:58     ` Richard Biener
2023-02-23  9:53     ` Martin Liška
2023-03-02 23:57 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).