Android Toolchain Notes

These notes are wirtten from a toolchain developers perspective and cover building the Android skew of GCC and testing it.

See also:

Versions

As at 2011-07-20, the Android build scripts use:

  • binutils: 2.20.1
  • gold binutils: 2.20.1
  • gmp: 4.2.4 (4.6 needs 4.3.2+)
  • mpfr: 2.4.1 (4.6 needs 2.4.2+)
  • mpc: 0.8.1 (ok)
  • ppl: 0.11.2 (ok)
  • cloog: 0.15.9 (ok ,'has trouble detecting ppl 0.11')

michaelh configured the build with:

  • gcc: gcc-linaro-4.6-2011.06-0
  • gdb: gdb-linaro-7.2-2011.05-0

See the attached build log which shows all of the configure and build steps that were done.

Configuration

The build script configures as follows:

gcc:

export AS_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/gas/as-new \
LD_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/`[ -d /home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/gold ] && echo "gold" || echo "ld"`/ld-new AR_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/binutils/ar \
NM_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/binutils/nm-new \
STRIP_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/binutils/strip-new \
RANLIB_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/binutils/ranlib \
OBJDUMP_FOR_TARGET=/home/michaelh/linaro/distros/android-toolchain/build/binutils-2.20.1/binutils/objdump ; \
export CFLAGS_FOR_TARGET="-O2 -Os -g -DTARGET_POSIX_IO -fno-short-enums" ; \
export CXXFLAGS_FOR_TARGET="-O2 -Os -g -DTARGET_POSIX_IO -fno-short-enums" ; \
export LDFLAGS_FOR_TARGET="" ; \

--prefix=/tmp/android-toolchain-eabi --target=arm-eabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-mpfr=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-mpc=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-cloog=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-ppl=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-ppl-version-check --disable-cloog-version-check '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'  --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --with-abi=aapcs '--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,'

Distilled:

  • --target=arm-eabi
  • --enable-languages=c,c++
  • --with-float=soft
  • --with-fpu=vfp
  • --with-arch=armv5te
  • --enable-target-optspace
  • --with-abi=aapcs

As one line:

  • --target=arm-eabi --enable-languages=c,c++ --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --with-abi=aapcs

Others:

  • --host=x86_64-linux-gnu
  • --build=x86_64-linux-gnu
  • --with-gnu-as
  • --with-gnu-ld
  • --disable-ppl-version-check
  • --disable-cloog-version-check
  • '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
  • --disable-libssp
  • --enable-threads
  • --disable-nls
  • --disable-libmudflap
  • --disable-libgomp
  • --disable-libstdc-v3

  • --disable-sjlj-exceptions
  • --disable-shared
  • --disable-tls
  • --prefix=/tmp/android-toolchain-eabi
  • --disable-docs
  • --disable-nls
  • --with-gcc-version=linaro-4.6-2011.06-0
  • --with-gdb-version=linaro-7.2-2011.05-0
  • --with-binutils-version=2.20.1
  • --with-gmp-version=4.2.4
  • --with-mpfr-version=2.4.1
  • --program-transform-name='s,^,arm-eabi-,'

binutils:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --disable-shared --disable-werror --with-cloog=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-gmp=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-ppl-version-check --disable-cloog-version-check '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm') && \

gmp:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-shared --host=x86_64-linux-gnu --build=x86_64-linux-gnu --enable-cxx) && \

ppl:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-shared --target=arm-eabi --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-nls --with-gmp-prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-watchdog --disable-ppl_lcdd --disable-ppl_lpsol --disable-ppl_pips) && \

cloog:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-shared --target=arm-eabi --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-nls --with-gmp=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-ppl=/home/michaelh/linaro/distros/android-toolchain/build/temp-install) && \

mpfr:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-shared --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gmp=/home/michaelh/linaro/distros/android-toolchain/build/temp-install) && \

mpc:

'--prefix=/tmp/android-toolchain-eabi' '--disable-docs' '--disable-nls' '--with-gcc-version=linaro-4.6-2011.06-0' '--with-gdb-version=linaro-7.2-2011.05-0' '--with-binutils-version=2.20.1' '--with-gmp-version=4.2.4' '--with-mpfr-version=2.4.1' --program-transform-name='s,^,arm-eabi-,' --prefix=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --disable-shared --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gmp=/home/michaelh/linaro/distros/android-toolchain/build/temp-install --with-mpfr=/home/michaelh/linaro/distros/android-toolchain/build/temp-install) && \

MichaelHope/Sandbox/AndroidToolchainNotes (last modified 2011-07-20 03:08:17)