From owner-freebsd-toolchain@freebsd.org Tue Feb 23 09:50:39 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D748EAB11BE for ; Tue, 23 Feb 2016 09:50:39 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-153.reflexion.net [208.70.211.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BCE11B8B for ; Tue, 23 Feb 2016 09:50:38 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 11175 invoked from network); 23 Feb 2016 09:50:33 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 23 Feb 2016 09:50:33 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Tue, 23 Feb 2016 04:50:26 -0500 (EST) Received: (qmail 1580 invoked from network); 23 Feb 2016 09:50:26 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 23 Feb 2016 09:50:26 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 349181C43CA; Tue, 23 Feb 2016 01:50:31 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: projects/clang380-import for TARGET_ARCH=powerpc64: /lib/libgcc_s.so.1 is incompatible with using the pair: /usr/lib/libc++.so.1 and /lib/libcxxrt.so.1 for C++ exception handling Date: Tue, 23 Feb 2016 01:50:31 -0800 Message-Id: <5B9137BF-0E86-4C4B-A3FB-18F444A850AC@dsl-only.net> Cc: Roman Divacky , Dimitry Andric To: FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 09:50:39 -0000 For TARGET_ARCH=3Dpowerpc64 it looks like FreeBSD's /lib/libgcc_s.so.1 = is incompatible with using the pair: /usr/lib/libc++.so.1 and = /lib/libcxxrt.so.1 . Evidence details follow. (Now using projects/clang380-import -r295902 as = a context.) src.conf was set up to have things such that the buildworld/buildkernel = that this is based on was via : devel/powerpc64-gcc as the (self hosted) cross compiler ( /usr/local/bin/powerpc64-portbld-freebsd11.0-g++ ) and clang 3.8.0 as the "host" compiler. Later below I list the ldd output for compiling the exception_test.cpp = example under different compilers with different options that change = what ldd shows and how .so's are found/bound. Some are implicitly using. = . . ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib = /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg /usr/local/lib/gcc49 = /usr/local/lib/gcc6 and others are explicitly bound, such as by -Wl,-rpath=3D . The only combinations that get the unbounded looping internal to = exception handling are the ones that mix 3 things together: /usr/lib/libc++.so.1 /lib/libcxxrt.so.1 /lib/libgcc_s.so.1 That is: exception_test.clang++380.powerpc64 and = exception_test.powerpc64-gcc.powerpc64 get the unbounded looping and the = others work fine. Note that all 3 libraries were built by devel/powerpc64-gcc during = buildworld, not by clang 3.8.0 . And = exception_test.powerpc64-gcc.powerpc64 does not involve clang 3.8.0 = based code at all. Still libc++.so.1 and libcxxrt.so.1 are "foreign" relative to = libgcc_s.so.1 and so there being some form of mismatch possible makes = some sense. That same /lib/libgcc_s.so.1 works fine with: /usr/local/lib/gcc49/libstdc++.so.6 and /usr/local/lib/gcc6/libstdc++.so.6 Of course a matched libstdc++/libgcc_s pair for a specific g++ compiler = also works. The combinations tested are . . . # ldd *powerpc64 exception_test.clang++380.powerpc64: libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x50054000) libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x5015a000) libm.so.5 =3D> /lib/libm.so.5 (0x50181000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x501be000) libc.so.7 =3D> /lib/libc.so.7 (0x501e4000) exception_test.g++49-implicitgcc49.powerpc64: libstdc++.so.6 =3D> /usr/local/lib/gcc49/libstdc++.so.6 = (0x50054000) libm.so.5 =3D> /lib/libm.so.5 (0x501ed000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x5022a000) libc.so.7 =3D> /lib/libc.so.7 (0x50250000) exception_test.g++49.powerpc64: libstdc++.so.6 =3D> /usr/local/lib/gcc49/libstdc++.so.6 = (0x50054000) libm.so.5 =3D> /lib/libm.so.5 (0x501ed000) libgcc_s.so.1 =3D> /usr/local/lib/gcc49/libgcc_s.so.1 = (0x5022a000) libc.so.7 =3D> /lib/libc.so.7 (0x50253000) exception_test.g++6-implicitgcc49.powerpc64: libstdc++.so.6 =3D> /usr/local/lib/gcc49/libstdc++.so.6 = (0x50054000) libm.so.5 =3D> /lib/libm.so.5 (0x501ed000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x5022a000) libc.so.7 =3D> /lib/libc.so.7 (0x50250000) exception_test.g++6.powerpc64: libstdc++.so.6 =3D> /usr/local/lib/gcc6/libstdc++.so.6 = (0x50054000) libm.so.5 =3D> /lib/libm.so.5 (0x502a6000) libgcc_s.so.1 =3D> /usr/local/lib/gcc6/libgcc_s.so.1 = (0x502e3000) libc.so.7 =3D> /lib/libc.so.7 (0x5030a000) exception_test.powerpc64-gcc.powerpc64: libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x50053000) libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x50159000) libm.so.5 =3D> /lib/libm.so.5 (0x50180000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x501bd000) libc.so.7 =3D> /lib/libc.so.7 (0x501e3000) NOTE: Why no g++5 test using its /usr/local/lib/gcc5/libstdc++.so.6? Currently devel/powerpc64-gcc and lang/gcc5 are both at 5.3 and that = makes them conflict on files if one tries to build both ports. So I have just devel/powerpc64-gcc, the "officially produced" cross = compiler port for targeting modernized powerpc64 builds. =3D=3D=3D Mark Millard markmi at dsl-only.net