From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10903 invoked by alias); 25 Jan 2013 13:56:26 -0000 Received: (qmail 10892 invoked by uid 22791); 25 Jan 2013 13:56:25 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.salomon.at (HELO smtp.salomon.at) (193.186.16.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Jan 2013 13:55:23 +0000 Received: from samail03.wamas.com ([172.28.2.2] helo=mailhost.salomon.at) by smtp.salomon.at with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77) (envelope-from ) id 1TyjkV-0005my-Ca; Fri, 25 Jan 2013 14:55:20 +0100 Received: from [172.28.8.170] by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1TyjkV-0001CB-8Z; Fri, 25 Jan 2013 14:55:19 +0100 Message-ID: <51028EC7.1070807@salomon.at> Date: Fri, 25 Jan 2013 13:56:00 -0000 From: Michael Haubenwallner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120327 Thunderbird/10.0.3 MIME-Version: 1.0 To: David Edelsohn CC: GCC Patches Subject: Re: [PATCH, regression?] Support --static-libstdc++ with native AIX ld References: <5100FC73.8090300@salomon.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg01237.txt.bz2 On 01/24/2013 06:45 PM, David Edelsohn wrote: >> Since switching to C++ inside gcc, it isn't possible to get working gcc/g++ >> binaries installed using native ld on AIX without this patch, as these need >> dynamic libstdc++.a from builddir(!). Even after successful build with the >> workaround from PR55105[1], installed binaries break when removing builddir. > > I build GCC almost daily on AIX and test installation and do not have > this problem. Hmm - which "oslevel -s" do you use? Here I've tried on 7100-01-05-1228. Also available are 5300-08-09-1013 and 6100-07-05-1228. According to http://www.ibm.com/developerworks/aix/library/au-aix5l-me.html AIX does listen to LD_LIBRARY_PATH since 5.3 now. In case you do have an AIX 5.2 or older, or some other AIX TechLevel that does not use LD_LIBRARY_PATH for whatever reason, to trigger the same problem this patch to toplevel configure should work I guess: --- a/configure +++ b/configure @@ -6978,6 +6978,7 @@ rm -f conftest* # Decide which environment variable is used to find dynamic libraries. case "${host}" in + *-*-aix*) RPATH_ENVVAR=LIBPATH ;; *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; Actually, I'm wondering why this shouldn't go in anyway for consistency across platforms. > Are you configuring GCC in a special way? Do you set the installation > directory prefix when you configure? I don't believe what I do is something really special. > I build GCC with GCC and have an older version of GCC (including libstdc++) already installed. Same here, building everything out-of-source. The prerequisites used are: * CONFIG_SHELL=/usr/local/bin/bash 4.1.7 from bullfreeware (symlinks to /opt/freeware/bin/) * /usr/bin/{gcc,g++} 4.6.1 from bullfreeware (symlinks to /opt/freeware/bin/) * /usr/bin/gmake 3.82 from bullfreeware (symlinks to /opt/freeware/bin/) * gmp-5.0.4: as shared library, configured with --prefix=/prereq ABI=32 * mpfr-3.1.1: as shared library, configured with --prefix=/prereq --with-gmp=/prereq * mpfr-3.1.1: as shared library, configured with --prefix=/prereq --with-{gmp,mpfr}=/prereq * gawk-3.1.7, flex-2.5.35, m4-1.4.13 from some Gentoo Prefix instance, nowhere in PATH, thus: export {AWK,FLEX}=/gentoo/prefix/usr/bin/{awk,flex} and this patch: http://gcc.gnu.org/ml/gcc-patches/2013-01/msg00960.html For gcc: * $CONFIG_SHELL configure --prefix=/does/not/exist/yet --with-{gmp,mpfr,mpc}=/prereq \ --enable--languages=c,c++ --disable-werror --disable-nls * gmake bootstrap But unlike you, I do not use --with-boot-ldflags. > I do not understand why you refer to native ld on AIX and what that > has to do with any problem. AIX ld does not understand the -Bstatic/-Bdynamic flags. According to where this very patch adds -bstatic/-bdynamic for AIX ld, the -Bstatic/-Bdymamic flags will be used with GNU ld for -static-libstdc++. So I'm guessing that libstdc++ will be statically linked into gcc,g++,cc1(?) with GNU ld. However, must admit that I've never tried hard enough to get GNU binutils working. > $ dump -H cc1 > > ***Import File Strings*** > INDEX PATH BASE MEMBER > 0 /tmp/20130123/prev-powerpc-ibm-aix7.1.0.0/libstdc++-v3/src/.libs:/tmp/20130123/prev-powerpc-ibm-aix7.1.0.0/libstdc++-v3/libsupc++/.libs:/usr/gnu/lib:../zlib:/tmp/20130123/./prev-gcc:/usr/lib:/lib > Yes, it refers to the build directory, but it also include > /usr/gnu/lib on the path and a copy of libstdc++.a is in /usr/gnu/lib. Feels like this is because of --with-boot-ldflags=-L/usr/gnu/lib only, or because of gmp,mpfr,mpc being found there. > I often re-link the executable and add -Wl,-blibpath: to set a > narrower search path. Do you do run these re-link steps manually? > With your patch do you configure with any additional options to cause > the libraries to be linked statically? Nope. > The values you set in the patch are correct, but something still does > not make sense with the problem. All things considered, simply feels like your AIX doesn't listen to LD_LIBRARY_PATH. /haubi/