Re: Is it possible to build a cross compiler for AIX 6.1 on Ubuntu?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin and Jeff, thanks for the feedback - it was good to be able to press
on knowing that it should be possible.  I've managed to get to the stage of
being able to build a simple executable by invoking gcc and ld seperately.
e.g. with PREFIX=/cross-compiler and SYSROOT=/cross-compiler/sysroot:

$PREFIX/bin/*gcc -c hello.c
$PREFIX/bin/*ld -o hello $SYSROOT/lib/crt0.o -lc hello.o

Or:

$/PREFIX/bin/*gcc -nodefaultlibs -nostartfiles  $SYSROOT/lib/crt0.o -lc
hello.c

This is probably sufficient for my needs but there are some oddities (well,
they seem odd to me at least) which I've detailed below in case they're of
interest to anyone.

Thanks,
Jon

The oddities:

1. ld and gas have to be built explicitly
2. gcc is uanable to link with the built target libgcc


I'm using a combined tree with:

gcc-6.2.0
binutils-2.27
cloog-0.18.1
gmp-6.1.0
isl-0.16.1
mpc-1.0.3
mpfr-3.1.4

To build binutls:

../combined/configure --prefix=/cross-compiler
--with-sysroot=/cross-compiler/sysroot \
                      --target=powerpc-ibm-aix6.1 --host=x86_64-linux-gnu -v

make all-binutils && make install-binutils

doesn't build gas or ld so I have to additionally issue:

make all-gas && make install-gas
make all-ld && make install-ld

Using a combibed tree "as" and "ld" aren't built when running:

make all-binutils && make install-binutils

So I end having to run:

make all-gas && make install-gas
make all-ld && make install-ld

It seems strange that I have to do this and makes me think that I may have
somehow messed something up when putting together the combined tree or when
configuring the build.

To build gcc:

../combined/configure --prefix=/cross-compiler
--with-sysroot=/cross-compiler/sysroot \
                      --target=powerpc-ibm-aix6.1 --host=x86_64-linux-gnu \
                      --enable-languages=c,c++ -v

make all-gcc && make install-gcc

To build libgcc:

../combined/configure --prefix=/cross-compiler
--with-sysroot=/cross-compiler/sysroot \
                      --target=powerpc-ibm-aix6.1 --host=x86_64-linux-gnu \
                      --disable-multilib --disable-shared -v

make all-target-libgcc && make install-target-libgcc

This appears to work, however trying to link against it yields:

root@oc5328343620:/tmp# $PREFIX/bin/*gcc hello.c
collect2: fatal error:
/cross-compiler/lib/gcc/powerpc-ibm-aix6.1/6.2.0/libgcc.a: cannot open as
COFF file
compilation terminated.




--
View this message in context: http://gcc.1065356.n8.nabble.com/Is-it-possible-to-build-a-cross-compiler-for-AIX-6-1-on-Ubuntu-tp1314232p1317685.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux