diff --git a/build.sh b/build.sh index 0859b29..842c8fd 100644 --- a/build.sh +++ b/build.sh @@ -31,8 +31,8 @@ function setup_gcc_source() { local tgt="${1}" declare -r tgt - # || [ "${tgt}" = 'amd64' ] - if [ "${tgt}" = 'hppa' ] || [ "${tgt}" = 'alpha' ] || [ "${tgt}" = 'i386' ]; then + + if [ "${tgt}" = 'hppa' ] || [ "${tgt}" = 'alpha' ] || [ "${tgt}" = 'amd64' ] || [ "${tgt}" = 'i386' ]; then gcc_version='14' gcc_directory='/tmp/gcc-14.1.0' gcc_url='https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz' @@ -218,16 +218,16 @@ sed -i 's/#include /#include \n#include /g' "${tool [ -d "${binutils_directory}/build" ] || mkdir "${binutils_directory}/build" declare -r targets=( - # 'riscv64' - # 'armv7' - # 'arm64' - # 'powerpc64' - # 'macppc' - # 'sparc64' - # 'octeon' - # 'loongson' - # 'hppa' - # 'alpha' + 'armv7' + 'riscv64' + 'arm64' + 'powerpc64' + 'macppc' + 'sparc64' + 'octeon' + 'loongson' + 'hppa' + 'alpha' 'amd64' 'i386' ) @@ -322,15 +322,24 @@ for target in "${targets[@]}"; do rm --force --recursive ./* declare extra_configure_flags='' + declare supports_lto='0' if [ "${target}" == 'hppa' ]; then - extra_configure_flags+=' --disable-libstdcxx' + extra_configure_flags+='--disable-libstdcxx ' fi if [ "${target}" == 'hppa' ] || [ "${target}" == 'alpha' ] || [ "${target}" == 'amd64' ] || [ "${target}" == 'i386' ]; then - extra_configure_flags+=' --enable-lto' + supports_lto='1' + fi + + if (( supports_lto )); then + extra_configure_flags+='--enable-lto ' else - extra_configure_flags+=' --disable-lto' + extra_configure_flags+='--disable-lto ' + fi + + if [ "${target}" = 'armv7' ]; then + extra_configure_flags+=' --disable-libatomic' fi ../configure \ @@ -379,8 +388,6 @@ for target in "${targets[@]}"; do CXXFLAGS="${optflags}" \ LDFLAGS="-Wl,-rpath-link,${OBGGCC_TOOLCHAIN}/${CROSS_COMPILE_TRIPLET}/lib ${linkflags}" - #--disable-libatomic \ - LD_LIBRARY_PATH="${toolchain_directory}/lib" PATH="${PATH}:${toolchain_directory}/bin" make \ CFLAGS_FOR_TARGET="${optflags} ${linkflags}" \ CXXFLAGS_FOR_TARGET="${optflags} ${linkflags} -fpermissive" \