Date: Thu, 21 Mar 2019 01:13:06 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 236676] lang/gcc8: Loader picks up wrong libstc++.so Message-ID: <bug-236676-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236676 Bug ID: 236676 Summary: lang/gcc8: Loader picks up wrong libstc++.so Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: gerald@FreeBSD.org Reporter: peter.henderson@ieee.org Assignee: gerald@FreeBSD.org Flags: maintainer-feedback?(gerald@FreeBSD.org) Attachment #203017 text/plain mime type: Created attachment 203017 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D203017&action= =3Dedit Program where incorrect libstdc++ causes a failure. I'm not sure who's responsibility this is, but as it can effect any gcc8 us= er, I am reporting it here. The loader is picking up /usr/local/lib/compat/libstdc++.so.6,rather than /usr/local/lib/gcc8/libstdc++.so.6.0.25. "pkg which /usr/local/lib/compat/libstdc++.so.6" outputs: /usr/local/lib/compat/libstdc++.so.6 was installed by package compat9x-amd64-9.3.903000.20170608 As a result, my test program "./gcc-ld-test" outputs:=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 /usr/local/lib/compat/libstdc++.so.6: version GLIBCXX_3.4.11 required by /usr/home/peterh/ieee-754/test/gcc-ld-test not found "ldd ./gcc-ld-test" outputs: ./gcc-ld-test: libstdc++.so.6 =3D> /usr/local/lib/compat/libstdc++.so.6 (0x8008370= 00) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x800b3e000) libc.so.7 =3D> /lib/libc.so.7 (0x800d4d000) libm.so.5 =3D> /lib/libm.so.5 (0x801109000) gcc-ld-test was compiled using: gcc8 -D BAD_LD -lstdc++ -o gcc-ld-test gcc-ld-test.cpp The -D BAD_LD turns on the failure. I.e. without "-D BAD_LD" the program s= till need libstdc++ and still loads /usr/local/lib/compat/libstdc++.so.6, but ru= ns without any problems. The problem is triggered when I use boost format. "pkg version" outputs: gcc8-8.3.0 =3D compat9x-amd64-9.3.903000.20170608 ? boost-libs-1.69.0_1 =3D "uname -a" outputs: FreeBSD 11.2-RELEASE-p9 #0 r343989: Mon Feb 11 17:52:41 AEDT 2019=20=20=20= =20 root@hydrogen:/usr/obj/usr/src/sys/GENERIC amd64 I was able to fix the problem, and hence run my program in one of two ways: 1) Use: gcc8 -D BAD_LD -o gcc-ld-test gcc-ld-test.cpp /usr/local/lib/gcc8/libstdc++= .a The program then works and "ldd ./gcc-ld-test" outputs: ./gcc-ld-test: libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x8008ef000) libc.so.7 =3D> /lib/libc.so.7 (0x800afe000) 2) Use: gcc8 -D BAD_LD -rpath=3D/usr/local/lib/gcc8 -lstdc++ -o gcc-ld-test gcc-ld-= test Again the program works and=20 "ldd ./gcc-ld-test" outputs: ./gcc-ld-test: libstdc++.so.6 =3D> /usr/local/lib/gcc8/libstdc++.so.6 (0x800822000) libc.so.7 =3D> /lib/libc.so.7 (0x800bb7000) libm.so.5 =3D> /lib/libm.so.5 (0x800f73000) libgcc_s.so.1 =3D> /usr/local/lib/gcc8/libgcc_s.so.1 (0x8011a0000) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236676-7788>