-
Notifications
You must be signed in to change notification settings - Fork 0
binutils gdb for AIX Home
Its a work-in-progress fork of binutils to support AIX XCOFF to enable cross-compiling AIX C/C++ on Linux.
Developing on AIX is non-trivial and requires a dedicated power machine. Cross-compiling for development purposes allows a faster write-compile-test loop as only the testing portion requires an SSH connection to a real machine.
The goal is to be able to get binaries that work more often than not for dev and test. Production use of this is not on the cards.
It creates object files that can be linked with both the AIX linker and the GNU linker. And fixes these bugs:
However... these results are often wrong:
- 32-bit hello world in C (gcc 6.1.0)
- 32-bit exception catching in C++ from assembler (gcc 6.1.0)
- Fails with relocation errors
- 32-bit exception catching in C++ from source (gcc 6.1.0)
- Fails to compile with a segfault
- 64-bit hello world in C
- Illegal instruction
- 64-bit hello world in C++
- Illegal instruction
Note: These instructions will build a toolchain in the current directory called aix6.1-toolchain. For just the binutils you don't need to fill the sysroot, for testing alongside gcc you need a sysroot from a working AIX box.
$ git clone https://github.com/JamesReynolds/binutils-gdb
$ mkdir build_binutils
$ cd build_binutils
$ ../binutils-gdb/configure --target=powerpc-ibm-aix6.1 \
--prefix=$(pwd)/../aix6.1-toolchain \
--with-sysroot=$(pwd)/../aix6.1-toolchain/sysroot
$ make
$ make install
- Fill the sysroot directory by finding files on an AIX box that has gcc 6.1.0 installed:
AIX $ cd / ; find ./ -name *.o -o -name *.h -o -name *.exp -o -name *.a -name *.so | cpio -oLV > out.cpio
Linux $ cd $(pwd)/aix6.1-toolchain/sysroot ; cpio -imdV < out.cpio
- Build gcc 6.1.0:
$ tar xf gcc-6.1.0.tar.gz
$ mkdir build_gcc
$ cd build_gcc
$ ../gcc-6.1.0/configure \
--target=powerpc-ibm-aix6.1 \
--prefix=$(pwd)/../aix6.1-toolchain \
--with-sysroot=$(pwd)/../aix6.1-toolchain/sysroot \
--with-gnu-as --with-gnu-ld \
--enable-languages=c,c++ \
--enable-version-specific-runtime-libs --disable-nls \
--enable-decimal-float=dpd --with-cloog=no --with-ppl=no \
--disable-libstdcxx-pch --enable-__cxa_atext
$ make -k
$ make install -k
Note: This will fail until this work has progressed much further... but enough will be completed for testing.
$ cd test
$ ./binutils-gdb/test.sh ../aix6.1-toolchain
Note: This will fail too - see the checkboxes at the start.