diff --git a/ports/gcc/build.sh b/ports/gcc/build.sh new file mode 100755 index 00000000..c508e3e2 --- /dev/null +++ b/ports/gcc/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash ../install.sh + +NAME='gcc' +VERSION='12.2.0' +DOWNLOAD_URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.gz#ac6b317eb4d25444d87cf29c0d141dedc1323a1833ec9995211b13e1a851261c" +DEPENDENCIES=('binutils' 'gmp' 'mpfr' 'mpc') +CONFIGURE_OPTIONS=( + "--target=$BANAN_TOOLCHAIN_TRIPLE" + '--with-sysroot=/' + "--with-build-sysroot=$BANAN_SYSROOT" + '--enable-initfini-array' + '--enable-shared' + '--enable-lto' + '--disable-nls' + '--enable-languages=c,c++' +) + +build() { + make -j$(nproc) all-gcc || exit 1 + make -j$(nproc) all-target-libgcc || exit 1 + make -j$(nproc) all-target-libstdc++-v3 || exit 1 + find . -type f -executable -exec strip --strip-unneeded {} + 2>/dev/null +} + +install() { + make install-gcc DESTDIR="$BANAN_SYSROOT" || exit 1 + make install-target-libgcc DESTDIR="$BANAN_SYSROOT" || exit 1 + make install-target-libstdc++-v3 DESTDIR="$BANAN_SYSROOT" || exit 1 +} diff --git a/ports/gcc/patches/0001-force-little-endian.patch b/ports/gcc/patches/0001-force-little-endian.patch new file mode 100644 index 00000000..d57193e7 --- /dev/null +++ b/ports/gcc/patches/0001-force-little-endian.patch @@ -0,0 +1,11 @@ +diff -ruN gcc-12.2.0/gcc/configure gcc-12.2.0-banan_os/gcc/configure +--- gcc-12.2.0/gcc/configure 2022-08-19 11:09:52.736664469 +0300 ++++ gcc-12.2.0-banan_os/gcc/configure 2024-08-08 09:30:58.730876253 +0300 +@@ -9426,6 +9426,7 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 + $as_echo_n "checking whether byte ordering is bigendian... " >&6; } ++ac_cv_c_bigendian=no + if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 + else diff --git a/ports/gcc/patches/gcc-12.2.0.patch b/ports/gcc/patches/gcc-12.2.0.patch new file mode 120000 index 00000000..bf982d19 --- /dev/null +++ b/ports/gcc/patches/gcc-12.2.0.patch @@ -0,0 +1 @@ +../../../toolchain/gcc-12.2.0.patch \ No newline at end of file