summaryrefslogtreecommitdiffstats
path: root/build-toolchain
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-07 23:42:06 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-07 23:42:06 +0100
commitaf0392fbb5107ac7c092af56b0e46fe029dee799 (patch)
treea4c2a7e6d0c19ec01e229055b6849b3bf3d5bab7 /build-toolchain
parent7fd13a02daf9044d155959bc29693ce2b07d6530 (diff)
downloadvendor_replicant-af0392fbb5107ac7c092af56b0e46fe029dee799.zip
vendor_replicant-af0392fbb5107ac7c092af56b0e46fe029dee799.tar.gz
vendor_replicant-af0392fbb5107ac7c092af56b0e46fe029dee799.tar.bz2
build fixes for Debian Stretch
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'build-toolchain')
-rwxr-xr-xbuild-toolchain24
1 files changed, 17 insertions, 7 deletions
diff --git a/build-toolchain b/build-toolchain
index 7918a1a..42db6b3 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