From e86e5f2e038ca59df0acef0901c434a7a1f32c20 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 14 Sep 2021 22:49:36 -0700 Subject: [PATCH] more work on n64-toolkit --- n64-toolkit/PKGBUILD.binutils | 6 ++++-- n64-toolkit/PKGBUILD.bootstrap | 20 +++++++++----------- n64-toolkit/PKGBUILD.gcc | 20 +++++++++++++------- n64-toolkit/PKGBUILD.newlib | 6 ++---- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/n64-toolkit/PKGBUILD.binutils b/n64-toolkit/PKGBUILD.binutils index a4bf698..03f9392 100644 --- a/n64-toolkit/PKGBUILD.binutils +++ b/n64-toolkit/PKGBUILD.binutils @@ -5,7 +5,7 @@ _sysroot="$_prefix/sysroot" pkgname="$_triplet-binutils" pkgver=2.37 -pkgrel=1 +pkgrel=2 _binutils="binutils-$pkgver" pkgdesc="A set of programs to assemble and manipulate binary and object files ($_triplet)" arch=('any') @@ -74,5 +74,7 @@ package() { make DESTDIR="$pkgdir" install -j1 # strip host binaries - find "$PREFIX/bin" -type f -and \( -executable \) -exec strip '{}' \; + find "$PREFIX" -type f -and \( -executable \) -exec strip '{}' \; + + rm -r "$PREFIX/share" } diff --git a/n64-toolkit/PKGBUILD.bootstrap b/n64-toolkit/PKGBUILD.bootstrap index 4eed4a7..4f5c747 100644 --- a/n64-toolkit/PKGBUILD.bootstrap +++ b/n64-toolkit/PKGBUILD.bootstrap @@ -5,7 +5,7 @@ _sysroot="$_prefix/sysroot" pkgname="$_triplet-bootstrap" pkgver=11.2.0 -pkgrel=1 +pkgrel=2 _gcc="gcc-$pkgver" _mpfr=mpfr-4.1.0 _gmp=gmp-6.2.1 @@ -52,8 +52,8 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" - export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" + export CFLAGS_FOR_TARGET="-Os -G0 -fcommon -ffunction-sections -fdata-sections" + export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET" cd "$srcdir" [ -d "build-bootstrap-gcc" ] || mkdir "build-bootstrap-gcc" @@ -92,12 +92,14 @@ build() { --disable-threads \ --disable-tls \ --disable-werror \ + --disable-win32-registry \ --enable-languages=c,c++,lto \ --enable-lto \ --enable-static \ --enable-target-optspace \ --with-abi=32 \ --with-arch=vr4300 \ + --with-gcc \ --with-gnu-as \ --with-gnu-ld \ --with-newlib \ @@ -114,14 +116,10 @@ package() { cd "$srcdir/build-bootstrap-gcc" make DESTDIR="$pkgdir" install-gcc -j1 - # strip target binaries - find "$PREFIX/lib" \( -name "*.a" -or -name "*.o" \) -exec $_target-objcopy \ - -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc \ - '{}' \; - # strip host binaries - find "$PREFIX/bin" "$PREFIX/lib/gcc/$_target/${_gcc/gcc-/}" \ - -type f -and \( -executable \) -exec strip '{}' \; + # "$PREFIX/bin" + # "$PREFIX/lib/gcc/$_target/$pkgver" + find "$PREFIX" -type f -and \( -executable \) -exec strip '{}' \; - rm -r "$PREFIX/share/info" + rm -r "$PREFIX/share" } diff --git a/n64-toolkit/PKGBUILD.gcc b/n64-toolkit/PKGBUILD.gcc index f203c36..36defef 100644 --- a/n64-toolkit/PKGBUILD.gcc +++ b/n64-toolkit/PKGBUILD.gcc @@ -5,7 +5,7 @@ _sysroot="$_prefix/sysroot" pkgname="$_triplet-gcc" pkgver=11.2.0 -pkgrel=1 +pkgrel=2 _gcc="gcc-$pkgver" _mpfr=mpfr-4.1.0 _gmp=gmp-6.2.1 @@ -55,8 +55,8 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" - export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" + export CFLAGS_FOR_TARGET="-Os -G0 -fcommon -ffunction-sections -fdata-sections" + export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET" cd "$srcdir" [ -d "build-gcc" ] || mkdir "build-gcc" @@ -95,12 +95,14 @@ build() { --disable-threads \ --disable-tls \ --disable-werror \ + --disable-win32-registry \ --enable-languages=c,c++,lto \ --enable-lto \ --enable-static \ --enable-target-optspace \ --with-abi=32 \ --with-arch=vr4300 \ + --with-gcc \ --with-gnu-as \ --with-gnu-ld \ --with-newlib \ @@ -118,13 +120,17 @@ package() { make DESTDIR="$pkgdir" install -j1 # strip target binaries - find "$PREFIX/$_target/lib" \( -name "*.a" -or -name "*.o" \) -exec $_target-objcopy \ + find \ + "$PREFIX/lib/gcc/$_target/$pkgver" \ + "$PREFIX/$_target/lib" \ + \( -name "*.a" -or -name "*.o" \) -exec $_target-objcopy \ -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc \ '{}' \; # strip host binaries - find "$PREFIX/bin" "$PREFIX/lib/gcc/$_target/${_gcc/gcc-/}" \ - -type f -and \( -executable \) -exec strip '{}' \; + # "$PREFIX/bin" + # "$PREFIX/lib/gcc/$_target/$pkgver" + find "$PREFIX" -type f -and \( -executable \) -exec strip '{}' \; - rm -r "$PREFIX/share/info" + rm -r "$PREFIX/share" } diff --git a/n64-toolkit/PKGBUILD.newlib b/n64-toolkit/PKGBUILD.newlib index c131159..c1fc710 100644 --- a/n64-toolkit/PKGBUILD.newlib +++ b/n64-toolkit/PKGBUILD.newlib @@ -5,7 +5,7 @@ _sysroot="$_prefix/sysroot" pkgname="$_triplet-newlib" pkgver=4.1.0 -pkgrel=1 +pkgrel=2 _newlib="newlib-$pkgver" pkgdesc="A C library intended for use on embedded systems ($_triplet)" arch=('any') @@ -26,8 +26,7 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" - export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" + export CFLAGS_FOR_TARGET="-Os -G0 -fcommon -ffunction-sections -fdata-sections" cd "$srcdir" [ -d "build-newlib" ] || mkdir "build-newlib" @@ -58,7 +57,6 @@ build() { --enable-target-optspace \ --with-newlib \ - #--enable-newlib-nano-formatted-io make }