2500th COMMIT: ports: Add gcc port

I've had this laying around locally for a while. binutils was not
working so I didn't feel like this was worth pushing. My new stdio FILE
buffering rewrite fixed binutils and now gcc actually works!
This commit is contained in:
Bananymous 2025-01-25 18:37:10 +02:00
parent a84fb57e32
commit 8c569ac7bf
3 changed files with 41 additions and 0 deletions

29
ports/gcc/build.sh Executable file
View File

@ -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
}

View File

@ -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

View File

@ -0,0 +1 @@
../../../toolchain/gcc-12.2.0.patch