From af0392fbb5107ac7c092af56b0e46fe029dee799 Mon Sep 17 00:00:00 2001 From: Wolfgang Wiedmeyer Date: Wed, 7 Dec 2016 23:42:06 +0100 Subject: [PATCH] build fixes for Debian Stretch Signed-off-by: Wolfgang Wiedmeyer --- build-toolchain | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/build-toolchain b/build-toolchain index 7918a1ad..42db6b31 100755 --- a/build-toolchain +++ b/build-toolchain @@ -41,7 +41,8 @@ cd $BASEDIR/toolchain/gcc/arm/arm-linux-androideabi/build/binutils --enable-gold=default \ --enable-plugins -make -j $(nproc) && make install +make -j $(nproc) +make install # build gcc for arm cd .. && mkdir -p gcc && cd gcc @@ -81,7 +82,8 @@ cd .. && mkdir -p gcc && cd gcc --enable-gold=default \ --program-transform-name='s&^&arm-linux-androideabi-&' -make -j $(nproc) && make install +make -j $(nproc) +make install # build binutils for host @@ -95,15 +97,19 @@ cd host/build/binutils --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \ --with-gold-ldflags='-static-libgcc -static-libstdc++' \ --enable-gold=default \ - --enable-plugins + --enable-plugins \ + --disable-ld -make -j $(nproc) && make install +make -j $(nproc) +make install # build gcc for host cd .. && mkdir -p gcc && cd gcc ./../../../../src/gcc/gcc-4.9/configure \ --prefix=$BASEDIR/toolchain/gcc/host/install \ --target=x86_64-linux \ + --host=x86_64-linux-gnu \ + --build=x86_64-linux-gnu \ --enable-multiarch \ --with-arch-32=i686 \ --with-abi=m64 \ @@ -111,8 +117,6 @@ cd .. && mkdir -p gcc && cd gcc --with-multilib-list=m32,m64 \ --disable-nls \ --enable-target-optspace \ - --host=x86_64-linux-gnu \ - --build=x86_64-linux-gnu \ --disable-plugin \ --disable-docs \ --disable-bootstrap \ @@ -123,12 +127,18 @@ cd .. && mkdir -p gcc && cd gcc --enable-gold=default \ --enable-languages=c,c++ -make -j $(nproc) && make install +make -j $(nproc) +make install # we need to link against the correct stdatomic.h cd ../../install/lib/gcc/x86_64-linux/4.9.x/include rm stdatomic.h ln -s ../../../../../../../../../bionic/libc/include/stdatomic.h stdatomic.h +# use gold ld from /usr because Google's binutils can't handle a recent libc +cd ../../../../../x86_64-linux/bin/ +rm ld +ln -s /usr/bin/x86_64-linux-gnu-ld.gold ld + cd $BASEDIR