This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AIX architecture problems: more info


Background: AIX 5.2 box.  My mission is to port my company's application
from AIX's native xlC compiler to the GNU toolchain.  I bootstraped gcc
3.4.0 from a gcc 3.3.3 (build for AIX5.1) I downloaded.  I built gcc with
an architecture of "powerpc-ibm-aix5.2.0.0" using the -mcpu=rs64a flag.  
This is on a PowerPC_RS64-II according to lsattr.

I have a binutils2.14 built by someone else into /opt/local/bin.  I can tell you this about it:
/opt/local/bin/ld: supported targets: aixcoff-rs6000 aix5coff64-rs6000 
srec symbolsrec tekhex binary ihex
/opt/local/bin/ld: supported emulations: aix5ppc
/opt/local/bin/ld: emulation specific options:
  no emulation specific options.
/opt/local/bin/ld -v
GNU ld version 2.14 20030612

I have a binutils 2.15 that I just built myself using the gcc 3.4.0 compiler I
built as outlined above, into /opt/binutils2.15/bin.

I also have ld, etc, from the native xlC toolchain in /usr/bin.

I wrote a little test program that just does some << and >> and stringstream
conversions.  Source available if you think it's important.

When I try using the new compiler with the stock ld:
--------------------------------
~/build/test> export PATH=$GCC340PATH:$ORIGPATH
~/build/test> which gcc
/opt/gcc3.4.0/bin/gcc
~/build/test> which ld
/usr/bin/ld
~/build/test> g++ -o piddle piddle.cpp && ./piddle
Before defining stringstream here
After defining stringstream
the process id is 94776.
the number is: 56
--------------------------------
the program works fine, no errors.

When I try using the new compiler with the old gnu binutils:
--------------------------------
~/build/test> export PATH=$GCC340PATH:/usr/local/bin:$ORIGPATH
~/build/test> g++ -o piddle piddle.cpp && ./piddle
Before defining stringstream here
After defining stringstream
the process id is 28258.
the number is: 56
--------------------------------
the program works fine, no errors.

When I try using the new compiler with the new gnu binutils:
--------------------------------
~/build/test> export PATH=$GCC340PATH:$BINUTILSPATH:$ORIGPATH
~/build/test> which gcc
/opt/gcc3.4.0/bin/gcc
~/build/test> which ld
/opt/binutils2.15/bin/ld
~/build/test> g++ -o piddle piddle.cpp && ./piddle
Before defining stringstream here
Segmentation fault (core dumped)
--------------------------------
The program dies on this line:
stringstream sstr("safas");

I've tried with with various constructors, too, with the same results.  Since
I'm using the same exact source code and the same compiler, and only the
linking process has changed in my test, it seems to me that the problem has to
be the linker, no?

BTW, the reason I am trying to build a new binutils, is because when I link my
application, and some more complex test code, I get errors like:

/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_divdi3.o)' is
incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_moddi3.o)' is
incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivdi3.o)' is
incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_umoddi3.o)' is
incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc.a(_udivmoddi4.o)'
is incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2.o)'
is incompatible with rs6000:6000 output
/opt/local/bin/ld: warning: powerpc:601 architecture of input file
`/opt/gcc3.4.0/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.0/libgcc_eh.a(unwind-dw2-fde.o)'
is incompatible with rs6000:6000 output





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]