[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/24873] gcc -flto objects result in --start-group … --end-group f
From: |
amodra at gmail dot com |
Subject: |
[Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries |
Date: |
Mon, 05 Aug 2019 05:08:27 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24873
--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
OK, so I fixed the build dependency but when I build locally using CFLAGS="-O2
-g -flto" CXXFLAGS="-O2 -g -flto" and gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
I don't reproduce the problem. Oh yes, lots more -lm on the link command line
for test-utils in my case (and -ludev -levdev), so I took them all out except
for the ones inside --start-group/--end-group and still it links OK.
Linking with mapfile output shows libm is pulled in due to reference to floor
in lib_check_pic.a:
libm.so.6 /usr/lib/x86_64-linux-gnu/libcheck_pic.a(check.o)
(floor@@GLIBC_2.2.5)
Huh, given that lib_check_pic.a was outside --start-group/--end-group I should
have left in -lm after that archive.. Only not a problem due to -flto objects
causing ld to scan over libraries again.
Also, the mapfile shows the recompiled LTO objects (ltrans.o) being inserted
somewhere reasonably sensible.
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o
LOAD test-utils.ltrans0.ltrans.o
START GROUP
LOAD libinput.so.10.13.0
LOAD liblibinput-util.a
LOAD libquirks.a
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libmtdev.so
LOAD /lib/x86_64-linux-gnu/libudev.so
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libevdev.so
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libm.so
START GROUP
LOAD /lib/x86_64-linux-gnu/libm.so.6
LOAD /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a
LOAD /lib/x86_64-linux-gnu/libmvec.so.1
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/librt.so
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libwacom.so
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcheck_pic.a
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libsubunit.so
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libdl.so
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so
START GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libpthread.so
START GROUP
LOAD /lib/x86_64-linux-gnu/libpthread.so.0
LOAD /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libc.so
START GROUP
LOAD /lib/x86_64-linux-gnu/libc.so.6
LOAD /usr/lib/x86_64-linux-gnu/libc_nonshared.a
LOAD /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so
START GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a
END GROUP
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o
LOAD /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/24873] New: ld.bfd fails if -lm is included only once within --start-group … --end-group, dilyan.palauzov at aegee dot org, 2019/08/02
- [Bug ld/24873] ld.bfd fails if -lm is included only once within --start-group … --end-group, dilyan.palauzov at aegee dot org, 2019/08/02
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/02
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, dilyan.palauzov at aegee dot org, 2019/08/03
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/04
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/04
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries,
amodra at gmail dot com <=
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, dilyan.palauzov at aegee dot org, 2019/08/05
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, dilyan.palauzov at aegee dot org, 2019/08/05
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, cvs-commit at gcc dot gnu.org, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, cvs-commit at gcc dot gnu.org, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, amodra at gmail dot com, 2019/08/06
- [Bug ld/24873] gcc -flto objects result in --start-group … --end-group failure to include --as-needed libraries, dilyan.palauzov at aegee dot org, 2019/08/06