From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15658 invoked by alias); 25 Jan 2008 22:10:54 -0000 Received: (qmail 15647 invoked by uid 22791); 25 Jan 2008 22:10:52 -0000 X-Spam-Check-By: sourceware.org Received: from sitemail2.everyone.net (HELO omta18.mta.everyone.net) (216.200.145.36) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 25 Jan 2008 22:10:34 +0000 Received: from dm43.mta.everyone.net (bigiplb-dsnat [172.16.0.19]) by omta18.mta.everyone.net (Postfix) with ESMTP id 8CE594174C for ; Fri, 25 Jan 2008 14:10:32 -0800 (PST) X-Eon-Dm: dm43 Received: by dm43.mta.everyone.net (EON-AUTHRELAY2[SSL] - 403473b2) id dm43.4797ad05.baf0e for ; Fri, 25 Jan 2008 14:10:32 -0800 X-Eon-Sig: AQLrNytHml5YJfV2SQIAAAAB,25644559a957de0f43a26ef3d0215934 From: "Jonathan Saxton" To: References: Subject: Linking problems with gcc 4.2.2 and AIX 5.2 Date: Sat, 26 Jan 2008 09:21:00 -0000 Message-ID: <009401c85f9f$1c2191e0$381110ac@nycapt35k.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00259.txt.bz2 A newbie gcc builder here. I=92ve found reports of similar problems from a year or so back but no real resolution so I have to ask again. Recently I used gcc 4.0.0 to compile gcc 4.2.2 on AIX 5.2.=A0 Compiler seems to work fine until I go to link something, then I get some fairly basic STL things unresolved.=A0 My test program is taken from the introductory chapte= rs of C++ Template Metaprogramming by Abrahams & Gurtovoy. #include template struct binary { =A0=A0=A0 static unsigned const long value =3D =A0=A0=A0=A0=A0=A0=A0 binary::value * 2 + N%10; }; template <> struct binary<0> { =A0=A0=A0 static unsigned const long value =3D 0L; }; int main() { =A0=A0=A0 std::cout =A0=A0=A0=A0=A0=A0 << "The answer to the question of Life, the Universe and= Everything is " =A0=A0=A0=A0=A0=A0=A0<< binary<101010>::value =A0=A0=A0=A0=A0=A0=A0<< std::endl; } The command =93g++ -o demo422 demo422.cpp=94 yields six link errors: $ g++ -o demo422 demo422.cpp ld: 0711-317 ERROR: Undefined symbol: .std::basic_string, std::allocator >::size() const ld: 0711-317 ERROR: Undefined symbol: .std::basic_string, std::allocator >::operator[](unsigned long) const ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*) ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream >::operator<<(unsigned long) ld: 0711-317 ERROR: Undefined symbol: std::basic_ostream >& std::endl >(std::basic_ostream >&) ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&)) ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status Adding =96Wl,-bnoquiet doesn=92t really give anything that seems particular= ly helpful (well, to me, anyway) but using the =96v flag suggests that the correct libstdc++.a is being found and also shows the (rather minimal) way I configured gcc 4.2.2 when I built it. $ g++ -v -o demo422 demo422.cpp Using built-in specs. Target: powerpc-ibm-aix5.2.0.0 Configured with: /home.local/jsaxton/gcc-4.2.2/configure --prefix=3D/opt/freeware : (reconfigured) /home.local/jsaxton/gcc-4.2.2/configure --prefix=3D/opt/freeware --enable-languages=3Dc,c++ Thread model: aix gcc version 4.2.2 =A0/opt/freeware/libexec/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/cc1plus -quiet -v -D_ALL_SOURCE demo422.cpp -quiet -dumpbase demo422.cpp -auxbase demo422 -version -o /tmp//ccPpunCt.s ignoring nonexistent directory "/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/../../../../powerpc-ibm- aix5.2.0.0/include" #include "..." search starts here: #include <...> search starts here: =A0/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/../../../../include/c= ++/ 4.2.2 =A0/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/../../../../include/c= ++/ 4.2.2/powerpc-ibm-aix5.2.0.0 =A0/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/../../../../include/c= ++/ 4.2.2/backward =A0/usr/local/include =A0/opt/freeware/include =A0/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/include =A0/usr/include End of search list. GNU C++ version 4.2.2 (powerpc-ibm-aix5.2.0.0) =A0=A0=A0=A0=A0=A0=A0 compiled by GNU C version 4.2.2. GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D327= 68 Compiler executable checksum: 757566dd4c47f91799c975df3ba00055 =A0as -u -mppc -o /tmp//ccRMMUUA.o /tmp//ccPpunCt.s =A0/opt/freeware/libexec/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect -o demo422 /lib/crt0.o -L/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2 -L/opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/../../.. /tmp//ccRMMUUA.o -lstdc++ -lm -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/libgcc.a -lc -lgcc_s /opt/freeware/lib/gcc/powerpc-ibm-aix5.2.0.0/4.2.2/libgcc.a (At this point the error messages shown earlier are displayed so I didn=92t bother to include them again.) If my double-dot counting is correct, the library path devolves to /opt/freeware/lib and there are four libstc++.a files thereunder, all freshly created by the install.=A0 I cannot see any trace of any library le= ft over from 4.0.0. 2008-01-25 16:15:01 nextferry:/opt/freeware/lib $ find . -name libstdc++.a ./pthread/ppc64/libstdc++.a ./pthread/libstdc++.a ./ppc64/libstdc++.a ./libstdc++.a I=92m a bit stuck. If I really need to rebuild gcc with different configuration options then with a bit of work I can do that.=A0 Meanwhile =93which ld=94=A0 yields /us= r/lbin/ld which is a symlink to the native AIX linker (/usr/ccs/buin/ld).=A0 There is= no gcc version of ld anywhere.=A0 It is my understanding that this is correct = for AIX 5.x. Advice eagerly sought.=A0 I can generate the =96bnoquiet output if needed b= ut this is already a very long message.