diff --git a/README.md b/README.md index 12b9a43..6cf26f9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ patches tbox to compile/run with MSYS2. builds a cross-compiler for N64 homebrew. works on both Arch and MSYS2. -installs to `/opt/mips64-elf-ultra64`, so add that to your PATH as needed. +installs to `/opt/mips-ultra64-elf`, so add that to your PATH as needed. ### xml2 diff --git a/n64-toolkit/PKGBUILD.binutils b/n64-toolkit/PKGBUILD.binutils index 101a164..a4bf698 100644 --- a/n64-toolkit/PKGBUILD.binutils +++ b/n64-toolkit/PKGBUILD.binutils @@ -1,23 +1,27 @@ -_target=mips64 -_tuple=$_target-elf-ultra64 -_prefix=/opt/$_tuple -pkgname=$_tuple-binutils -pkgver=2.31.1 +_target=mips +_triplet="$_target-ultra64-elf" +_prefix="/opt/$_triplet" +_sysroot="$_prefix/sysroot" + +pkgname="$_triplet-binutils" +pkgver=2.37 pkgrel=1 _binutils="binutils-$pkgver" -pkgdesc="A set of programs to assemble and manipulate binary and object files ($_target)" +pkgdesc="A set of programs to assemble and manipulate binary and object files ($_triplet)" arch=('any') license=('GPL') url='http://www.gnu.org/software/binutils/' depends=('zlib') source=("ftp://gcc.gnu.org/pub/binutils/releases/$_binutils.tar.bz2") -md5sums=('84edf97113788f106d6ee027f10b046a') +sha256sums=('67fc1a4030d08ee877a4867d3dcab35828148f87e1fd05da6db585ed5a166bd4') options=('!emptydirs' '!strip') prepare() { cd "$srcdir/$_binutils" # Hack - see native package for details sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure + # annoying oversight: + sed -i 's/\/unsigned int/g' libiberty/rust-demangle.c } build() { @@ -28,8 +32,7 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-O2 -G0 \ --fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" + export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" cd "$srcdir" @@ -41,13 +44,25 @@ build() { _build="--build=$MINGW_CHOST --host=$MINGW_CHOST" fi - "../$_binutils/configure" $_build --target=$_target --prefix="$_prefix" \ - --enable-static \ + "../$_binutils/configure" $_build \ + --target=$_target \ + --prefix="$_prefix" \ + \ --disable-gold \ + --disable-libquadmath \ + --disable-libquadmath-support \ --disable-multilib \ --disable-nls \ --disable-shared \ --disable-werror \ + --enable-deterministic-archives \ + --enable-lto \ + --enable-static \ + --with-gcc \ + --with-gnu-as \ + --with-gnu-ld \ + --with-sysroot="$_sysroot" \ + --without-included-gettext \ make all } diff --git a/n64-toolkit/PKGBUILD.bootstrap b/n64-toolkit/PKGBUILD.bootstrap index 644fdd2..4eed4a7 100644 --- a/n64-toolkit/PKGBUILD.bootstrap +++ b/n64-toolkit/PKGBUILD.bootstrap @@ -1,30 +1,32 @@ -_target=mips64 -_tuple=$_target-elf-ultra64 -_prefix=/opt/$_tuple -pkgname=$_tuple-bootstrap -pkgver=8.2.0 +_target=mips +_triplet="$_target-ultra64-elf" +_prefix="/opt/$_triplet" +_sysroot="$_prefix/sysroot" + +pkgname="$_triplet-bootstrap" +pkgver=11.2.0 pkgrel=1 -_gcc=gcc-$pkgver -_mpfr=mpfr-4.0.1 -_gmp=gmp-6.1.2 -_mpc=mpc-1.1.0 +_gcc="gcc-$pkgver" +_mpfr=mpfr-4.1.0 +_gmp=gmp-6.2.1 +_mpc=mpc-1.2.1 _isl=isl-0.18 -pkgdesc="The GNU Compiler Collection. Stage 1 for toolchain building ($_target)" +pkgdesc="The GNU Compiler Collection. Stage 1 for toolchain building ($_triplet)" arch=('any') license=('GPL' 'LGPL' 'FDL') url='http://www.gnu.org/software/gcc/' -depends=('zlib' "$_tuple-binutils") +depends=('zlib' "$_triplet-binutils") makedepends=('gmp' 'mpfr') source=("ftp://gcc.gnu.org/pub/gcc/releases/$_gcc/$_gcc.tar.gz" "ftp://ftp.gnu.org/gnu/mpfr/$_mpfr.tar.bz2" "ftp://ftp.gnu.org/gnu/gmp/$_gmp.tar.bz2" "ftp://ftp.gnu.org/gnu/mpc/$_mpc.tar.gz" "ftp://gcc.gnu.org/pub/gcc/infrastructure/$_isl.tar.bz2") -md5sums=('ee04f0c22a941f5f17d93809387f2729' - '8c21d8ac7460493b2b9f3ef3cc610454' - '8ddbb26dc3bd4e2302984debba1406a5' - '4125404e41e482ec68282a2e687f6c73' - '11436d6b205e516635b666090b94ab32') +sha256sums=('f0837f1bf8244a5cc23bd96ff6366712a791cfae01df8e25b137698aca26efc1' + 'feced2d430dd5a97805fa289fed3fc8ff2b094c02d05287fd6133e7f1f0ec926' + 'eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c' + '17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459' + '6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b') options=('!emptydirs' '!strip') prepare() { @@ -50,8 +52,7 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-O2 -G0 \ --fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" + export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" cd "$srcdir" @@ -63,7 +64,11 @@ build() { _build="--build=$MINGW_CHOST --host=$MINGW_CHOST" fi - "../$_gcc/configure" $_build --target=$_target --prefix="$_prefix" \ + "../$_gcc/configure" $_build \ + --target=$_target \ + --prefix="$_prefix" \ + --with-sysroot="$_sysroot" \ + \ --disable-__cxa_atexit \ --disable-decimal-float \ --disable-gold \ @@ -88,10 +93,13 @@ build() { --disable-tls \ --disable-werror \ --enable-languages=c,c++,lto \ + --enable-lto \ --enable-static \ --enable-target-optspace \ --with-abi=32 \ --with-arch=vr4300 \ + --with-gnu-as \ + --with-gnu-ld \ --with-newlib \ --with-tune=vr4300 \ --without-headers \ diff --git a/n64-toolkit/PKGBUILD.gcc b/n64-toolkit/PKGBUILD.gcc index a4e2923..f203c36 100644 --- a/n64-toolkit/PKGBUILD.gcc +++ b/n64-toolkit/PKGBUILD.gcc @@ -1,33 +1,35 @@ -_target=mips64 -_tuple=$_target-elf-ultra64 -_prefix=/opt/$_tuple -pkgname=$_tuple-gcc -pkgver=8.2.0 +_target=mips +_triplet="$_target-ultra64-elf" +_prefix="/opt/$_triplet" +_sysroot="$_prefix/sysroot" + +pkgname="$_triplet-gcc" +pkgver=11.2.0 pkgrel=1 -_gcc=gcc-$pkgver -_mpfr=mpfr-4.0.1 -_gmp=gmp-6.1.2 -_mpc=mpc-1.1.0 +_gcc="gcc-$pkgver" +_mpfr=mpfr-4.1.0 +_gmp=gmp-6.2.1 +_mpc=mpc-1.2.1 _isl=isl-0.18 -pkgdesc="The GNU Compiler Collection ($_target)" +pkgdesc="The GNU Compiler Collection ($_triplet)" arch=('any') license=('GPL' 'LGPL' 'FDL') url='http://www.gnu.org/software/gcc/' -depends=('zlib' "$_tuple-binutils" "$_tuple-newlib") +depends=('zlib' "$_triplet-binutils" "$_triplet-newlib") makedepends=('gmp' 'mpfr') -conflicts=("$_tuple-bootstrap") -provides=("$_tuple-bootstrap") -replaces=("$_tuple-bootstrap") +conflicts=("$_triplet-bootstrap") +provides=("$_triplet-bootstrap") +replaces=("$_triplet-bootstrap") source=("ftp://gcc.gnu.org/pub/gcc/releases/$_gcc/$_gcc.tar.gz" "ftp://ftp.gnu.org/gnu/mpfr/$_mpfr.tar.bz2" "ftp://ftp.gnu.org/gnu/gmp/$_gmp.tar.bz2" "ftp://ftp.gnu.org/gnu/mpc/$_mpc.tar.gz" "ftp://gcc.gnu.org/pub/gcc/infrastructure/$_isl.tar.bz2") -md5sums=('ee04f0c22a941f5f17d93809387f2729' - '8c21d8ac7460493b2b9f3ef3cc610454' - '8ddbb26dc3bd4e2302984debba1406a5' - '4125404e41e482ec68282a2e687f6c73' - '11436d6b205e516635b666090b94ab32') +sha256sums=('f0837f1bf8244a5cc23bd96ff6366712a791cfae01df8e25b137698aca26efc1' + 'feced2d430dd5a97805fa289fed3fc8ff2b094c02d05287fd6133e7f1f0ec926' + 'eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c' + '17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459' + '6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b') options=('!emptydirs' '!strip') prepare() { @@ -53,8 +55,7 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-O2 -G0 \ --fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" + export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" cd "$srcdir" @@ -66,7 +67,11 @@ build() { _build="--build=$MINGW_CHOST --host=$MINGW_CHOST" fi - "../$_gcc/configure" $_build --target=$_target --prefix="$_prefix" \ + "../$_gcc/configure" $_build \ + --target=$_target \ + --prefix="$_prefix" \ + --with-sysroot="$_sysroot" \ + \ --disable-__cxa_atexit \ --disable-decimal-float \ --disable-gold \ @@ -91,10 +96,13 @@ build() { --disable-tls \ --disable-werror \ --enable-languages=c,c++,lto \ + --enable-lto \ --enable-static \ --enable-target-optspace \ --with-abi=32 \ --with-arch=vr4300 \ + --with-gnu-as \ + --with-gnu-ld \ --with-newlib \ --with-tune=vr4300 \ --without-headers \ diff --git a/n64-toolkit/PKGBUILD.newlib b/n64-toolkit/PKGBUILD.newlib index 426a038..c131159 100644 --- a/n64-toolkit/PKGBUILD.newlib +++ b/n64-toolkit/PKGBUILD.newlib @@ -1,17 +1,19 @@ -_target=mips64 -_tuple=$_target-elf-ultra64 -_prefix=/opt/$_tuple -pkgname=$_tuple-newlib -pkgver=3.1.0.20181231 +_target=mips +_triplet="$_target-ultra64-elf" +_prefix="/opt/$_triplet" +_sysroot="$_prefix/sysroot" + +pkgname="$_triplet-newlib" +pkgver=4.1.0 pkgrel=1 _newlib="newlib-$pkgver" -pkgdesc="A C library intended for use on embedded systems ($_target)" +pkgdesc="A C library intended for use on embedded systems ($_triplet)" arch=('any') license=('BSD') url='http://sourceware.org/newlib/' -makedepends=("$_tuple-bootstrap") +makedepends=("$_triplet-bootstrap") source=("ftp://sourceware.org/pub/newlib/$_newlib.tar.gz") -md5sums=('d25fd33b39147d79741faece37dd33a8') +sha256sums=('f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154') options=('!emptydirs' '!strip') build() { @@ -24,8 +26,7 @@ build() { export CPPFLAGS="" export LDFLAGS="" - export CFLAGS_FOR_TARGET="-O2 -G0 \ --fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" + export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti" cd "$srcdir" @@ -37,20 +38,25 @@ build() { _build="--build=$MINGW_CHOST --host=$MINGW_CHOST" fi - "../$_newlib/configure" $_build --target=$_target --prefix="$_prefix" \ - --with-newlib \ - --enable-lto \ - --enable-target-optspace \ - --enable-lite-exit \ - --enable-newlib-global-atexit \ - --enable-newlib-nano-malloc \ - --disable-shared \ - --disable-threads \ + "../$_newlib/configure" $_build \ + --target=$_target \ + --prefix="$_prefix" \ + \ + --disable-libssp \ --disable-newlib-atexit-dynamic-alloc \ --disable-newlib-fvwrite-in-streamio \ - --disable-newlib-wide-orient \ - --disable-newlib-unbuf-stream-opt \ --disable-newlib-supplied-syscalls \ + --disable-newlib-unbuf-stream-opt \ + --disable-newlib-wide-orient \ + --disable-nls \ + --disable-shared \ + --disable-threads \ + --enable-lite-exit \ + --enable-lto \ + --enable-newlib-global-atexit \ + --enable-newlib-nano-malloc \ + --enable-target-optspace \ + --with-newlib \ #--enable-newlib-nano-formatted-io make diff --git a/n64-toolkit/build b/n64-toolkit/build index 9df2381..42137a8 100644 --- a/n64-toolkit/build +++ b/n64-toolkit/build @@ -13,10 +13,12 @@ maybe_sudo() { set -e maybe_sudo -u "$USER" makepkg -fp PKGBUILD.binutils -maybe_sudo pacman -U *.xz(om[1]) +maybe_sudo pacman -U --noconfirm *.zst(om[1]) maybe_sudo -u "$USER" makepkg -fp PKGBUILD.bootstrap -maybe_sudo pacman -U *.xz(om[1]) +maybe_sudo pacman -U --noconfirm *.zst(om[1]) +# due to issues with a symlink, we must attempt to extract newlib twice. +maybe_sudo -u "$USER" makepkg -op PKGBUILD.newlib || true maybe_sudo -u "$USER" makepkg -fp PKGBUILD.newlib -maybe_sudo pacman -U *.xz(om[1]) +maybe_sudo pacman -U --noconfirm *.zst(om[1]) maybe_sudo -u "$USER" makepkg -efp PKGBUILD.gcc -maybe_sudo pacman -U *.xz(om[1]) +maybe_sudo pacman -U --noconfirm *.zst(om[1])