From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B67E3858D28; Mon, 11 Oct 2021 10:08:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B67E3858D28 From: "qiu.chaofan at outlook dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++ Date: Mon, 11 Oct 2021 10:08:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: qiu.chaofan at outlook dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2021 10:08:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100912 Qiu Chaofan changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |qiu.chaofan at outlook dot= com --- Comment #5 from Qiu Chaofan --- Hi, I encountered the same problem when dynamically linking against libstdc= xx, while static linking works fine. The HEAD of git history is 8f323c712 (early Sep.) so it shouldn't be old. The configure option is: --enable-languages=3Dc,c++ --disable-nls --disable-bootstrap --with-long-double-format=3Dieee --disable-libgomp --enable-multilib --with-cpu=3Dpower9 --with-advance-toolchain=3Dat15.0 (Disabling multilib still has this issue) By digging into make log, I found something interesting (some omitted): libtool: link: /build/./gcc/xgcc -shared-libgcc ... -fPIC -DPIC -D_GLIBCXX_SHARED -shared -nostdlib /opt/at15.0/lib/../lib64/crti.o /build/./gcc/crtbeginS.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-ldbl.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o .libs/compatibility-ldbl-alt128.o .libs/compatibility-ldbl-alt128-cxx11.o=20 -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a ../src/c++17/.libs/libc++17convenience.a ../src/c++20/.libs/libc++20convenience.a ... -Wl,-soname -Wl,libstdc++.so.6= -o .libs/libstdc++.so.6.0.29 Only the 'compatibility' objects joined the link, and they're built using `-mabi=3Dibmlongdouble`, not IEEE. Manually adding `c++11/wlocale-inst.o` produces error complaining about multiple definition. While libstdc++.a contains all of these definitions, actually seven (compatibility-ldbl.o compatibility-ldbl-alt128.o compatibility-ldbl-alt128-cxx11.o cxx11-locale-inst.o cxx11-wlocale-inst.o locale-inst.o wlocale-inst.o ), so ld can find the correct one properly. (although I'm still not clear h= ow ld does it) If I understood correctly, the reason why result is incorrect is that the `libstdc++.so` only contains symbols built for compatibility. Maybe somethi= ng went wrong in the build scripts?=