From 63ad33248660ec09b64284f7058f871bd3bf47c2 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 28 Apr 2019 03:21:09 +0200 Subject: [PATCH] Attempt to build GCC with multilib support --- doc/cross-gcc.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/doc/cross-gcc.sh b/doc/cross-gcc.sh index af0ad8e..5a82c10 100644 --- a/doc/cross-gcc.sh +++ b/doc/cross-gcc.sh @@ -26,7 +26,9 @@ #variables +BINUTILS_FLAGS= BINUTILS_VERSION="2.32" +GCC_FLAGS= GCC_VERSION="8.3.0" GZEXT="gz" MIRROR="https://ftpmirror.gnu.org" @@ -51,10 +53,15 @@ PATH="$PREFIX/bin:$PATH" #Extract, configure, and build binutils in a dedicated tree $TAR xzvf "binutils-$BINUTILS_VERSION.tar.$GZEXT" -$MKDIR binutils-build +case "$TARGET" in + aarch64-elf|amd64-elf|sparc64-elf) + BINUTILS_FLAGS="$BINUTILS_FLAGS --enable-multilib" + ;; +esac +$MKDIR "binutils-build" (cd binutils-build && "../binutils-$BINUTILS_VERSION/configure" \ --target="$TARGET" --prefix="$PREFIX" --with-sysroot --disable-nls \ - --disable-werror) + --disable-werror $BINUTILS_FLAGS) (cd binutils-build && $MAKE) (cd binutils-build && $MAKE install) @@ -64,10 +71,18 @@ $MKDIR binutils-build #Extract, configure, and build GCC in a dedicated tree $TAR xzvf "gcc-$GCC_VERSION.tar.$GZEXT" -$MKDIR gcc-build +case "$TARGET" in + aarch64-elf|sparc64-elf) + GCC_FLAGS="$GCC_FLAGS --with-multilib-list=m32,m64 --enable-targets=all" + ;; + amd64-elf) + GCC_FLAGS="$GCC_FLAGS --with-abi=m64 --with-multilib-list=m32,m64 --enable-targets=all" + ;; +esac +$MKDIR "gcc-build" (cd gcc-build && "../gcc-$GCC_VERSION/configure" --target="$TARGET" \ --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ \ - --without-headers) + --without-headers $GCC_FLAGS) (cd gcc-build && $MAKE all-gcc) (cd gcc-build && $MAKE all-target-libgcc) (cd gcc-build && $MAKE install-gcc)