ericbambach1@xxxxxxxxxxxx writes: > Thanks for responding. > > Andrew Haley <aph-gcc@xxxxxxxxxxxxxxxxxxx> wrote on 09/11/2007 04:53:09 > AM: > > > ericbambach1@xxxxxxxxxxxx writes: > > > Hello, > > > > > > Please CC as I'm not subscribed. Hope line breaks are ok, I > hate > > > Lotus Notes :) > > > > > > I'm having a lot of trouble getting gcc 4.2.1 compiled and > run on > > > AIX 5.3 on the power5 architecture. Even after GCC compiles > successfully > > > it seems libstdc++.a isn't built correctly. > > > > > > We have the IBM binary gcc-4.0.0 compiler installed in > > > /opt/freeware/bin so I know its possible to get GCC on here somehow. > > > > > > It builds fine but compilation of this simple test program > fails > > > with g++. gcc SEEMS to function ok but I havent checked it in depth > yet. > > > Take a look at the session below (edited for readability + mask > > > user+hostname only) where it first fails to find libgcc_s even though > the > > > configure script placed it in /sys/usr/lib just like I asked, Next it > cant > > > link against libstdc++.a. Once I turn on the verbose output I see > that > > > libstdc++.a has no symbols being imported! I dont know much about > > > compilers but it seems that I need SOME symbols from libstdc++ are > needed. > > > Last, if I force it to link against IBM's libstdc++.a it works fine. > > > > > > Am I building gcc wrong? I did build it with GNU make and the > AIX > > > as+ld. I borrowed IBM's config flags from 4.0.0. Any additional info > > > needed? > > > > This is a clue: > > > > Configured with: ../gcc-4.2.1/configure --with-as=/usr/bin/as > > --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ > > --prefix=/sys/usr/local --bindir=/sys/usr --enable-threads > > --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0 : > > (reconfigured) ../gcc-4.2.1/configure --with-as=/usr/bin/as > > --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ > > --prefix=/sys/usr/local --with-slibdir=/sys/usr/lib --enable-threads > > --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0 > > > > So, you configured and built gcc without specifying the dir for the > > shared libgcclibrary, and you then reconfigured with one. Why did you > > do this? > > At first I was just testing the build. Then I reconfigured to put the > libraries int the location we need them for the server. I figure that may > be why it can't find libgcc_s initially, but I'm not too worried about > that. I'm more worried that it can't find symbols in libstdc++. Well no, you didn't. You put libgcc in one place and the rest of the libraries in another. This is a Bad Thing. You should only use --with-slibdir in very special circumstances -- otherwise you should just put everything in the prefix. > > > __gxx_personality_v0 [6] ER PR hello.c(/tmp//cc05Pxwk.o) > > > 00000111 .data R_POS [24] > > > _GLOBAL__F_main_8A711DF0 > > > ER: The return code is 8. > > > ld: 0711-317 ERROR: Undefined symbol: __gxx_personality_v0 > > > collect2: ld returned 8 exit status > > > > OK, so __gxx_personality_v0 is missing. It should be in > > /sys/usr/local/lib/libstdc++. Is it? > Yea. I know nothing about nm, but as far as I can see its defined in the > library. The output differs slightly when I compare the IBM build and my > build but I dont know enough about these numbers to know if it makes a > difference. I don't know either. I don't think I can help any more -- you need an AIX linker expert. Andrew.