public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libquadmath/112963] New: [14 Regression] Incorrect linking of libquadmath since r14-4863
@ 2023-12-11 15:23 jakub at gcc dot gnu.org
  2023-12-11 15:23 ` [Bug libquadmath/112963] " jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-11 15:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112963

            Bug ID: 112963
           Summary: [14 Regression] Incorrect linking of libquadmath since
                    r14-4863
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libquadmath
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Since r14-4863-g538dcde872abba589b3c8a57181bd7f91018c67a libquadmath is linked
incorrectly on Linux, without the required libm.so.6 DT_NEEDED entry, even when
it
calls libm.so.6 signgam, sqrt and on powerpc64le-linux also __sqrtieee128
entrypoints.
Short reproducer reduced from libtool's testsuite on powerpc64le-linux:

( echo '      subroutine a1(res)'; echo '      integer*4 res'; echo '     
res=1'; echo '      return'; echo '      end' ) > a1.f; sed 's/1/2/g' < a1.f >
a2.f; ( echo '      program main'; echo '      integer*4 res'; echo '      call
a1(res)'; echo '      call a2(res)'; echo '      end' ) > main2.f; rm -rf
.libs; mkdir .libs; gfortran -O2 -mcpu=power8 -c a1.f -fPIC -o .libs/a1.o;
gfortran -O2 -mcpu=power8 -c a2.f -fPIC -o .libs/a2.o; gfortran -O2
-mcpu=power8 -c main2.f -fPIC -o .libs/main2.o; ar cr .libs/liba1.a .libs/a1.o;
ranlib .libs/liba1.a; ar cr .libs/liba2.a .libs/a2.o; ranlib .libs/liba2.a;
gfortran -shared -fPIC -Wl,--whole-archive ./.libs/liba1.a ./.libs/liba2.a
-Wl,--no-whole-archive -lgfortran -lm -lgcc_s -lquadmath -lm -lgcc_s -lc
-lgcc_s -O2 -mcpu=power8 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,--build-id=sha1
-Wl,-soname -Wl,liba12.so.0 -o .libs/liba12.so.0.0.0; ln -sf liba12.so.0.0.0
.libs/liba12.so.0; ln -sf liba12.so.0.0.0 .libs/liba12.so; gfortran -O2
-mcpu=power8 -Wl,-z -Wl,relro -Wl,--as-needed -Wl,--build-id=sha1 -o .libs/main
.libs/main2.o ./.libs/liba12.so -Wl,-rpath,.libs/; .libs/main
This segfaults now, the above can be compiled even with gcc 13 and/or run
against gcc 13 libgfortran.so.5 and/or libgcc_s.so.1, the only thing for the
crash that matters is whether it dynamically links against gcc 13
libquadmath.so.0 (then it works) or gcc 14 libquadmath.so.0 (then it crashes).

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

end of thread, other threads:[~2023-12-12  8:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 15:23 [Bug libquadmath/112963] New: [14 Regression] Incorrect linking of libquadmath since r14-4863 jakub at gcc dot gnu.org
2023-12-11 15:23 ` [Bug libquadmath/112963] " jakub at gcc dot gnu.org
2023-12-11 15:43 ` schwab@linux-m68k.org
2023-12-11 15:44 ` iains at gcc dot gnu.org
2023-12-11 15:46 ` iains at gcc dot gnu.org
2023-12-11 15:53 ` pinskia at gcc dot gnu.org
2023-12-11 15:59 ` jakub at gcc dot gnu.org
2023-12-11 16:05 ` iains at gcc dot gnu.org
2023-12-11 16:19 ` jakub at gcc dot gnu.org
2023-12-11 16:27 ` iains at gcc dot gnu.org
2023-12-11 16:31 ` jakub at gcc dot gnu.org
2023-12-11 16:35 ` jakub at gcc dot gnu.org
2023-12-11 16:40 ` iains at gcc dot gnu.org
2023-12-11 22:48 ` iains at gcc dot gnu.org
2023-12-11 22:50 ` jakub at gcc dot gnu.org
2023-12-12  8:07 ` cvs-commit at gcc dot gnu.org
2023-12-12  8:10 ` jakub at gcc dot gnu.org

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).