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++. > > Symbol > > > > > ---------------------------------------------------------------------------------------------- > > __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? > > Andrew. > 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. ============================================================= #nm -A /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a |grep __gxx_personality /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 T 268473324 1320 /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 t 268473324 1320 /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a[libstdc++.so.6]: _GLOBAL__F___gxx_personality_v0_FE132A57 D 537008628 /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a[libstdc++.so.6]: __gxx_personality_v0 D 537013384 /sys/usr/local/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.1/libstdc++.a[libstdc++.so.6]: __gxx_personality_v0 d 537013384 12 ============================================================= #nm -A /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a |grep __gxx_personality /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 T 268470640 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 T 268472188 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 t 268470640 1328 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: .__gxx_personality_v0 t 268472188 40 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: _GLOBAL__F___gxx_personality_v0 D 537015044 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: __gxx_personality_v0 D 537020572 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: __gxx_personality_v0 d 537020572 12 /opt/freeware/lib//gcc/powerpc-ibm-aix5.3.0.0/4.0.0//libstdc++.a[libstdc++.so.6]: __gxx_personality_v0 d 537031444 4