diff --git a/build.sh b/build.sh index 842c8fd..a7f0def 100644 --- a/build.sh +++ b/build.sh @@ -218,6 +218,7 @@ sed -i 's/#include /#include \n#include /g' "${tool [ -d "${binutils_directory}/build" ] || mkdir "${binutils_directory}/build" declare -r targets=( + 'amd64' 'armv7' 'riscv64' 'arm64' @@ -225,10 +226,9 @@ declare -r targets=( 'macppc' 'sparc64' 'octeon' - 'loongson' + 'loongson' 'hppa' 'alpha' - 'amd64' 'i386' ) @@ -274,9 +274,9 @@ for target in "${targets[@]}"; do fi if (( require_lld )); then - extra_binutils_flags+=' --disable-ld --disable-gold --disable-lto' + extra_binutils_flags+='--disable-ld --disable-gold --disable-lto ' else - extra_binutils_flags+=' --enable-ld --enable-gold --enable-lto' + extra_binutils_flags+='--enable-ld --enable-gold --enable-lto ' fi ../configure \ @@ -338,8 +338,8 @@ for target in "${targets[@]}"; do extra_configure_flags+='--disable-lto ' fi - if [ "${target}" = 'armv7' ]; then - extra_configure_flags+=' --disable-libatomic' + if [ "${target}" = 'armv7' ] || [ "${target}" = 'amd64' ]; then + extra_configure_flags+='--disable-libatomic ' fi ../configure \ @@ -404,7 +404,10 @@ for target in "${targets[@]}"; do rm --recursive "${toolchain_directory}/share" rm --recursive "${toolchain_directory}/lib/gcc/${triplet}/"*"/include-fixed" - patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/cc1" + if (( supports_lto )); then + patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/cc1" + fi + patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/cc1plus" patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/lto1" exit 1