public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* AIX architecture problems continued
@ 2004-08-31  2:54 David Kramer
  0 siblings, 0 replies; only message in thread
From: David Kramer @ 2004-08-31  2:54 UTC (permalink / raw)
  To: gcc-help

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

However, I'm not so sure it's the linker.  What do you think?
-- 
DDDD   
DK KD  I am a nobody
DKK D  Nobody is perfect
DK KD  Therefore, I am perfect.
DDDD   

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-30 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-31  2:54 AIX architecture problems continued David Kramer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).