Skip to content

Commit

Permalink
[wip] Update to GCC 14.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartatz committed May 17, 2024
1 parent dd33219 commit 497cc35
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -218,16 +218,16 @@ sed -i 's/#include <stdint.h>/#include <stdint.h>\n#include <stdio.h>/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'
)
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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" \
Expand Down

0 comments on commit 497cc35

Please sign in to comment.