summaryrefslogtreecommitdiff
path: root/cross
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-05-04 20:29:24 -0300
committerDavid P <megver83@parabola.nu>2018-05-04 20:29:24 -0300
commit88d5eda679c3030071ca52196cf8c1f849be4c68 (patch)
treeb5408c179e5de2b01b4c897eff94311cfe79b999 /cross
parentf904467fbbc7b3355d5057044e8f10a125e6b97d (diff)
downloadabslibre-88d5eda679c3030071ca52196cf8c1f849be4c68.tar.gz
abslibre-88d5eda679c3030071ca52196cf8c1f849be4c68.tar.bz2
abslibre-88d5eda679c3030071ca52196cf8c1f849be4c68.zip
Remove outdated compilers from [cross]
Also update the generic PKGBUILDs, and add cross-newlib
Diffstat (limited to 'cross')
-rw-r--r--cross/armv7l-unknown-linux-gnueabihf-binutils/PKGBUILD64
-rw-r--r--cross/armv7l-unknown-linux-gnueabihf-gcc/PKGBUILD134
-rw-r--r--cross/cross-binutils/PKGBUILD166
-rw-r--r--cross/cross-gcc/PKGBUILD274
-rw-r--r--cross/cross-gcc/mips-kfreebsd-gnu.patch426
-rw-r--r--cross/cross-newlib/PKGBUILD152
6 files changed, 345 insertions, 871 deletions
diff --git a/cross/armv7l-unknown-linux-gnueabihf-binutils/PKGBUILD b/cross/armv7l-unknown-linux-gnueabihf-binutils/PKGBUILD
deleted file mode 100644
index 292be5179..000000000
--- a/cross/armv7l-unknown-linux-gnueabihf-binutils/PKGBUILD
+++ /dev/null
@@ -1,64 +0,0 @@
-# Maintainer (Arch): Allan McRae <allan@archlinux.org>
-# Maintainer: André Silva <emulatorman@hyperbola.info>
-# Maintainer: Márcio Silva <coadde@hyperbola.info>
-
-pkgname=armv7l-unknown-linux-gnueabihf-binutils
-pkgver=2.27
-pkgrel=1
-_commit=2870b1ba
-pkgdesc="A set of programs to assemble and manipulate binary and object files"
-arch=('i686' 'x86_64')
-url="http://www.gnu.org/software/binutils/"
-license=('GPL')
-groups=('cross-devel')
-depends=('glibc>=2.24' 'zlib')
-makedepends=('git')
-checkdepends=('dejagnu' 'bc')
-options=('staticlibs' '!distcc' '!ccache')
-source=(git://sourceware.org/git/binutils-gdb.git#commit=${_commit})
-md5sums=('SKIP')
-
-prepare() {
- cd binutils-gdb
-
- # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
- sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
-
- mkdir ${srcdir}/binutils-build
-}
-
-build() {
- cd binutils-build
-
- ../binutils-gdb/configure --prefix=/usr \
- --with-lib-path=/usr/lib:/usr/local/lib \
- --with-bugurl=https://labs.parabola.nu/ \
- --enable-threads --with-pic \
- --enable-ld=default --enable-gold --enable-plugins \
- --enable-deterministic-archives \
- --disable-werror --disable-gdb --disable-nls \
- --target=armv7l-unknown-linux-gnueabihf --with-sysroot=/usr/armv7l-unknown-linux-gnueabihf
-
- # check the host environment and makes sure all the necessary tools are available
- make configure-host
-
- make tooldir=/usr
-}
-
-check() {
- cd binutils-build
-
- # unset LDFLAGS as testsuite makes assumptions about which ones are active
- # ignore failures in gold testsuite...
- make -k LDFLAGS="" check || true
-}
-
-package() {
- cd binutils-build
- make prefix=${pkgdir}/usr install
-
- # Remove info documents that conflict with host version
- rm -rf ${pkgdir}/usr/share/info
- echo "INPUT ( /usr/lib/libbfd.a -liberty -lz -ldl )" > "$pkgdir"/usr/lib/libbfd.so
- echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" > "$pkgdir"/usr/lib/libopcodes.so
-}
diff --git a/cross/armv7l-unknown-linux-gnueabihf-gcc/PKGBUILD b/cross/armv7l-unknown-linux-gnueabihf-gcc/PKGBUILD
deleted file mode 100644
index 1ec71e345..000000000
--- a/cross/armv7l-unknown-linux-gnueabihf-gcc/PKGBUILD
+++ /dev/null
@@ -1,134 +0,0 @@
-# Maintainer (Arch): Allan McRae <allan@archlinux.org>
-# Maintainer: André Silva <emulatorman@hyperbola.info>
-# Maintainer: Márcio Silva <coadde@hyperbola.info>
-
-pkgname=armv7l-unknown-linux-gnueabihf-gcc
-pkgver=6.2.1
-_pkgver=6
-_islver=0.16.1
-pkgrel=1
-_commit=c2103c17
-pkgdesc="The GNU Compiler Collection"
-arch=('i686' 'x86_64' 'armv7h')
-license=('GPL' 'LGPL' 'FDL' 'custom')
-url="http://gcc.gnu.org"
-makedepends=('binutils>=2.26' 'libmpc' 'doxygen' 'git')
-checkdepends=('dejagnu' 'inetutils')
-options=('!emptydirs')
-source=(git://gcc.gnu.org/git/gcc.git#commit=${_commit}
- http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2)
-md5sums=('SKIP'
- 'ac1f25a0677912952718a51f5bc20f32')
-
-# gcc-6.0 forces a changed triplet - need to address in pacman/devtools
-[[ $CARCH == "x86_64" ]] && CHOST=x86_64-pc-linux-gnu
-
-_libdir="usr/lib/gcc/armv7l-unknown-linux-gnueabihf/$pkgver"
-
-prepare() {
- cd ${srcdir}/gcc
-
- # link isl for in-tree build
- ln -s ../isl-${_islver} isl
-
- # Do not run fixincludes
- sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
-
- # Parabola installs x86_64 libraries /lib
- [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
-
- # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
- sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
-
- mkdir ${srcdir}/gcc-build
-}
-
-build() {
- cd ${srcdir}/gcc-build
-
- # using -pipe causes spurious test-suite failures
- # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
- CFLAGS=${CFLAGS/-pipe/}
- CXXFLAGS=${CXXFLAGS/-pipe/}
-
- ${srcdir}/gcc/configure --prefix=/usr \
- --libdir=/usr/lib --libexecdir=/usr/lib \
- --mandir=/usr/share/man \
- --with-bugurl=https://labs.parabola.nu/ \
- --enable-languages=c,c++,lto \
- --enable-shared --enable-threads=posix --enable-libmpx \
- --with-system-zlib --with-isl --enable-__cxa_atexit \
- --disable-libunwind-exceptions --enable-clocale=gnu \
- --disable-libstdcxx-pch --disable-libssp \
- --enable-gnu-unique-object --enable-linker-build-id \
- --enable-lto --enable-plugin --enable-install-libiberty \
- --with-linker-hash-style=gnu --enable-gnu-indirect-function \
- --disable-multilib --disable-werror \
- --enable-checking=release --disable-nls \
- --target=armv7l-unknown-linux-gnueabihf
- make all-gcc
-}
-
-package() {
- pkgdesc="The GNU Compiler Collection - C and C++ frontends"
- depends=("armv7l-unknown-linux-gnueabihf-binutils>=2.26" 'libmpc')
- groups=('cross-devel')
- options=('staticlibs')
-
- cd ${srcdir}/gcc-build
-
- make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
- c++.install-common install-headers install-plugin install-lto-wrapper
-
- install -m755 gcc/gcov $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-gcov
- install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
-
- make DESTDIR=${pkgdir} install-fixincludes
- make -C gcc DESTDIR=${pkgdir} install-mkheaders
- make -C lto-plugin DESTDIR=${pkgdir} install
-
- make -C gcc DESTDIR=${pkgdir} install-man
-
- make -C libcpp DESTDIR=${pkgdir} install
- make -C gcc DESTDIR=${pkgdir} install-po
-
- # many packages expect this symlink
- ln -s armv7l-unknown-linux-gnueabihf-gcc ${pkgdir}/usr/bin/armv7l-unknown-linux-gnueabihf-cc
-
- # POSIX conformance launcher scripts for c89 and c99
- cat > $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-c89 <<"EOF"
-#!/bin/sh
-fl="-std=c89"
-for opt; do
- case "$opt" in
- -ansi|-std=c89|-std=iso9899:1990) fl="";;
- -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
- exit 1;;
- esac
-done
-exec gcc $fl ${1+"$@"}
-EOF
-sed -i "s|exec gcc|exec armv7l-unknown-linux-gnueabihf-gcc|" $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-c89
-
- cat > $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-c99 <<"EOF"
-#!/bin/sh
-fl="-std=c99"
-for opt; do
- case "$opt" in
- -std=c99|-std=iso9899:1999) fl="";;
- -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
- exit 1;;
- esac
-done
-exec gcc $fl ${1+"$@"}
-EOF
-sed -i "s|exec gcc|exec armv7l-unknown-linux-gnueabihf-gcc|" $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-c99
-
- chmod 755 $pkgdir/usr/bin/armv7l-unknown-linux-gnueabihf-c{8,9}9
-
- # Remove man documents that conflict with host version
- rm -rf ${pkgdir}/usr/share/man/man7
-
- # Remove unused dirs
- rmdir ${pkgdir}/usr/{include,share/info}
-}
diff --git a/cross/cross-binutils/PKGBUILD b/cross/cross-binutils/PKGBUILD
index 7c1623782..d01e8e9fc 100644
--- a/cross/cross-binutils/PKGBUILD
+++ b/cross/cross-binutils/PKGBUILD
@@ -1,5 +1,5 @@
-# Maintainer (Arch): Allan McRae <allan@archlinux.org>
-# Maintainer: Márcio Silva <coadde@hyperbola.info>
+# Contributor: Márcio Silva <coadde@hyperbola.info>
+# Maintainer: David P. <megver83@parabola.nu>
# toolchain build order: {kernel}-api-headers->glibc->binutils->gcc->binutils->glibc
@@ -11,6 +11,8 @@
# ->binutils(target system)->gcc(target system)->binutils(target system)
# ->glibc(target system)
+# NOTE: libtool requires rebuilt with each new gcc version
+
#--------------------------------------------------------------------------------
# cross-compile table
#--------------------------------------------------------------------------------
@@ -66,110 +68,98 @@
# < : experimental support. (future)
#--------------------------------------------------------------------------------
-# options
-#--------------------------------------------------------------------------------
-
-# Hardware architecture:
-
-# options: "same", "x86_64", "i686", "armv7l" or "xtensa"
-_arch_target=armv7l
-
-# OS target:
-
-# system: <os> or <kernel>-<os>
-# options: "gnu", "linux-gnu", "linux-gnueabihf" or "elf"
-_os_target=linux-gnueabihf
-
-#--------------------------------------------------------------------------------
-# variables
-#--------------------------------------------------------------------------------
-
-# set the default values if it's not added
-[[ -z $_arch_target ]] && _arch_target=same
-[[ -z $_os_target ]] && _os_target=linux-gnu
-
-# set the value on _arch variable
-if [[ $_arch_target == same ]]; then
- _arch=$CARCH
-else
- _arch=$_arch_target
-fi
-
-# set the value on _target variable
-if [[ $_arch == i686 ]]; then
- _target=$_arch-pc-$_os_target
-else
- _target=$_arch-unknown-$_os_target
-fi
-
+# Tips for build():
#--------------------------------------------------------------------------------
-
-_pkgname=binutils
-pkgname=$_target-$_pkgname
-pkgver=2.27
-_pkgverpatch=$pkgver
+# * If builing without "--disable-multilib" make sure to have "--with-python-dir=share/gcc-$_target"
+
+# * When building using `make' instead of `make all-gcc' append "--with-sysroot=/usr/$_target" and
+# "--with-native-system-header-dir=/include". You'll also have to build and add a libc implementation
+# in makedepends as $_target-<libc> (e.g. $_target-newlib or $_target-glibc)
+
+# Toolchain triplet: <_arch>-<machine>-<_os_target>
+# <machine> is generally optional and uneeded
+_target=x86_64-pc-linux-gnu
+
+# This are some options for names. Change $_target_name in pkgdesc according to the target architecture
+case ${_target%%-*} in
+ arm*) _target_name=ARM
+ ;;
+ aarch64*) _target_name=ARM64
+ ;;
+ xtensa) _target_name=Xtensa
+ ;;
+ sh*) _target_name=SuperH
+ ;;
+ powerpc*) _target_name=PowerPC
+ ;;
+ riscv*) _target_name=RISC-V
+ ;;
+ mips*) _target_name=MIPS
+ ;;
+ i686) _target_name=x86
+ ;;
+ *) _target_name=${_target%%-*}
+ ;;
+esac
+
+pkgname=$_target-binutils
+pkgver=2.30
pkgrel=1
-_commit=2870b1ba
-pkgdesc="A set of programs to assemble and manipulate binary and object files"
+pkgdesc="A set of programs to assemble and manipulate binary and object files for the $_target_name target"
arch=('i686' 'x86_64' 'armv7h' 'aarch64' 'mips64el')
-url="http://www.gnu.org/software/$_pkgname/"
-license=('GPL')
-groups=('cross-devel')
-depends=('glibc>=2.24' 'zlib')
-makedepends=('git')
-checkdepends=('dejagnu' 'bc')
-options=('staticlibs' '!distcc' '!ccache')
-#source=(ftp://ftp.gnu.org/gnu/$_pkgname/$_pkgname-${pkgver}.tar.bz2{,.sig})
-source=(git://sourceware.org/git/$_pkgname-gdb.git#commit=${_commit}
- https://repo.parabola.nu/other/$_pkgname/$_pkgverpatch/$_pkgname-xtensa.patch)
-md5sums=('SKIP'
- 'd3c1408246493c42fc2b78508571f584')
-#validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93')
+url='http://www.gnu.org/software/binutils/'
+license=(GPL)
+depends=(zlib)
+source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2{,.sig})
+sha512sums=('c3ce91aa20f058ec589bf18c722bf651331b394db6378900cc813cc0eea3a331a96584d5ae090630b627369510397dccc9edfcd43d4aeefc99579f277a05c72c'
+ 'SKIP')
+validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93' # Tristan Gingold <gingold@adacore.com>
+ '3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F') # Nick Clifton (Chief Binutils Maintainer) <nickc@redhat.com>
prepare() {
- cd $_pkgname-gdb
-
- # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
+ cd binutils-$pkgver
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
-
- # open-ath9k-htc-firmware patch
- [[ $_target == xtensa-unknown-elf ]] && patch -p1 -i ${srcdir}/$_pkgname-xtensa.patch
-
- mkdir ${srcdir}/$_pkgname-build
}
build() {
- cd $_pkgname-build
-
- ../$_pkgname-gdb/configure --prefix=/usr \
- --with-lib-path=/usr/lib:/usr/local/lib \
- --with-bugurl=https://labs.parabola.nu/ \
- --enable-threads --with-pic \
- --enable-ld=default --enable-gold --enable-plugins \
- --enable-deterministic-archives \
- --disable-werror --disable-gdb --disable-nls \
- --target=$_target --with-sysroot=/usr/$_target
-
- # check the host environment and makes sure all the necessary tools are available
- make configure-host
-
- make tooldir=/usr
+ cd binutils-$pkgver
+
+ if [ "${CARCH}" != "i686" ]; then
+ # enabling gold linker at i686 makes the install fail
+ enable_gold='--enable-gold'
+ fi
+
+ ./configure --target=$_target \
+ --with-sysroot=/usr/$_target \
+ --prefix=/usr \
+ --disable-multilib \
+ --with-gnu-as \
+ --with-gnu-ld \
+ --disable-nls \
+ --enable-ld=default \
+ $enable_gold \
+ --enable-plugins \
+ --enable-deterministic-archives
+
+ make
}
check() {
- cd $_pkgname-build
+ cd binutils-$pkgver
# unset LDFLAGS as testsuite makes assumptions about which ones are active
- # ignore failures in gold testsuite...
+ # do not abort on errors - manually check log files
make -k LDFLAGS="" check || true
}
package() {
- cd $_pkgname-build
- make prefix=${pkgdir}/usr install
+ cd binutils-$pkgver
+
+ make DESTDIR="$pkgdir" install
+
+ # Remove file conflicting with host binutils and manpages for MS Windows tools
+ rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,nlmconv,windres,windmc}*
# Remove info documents that conflict with host version
- rm -rf ${pkgdir}/usr/share/info
- [[ $_target != xtensa-unknown-elf ]] && echo "INPUT ( /usr/lib/libbfd.a -liberty -lz -ldl )" > "$pkgdir"/usr/lib/libbfd.so
- [[ $_target != xtensa-unknown-elf ]] && echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" > "$pkgdir"/usr/lib/libopcodes.so
+ rm -r "$pkgdir"/usr/share/info
}
diff --git a/cross/cross-gcc/PKGBUILD b/cross/cross-gcc/PKGBUILD
index edb2715c7..0436dc773 100644
--- a/cross/cross-gcc/PKGBUILD
+++ b/cross/cross-gcc/PKGBUILD
@@ -1,5 +1,5 @@
-# Maintainer (Arch): Allan McRae <allan@archlinux.org>
-# Maintainer: Márcio Silva <coadde@hyperbola.info>
+# Contributor: Márcio Silva <coadde@hyperbola.info>
+# Maintainer: David P. <megver83@parabola.nu>
# toolchain build order: {kernel}-api-headers->glibc->binutils->gcc->binutils->glibc
@@ -68,184 +68,140 @@
# < : experimental support. (future)
#--------------------------------------------------------------------------------
-# options
+# Tips for build():
#--------------------------------------------------------------------------------
-
-# Hardware architecture:
-
-# options: "same", "x86_64", "i686", "armv7l" or "xtensa"
-_arch_target=armv7l
-
-# OS target:
-
-# system: <os> or <kernel>-<os>
-# options: "gnu", "linux-gnu", "linux-gnueabihf" or "elf"
-_os_target=linux-gnueabihf
-
-#--------------------------------------------------------------------------------
-# variables
-#--------------------------------------------------------------------------------
-
-# set the default values if it's not added
-[[ -z $_arch_target ]] && _arch_target=same
-[[ -z $_os_target ]] && _os_target=linux-gnu
-
-# set the value on _arch variable
-if [[ $_arch_target == same ]]; then
- _arch=$CARCH
-else
- _arch=$_arch_target
-fi
-
-# set the value on _target variable
-if [[ $_arch == i686 ]]; then
- _target=$_arch-pc-$_os_target
-else
- _target=$_arch-unknown-$_os_target
-fi
-
-#--------------------------------------------------------------------------------
-
-_pkgname=gcc
-pkgname=$_target-$_pkgname
-pkgver=6.2.1
-_pkgverpatch=$pkgver
-_pkgver=6
-_islver=0.16.1
+# * If builing without "--disable-multilib" make sure to have "--with-python-dir=share/gcc-$_target"
+#
+# * When building using `make' instead of `make all-gcc' append "--with-sysroot=/usr/$_target" and
+# "--with-native-system-header-dir=/include". You'll also have to build and add a libc implementation
+# in makedepends as $_target-<libc> (e.g. $_target-newlib or $_target-glibc)
+
+# Toolchain triplet: <_arch>-<machine>-<_os_target>
+# <machine> is generally optional and uneeded
+_target=x86_64-pc-linux-gnu
+
+# This are some options for names. Change $_target_name in pkgdesc according to the target architecture
+case ${_target%%-*} in
+ arm*) _target_name=ARM
+ ;;
+ aarch64*) _target_name=ARM64
+ ;;
+ xtensa) _target_name=Xtensa
+ ;;
+ sh*) _target_name=SuperH
+ ;;
+ powerpc*) _target_name=PowerPC
+ ;;
+ riscv*) _target_name=RISC-V
+ ;;
+ mips*) _target_name=MIPS
+ ;;
+ i686) _target_name=x86
+ ;;
+ *) _target_name=${_target%%-*}
+ ;;
+esac
+
+pkgname=$_target-gcc
+_pkgver=7.3.0
+pkgver=$_pkgver+20180426
+_islver=0.19
pkgrel=1
-_commit=c2103c17
-pkgdesc="The GNU Compiler Collection"
+_snapshot=${pkgver:0:1}-${pkgver##$_pkgver+}
+pkgdesc="The GNU Compiler Collection - cross compiler for $_target_name target"
arch=('i686' 'x86_64' 'armv7h' 'aarch64' 'mips64el')
-license=('GPL' 'LGPL' 'FDL' 'custom')
-url="http://$_pkgname.gnu.org"
-makedepends=('binutils>=2.26' 'libmpc' 'doxygen' 'git')
-checkdepends=('dejagnu' 'inetutils')
-options=('!emptydirs')
-source=(git://$_pkgname.gnu.org/git/$_pkgname.git#commit=${_commit}
- http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
- https://repo.parabola.nu/other/$_pkgname/$_pkgverpatch/$_pkgname-xtensa.patch
- mips-kfreebsd-gnu.patch)
-md5sums=('SKIP'
- 'ac1f25a0677912952718a51f5bc20f32'
- '5e0f13db1555fd3f70da9642ab180386'
- '43282cddb2080b1180f7b76d3a8a832c')
-
-# gcc-6.0 forces a changed triplet - need to address in pacman/devtools
-[[ $CARCH == "x86_64" ]] && CHOST=x86_64-pc-linux-gnu
-
-_libdir="usr/lib/$_pkgname/$_target/$pkgver"
+url='http://gcc.gnu.org/'
+license=(GPL LGPL FDL)
+depends=($_target-binutils libmpc zlib)
+makedepends=(gmp mpfr)
+#optdepends=("$_target-newlib: Standard C library ($_target target)") # Uncomment if building --with-newlib support
+options=(!emptydirs !strip)
+source=(#https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.bz2
+ https://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.xz
+ http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
+sha512sums=('7b2c99e12b654b70d630499b00518121276b55673002f3eab02ffa79b24160170bcf0cac4aeee0c07101377fb48adb882d9c4a24ea479305aa10b8c7ab1642d7'
+ '08f4db964d9e02ec8aa9779378ed76e0ddf1d56f81f87664dbf787555ce496cdc87e836f8a51ae137f45e648c604870cce07ee45919eafb549e404afb8f27083')
+
+if [ -n "$_snapshot" ]; then
+ _basedir=gcc-$_snapshot
+else
+ _basedir=gcc-$_pkgver
+fi
prepare() {
- cd ${srcdir}/${_pkgname}
+ cd $_basedir
- # link isl for in-tree build
- ln -s ../isl-${_islver} isl
+ # link isl for in-tree builds
+ ln -sf ../isl-$_islver isl
- # Do not run fixincludes
- sed -i 's@\./fixinc\.sh@-c true@' $_pkgname/Makefile.in
+ echo $_pkgver > gcc/BASE-VER
- # Parabola installs x86_64 libraries /lib
- [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' $_pkgname/config/i386/t-linux64
+ # Do not run fixincludes
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
- sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,$_pkgname}/configure
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
- # open-ath9k-htc-firmware patch
- [[ $_target == xtensa-unknown-elf ]] && patch -p1 -i ${srcdir}/$_pkgname-xtensa.patch
-
- # mips patch on kfreebsd-gnu
- [[ $_target == mips64el-unknown-kfreebsd-gnu ]] && \
- patch -p1 -i ${srcdir}/mips-kfreebsd-gnu.patch
-
- mkdir ${srcdir}/$_pkgname-build
+ mkdir $srcdir/build-gcc
}
build() {
- cd ${srcdir}/$_pkgname-build
+ cd build-gcc
# using -pipe causes spurious test-suite failures
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
- ${srcdir}/${_pkgname}/configure --prefix=/usr \
- --libdir=/usr/lib --libexecdir=/usr/lib \
- --mandir=/usr/share/man \
- --with-bugurl=https://labs.parabola.nu/ \
- --enable-languages=c,c++,lto \
- --enable-shared --enable-threads=posix --enable-libmpx \
- --with-system-zlib --with-isl --enable-__cxa_atexit \
- --disable-libunwind-exceptions --enable-clocale=gnu \
- --disable-libstdcxx-pch --disable-libssp \
- --enable-gnu-unique-object --enable-linker-build-id \
- --enable-lto --enable-plugin --enable-install-libiberty \
- --with-linker-hash-style=gnu --enable-gnu-indirect-function \
- --disable-multilib --disable-werror \
- --enable-checking=release --disable-nls \
- --target=$_target
- make all-$_pkgname
+ $srcdir/$_basedir/configure \
+ --target=$_target \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --enable-languages=c,c++ \
+ --enable-plugins \
+ --enable-shared \
+ --disable-decimal-float \
+ --disable-libffi \
+ --disable-libgomp \
+ --disable-libmudflap \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libstdcxx-pch \
+ --disable-nls \
+ --disable-threads \
+ --disable-tls \
+ --disable-multilib \
+ --with-gnu-as \
+ --with-gnu-ld \
+ --with-system-zlib \
+ --with-gmp \
+ --with-mpfr \
+ --with-mpc \
+ --with-isl \
+ --with-libelf \
+ --enable-gnu-indirect-function \
+ --with-pkgversion='Parabola Repository' \
+ --with-bugurl='https://labs.parabola.nu/'
+
+ make $MAKEFLAGS all-gcc
}
package() {
- pkgdesc="The GNU Compiler Collection - C and C++ frontends"
- depends=("$_target-binutils>=2.26" 'libmpc')
- groups=('cross-devel')
- options=('staticlibs')
-
- cd ${srcdir}/$_pkgname-build
-
- make -C $_pkgname DESTDIR=${pkgdir} install-driver install-cpp install-$_pkgname-ar \
- c++.install-common install-headers install-plugin install-lto-wrapper
-
- install -m755 $_pkgname/gcov $pkgdir/usr/bin/$_target-gcov
- install -m755 -t $pkgdir/${_libdir}/ $_pkgname/{cc1,cc1plus,collect2,lto1}
-
- make DESTDIR=${pkgdir} install-fixincludes
- make -C $_pkgname DESTDIR=${pkgdir} install-mkheaders
- make -C lto-plugin DESTDIR=${pkgdir} install
-
- make -C $_pkgname DESTDIR=${pkgdir} install-man
-
- make -C libcpp DESTDIR=${pkgdir} install
- make -C $_pkgname DESTDIR=${pkgdir} install-po
-
- # many packages expect this symlink
- ln -s $_target-$_pkgname ${pkgdir}/usr/bin/$_target-cc
-
- # POSIX conformance launcher scripts for c89 and c99
- cat > $pkgdir/usr/bin/$_target-c89 <<"EOF"
-#!/bin/sh
-fl="-std=c89"
-for opt; do
- case "$opt" in
- -ansi|-std=c89|-std=iso9899:1990) fl="";;
- -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
- exit 1;;
- esac
-done
-exec gcc $fl ${1+"$@"}
-EOF
-sed -i "s|exec gcc|exec $_target-gcc|" $pkgdir/usr/bin/$_target-c89
-
- cat > $pkgdir/usr/bin/$_target-c99 <<"EOF"
-#!/bin/sh
-fl="-std=c99"
-for opt; do
- case "$opt" in
- -std=c99|-std=iso9899:1999) fl="";;
- -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
- exit 1;;
- esac
-done
-exec gcc $fl ${1+"$@"}
-EOF
-sed -i "s|exec gcc|exec $_target-gcc|" $pkgdir/usr/bin/$_target-c99
-
- chmod 755 $pkgdir/usr/bin/$_target-c{8,9}9
-
- # Remove man documents that conflict with host version
- rm -rf ${pkgdir}/usr/share/man/man7
-
- # Remove unused dirs
- rmdir ${pkgdir}/usr/{include,share/info}
+ cd build-gcc
+
+ make DESTDIR="$pkgdir" install-gcc
+
+ # strip target binaries
+ find "$pkgdir"/usr/lib/gcc/$_target/ -type f -and \( -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 '{}' \;
+ # Use the following instead if building with `make' on build()
+ #find "$pkgdir"/usr/lib/gcc/$_target/$_pkgver "$pkgdir"/usr/$_target/lib -type f -and \( -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 "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/ -type f -and \( -executable \) -exec strip '{}' \;
+
+ # Remove files that conflict with host gcc package
+ rm -r "$pkgdir"/usr/share/man/man7
+ rm -r "$pkgdir"/usr/share/info
+ # Add the following if building with `make' on build()
+ #rm "$pkgdir"/usr/lib/libcc1.*
}
diff --git a/cross/cross-gcc/mips-kfreebsd-gnu.patch b/cross/cross-gcc/mips-kfreebsd-gnu.patch
deleted file mode 100644
index 9c8acfa91..000000000
--- a/cross/cross-gcc/mips-kfreebsd-gnu.patch
+++ /dev/null
@@ -1,426 +0,0 @@
-diff -Nur a/gcc/config/mips/kfreebsd-gnu64.h b/gcc/config/mips/kfreebsd-gnu64.h
---- a/gcc/config/mips/kfreebsd-gnu64.h 1969-12-31 21:00:00.000000000 -0300
-+++ b/gcc/config/mips/kfreebsd-gnu64.h 2014-03-16 13:20:51.041846449 -0300
-@@ -0,0 +1,27 @@
-+/* Definitions for MIPS running Linux-based GNU systems with ELF format
-+ using n32/64 abi.
-+ Copyright (C) 2002-2013 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 3, or (at your option)
-+any later version.
-+
-+GCC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GCC; see the file COPYING3. If not see
-+<http://www.gnu.org/licenses/>. */
-+
-+#define GNU_USER_LINK_EMULATION32 "elf32%{EB:b}%{EL:l}tsmip_fbsd"
-+#define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip_fbsd"
-+#define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32_fbsd"
-+
-+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
-+#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
-+#define GNU_USER_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
-diff -Nur a/gcc/config/mips/kfreebsd-gnu.h b/gcc/config/mips/kfreebsd-gnu.h
---- a/gcc/config/mips/kfreebsd-gnu.h 1969-12-31 21:00:00.000000000 -0300
-+++ b/gcc/config/mips/kfreebsd-gnu.h 2013-01-10 18:38:27.000000000 -0200
-@@ -0,0 +1,20 @@
-+/* Definitions for MIPS running Linux-based GNU systems with ELF format.
-+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 3, or (at your option)
-+any later version.
-+
-+GCC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GCC; see the file COPYING3. If not see
-+<http://www.gnu.org/licenses/>. */
-+
-+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-diff -Nur a/gcc/config/mips/mti-kfreebsd.h b/gcc/config/mips/mti-kfreebsd.h
---- a/gcc/config/mips/mti-kfreebsd.h 1969-12-31 21:00:00.000000000 -0300
-+++ b/gcc/config/mips/mti-kfreebsd.h 2014-03-16 06:26:20.059268372 -0300
-@@ -0,0 +1,43 @@
-+/* Target macros for mips*-mti-linux* targets.
-+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 3, or (at your option)
-+any later version.
-+
-+GCC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GCC; see the file COPYING3. If not see
-+<http://www.gnu.org/licenses/>. */
-+
-+/* This target is a multilib target, specify the sysroot paths. */
-+#undef SYSROOT_SUFFIX_SPEC
-+#define SYSROOT_SUFFIX_SPEC \
-+ "%{mips32:/mips32}%{mips64:/mips64}%{mips64r2:/mips64r2}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}"
-+
-+#undef DRIVER_SELF_SPECS
-+#define DRIVER_SELF_SPECS \
-+ /* Make sure a -mips option is present. This helps us to pick \
-+ the right multilib, and also makes the later specs easier \
-+ to write. */ \
-+ MIPS_ISA_LEVEL_SPEC, \
-+ \
-+ /* Infer the default float setting from -march. */ \
-+ MIPS_ARCH_FLOAT_SPEC, \
-+ \
-+ /* Infer the -msynci setting from -march if not explicitly set. */ \
-+ MIPS_ISA_SYNCI_SPEC, \
-+ \
-+ /* If no ABI option is specified, infer one from the ISA level \
-+ or -mgp setting. */ \
-+ "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
-+ \
-+ /* Base SPECs. */ \
-+ BASE_DRIVER_SELF_SPECS
-diff -Nur a/gcc/config/mips/t-kfreebsd64 b/gcc/config/mips/t-kfreebsd64
---- a/gcc/config/mips/t-kfreebsd64 1969-12-31 21:00:00.000000000 -0300
-+++ b/gcc/config/mips/t-kfreebsd64 2014-03-16 04:56:34.851827638 -0300
-@@ -0,0 +1,26 @@
-+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
-+#
-+# This file is part of GCC.
-+#
-+# GCC is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3, or (at your option)
-+# any later version.
-+#
-+# GCC is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with GCC; see the file COPYING3. If not see
-+# <http://www.gnu.org/licenses/>.
-+
-+MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
-+MULTILIB_DIRNAMES = n32 32 64
-+MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
-+MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
-+MULTILIB_OSDIRNAMES = \
-+ ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-kfreebsd-gnuabin32$(MIPS_SOFT)) \
-+ ../lib$(call if_multiarch,:mips$(MIPS_EL)-kfreebsd-gnu$(MIPS_SOFT)) \
-+ ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-kfreebsd-gnuabi64$(MIPS_SOFT))
-diff -Nur a/gcc/config/mips/t-mti-kfreebsd b/gcc/config/mips/t-mti-kfreebsd
---- a/gcc/config/mips/t-mti-kfreebsd 1969-12-31 21:00:00.000000000 -0300
-+++ b/gcc/config/mips/t-mti-kfreebsd 2013-01-10 18:38:27.000000000 -0200
-@@ -0,0 +1,33 @@
-+# Copyright (C) 2012-2013 Free Software Foundation, Inc.
-+#
-+# This file is part of GCC.
-+#
-+# GCC is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3, or (at your option)
-+# any later version.
-+#
-+# GCC is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with GCC; see the file COPYING3. If not see
-+# <http://www.gnu.org/licenses/>.
-+
-+# The default build is mips32r2, hard-float big-endian. Add mips32,
-+# soft-float, and little-endian variations.
-+
-+MULTILIB_OPTIONS = mips32/mips64/mips64r2 mabi=64 EL msoft-float
-+MULTILIB_DIRNAMES = mips32 mips64 mips64r2 64 el sof
-+MULTILIB_MATCHES = EL=mel EB=meb
-+
-+# The 64 bit ABI is not supported on the mips32 architecture.
-+MULTILIB_EXCEPTIONS += *mips32*/*mabi=64*
-+
-+# The 64 bit ABI is not supported on the mips32r2 architecture.
-+# Because mips32r2 is the default we can't use that flag to trigger
-+# the exception so we check for mabi=64 with no specific mips flag
-+# instead.
-+MULTILIB_EXCEPTIONS += mabi=64*
-diff -Nur a/gcc/config.gcc b/gcc/config.gcc
---- a/gcc/config.gcc 2013-12-07 01:29:47.000000000 -0200
-+++ b/gcc/config.gcc 2014-03-16 13:02:41.653469226 -0300
-@@ -1795,36 +1795,79 @@
- tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
- extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
- ;;
--mips*-mti-linux*)
-- tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h mips/mti-linux.h"
-- tmake_file="${tmake_file} mips/t-mti-linux"
-+mips*-mti-linux* | mips*-mti-kfreebsd*-gnu)
-+ tm_file="dbxelf.h elfos.h gnu-user.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h"
- tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
-+ case ${target} in
-+ mips*-mti-linux*)
-+ tm_file="${tm_file} linux.h mips/linux64.h mips/linux-common.h mips/mti-linux.h
-+ tmake_file="${tmake_file} mips/t-mti-linux"
-+ ;;
-+ mips*-mti-kfreebsd*-gnu)
-+ tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h mips/mti-kfreebsd-gnu.h
-+ tmake_file="${tmake_file} mips/t-mti-kfreebsd"
-+ ;;
-+ esac
- gnu_ld=yes
- gas=yes
- test x$with_llsc != x || with_llsc=yes
- ;;
--mips64*-*-linux* | mipsisa64*-*-linux*)
-- tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
-- tmake_file="${tmake_file} mips/t-linux64"
-+mips64*-*-linux* | mipsisa64*-*-linux* | mips64*-*-kfreebsd*-gnu | mipsisa64*-*-kfreebsd*-gnu)
-+ tm_file="dbxelf.h elfos.h gnu-user.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h"
- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
- case ${target} in
- mips64el-st-linux-gnu)
-- tm_file="${tm_file} mips/st.h"
-- tmake_file="${tmake_file} mips/t-st"
-+ tm_file="${tm_file} mips/st.h linux.h mips/linux64.h mips/linux-common.h"
-+ tmake_file="${tmake_file} mips/t-st mips/t-linux64"
- ;;
- mips64octeon*-*-linux*)
-+ tm_file="${tm_file} linux.h mips/linux64.h mips/linux-common.h"
-+ tmake_file="${tmake_file} mips/t-linux64"
- tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
- target_cpu_default=MASK_SOFT_FLOAT_ABI
- ;;
-+ mips64*-*-linux*)
-+ tm_file="${tm_file} linux.h mips/linux64.h mips/linux-common.h"
-+ tmake_file="${tmake_file} mips/t-linux64"
-+ ;;
- mipsisa64r2*-*-linux*)
-+ tm_file="${tm_file} linux.h mips/linux64.h mips/linux-common.h"
-+ tmake_file="${tmake_file} mips/t-linux64"
-+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
-+ ;;
-+ mipsisa64*-*-linux*)
-+ tm_file="${tm_file} linux.h mips/linux64.h mips/linux-common.h"
-+ tmake_file="${tmake_file} mips/t-linux64"
-+ ;;
-+ mips64el-st-kfreebsd-gnu)
-+ tm_file="${tm_file} mips/st.h kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-st mips/t-kfreebsd64"
-+ ;;
-+ mips64octeon*-*-kfreebsd*-gnu)
-+ tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-kfreebsd64"
-+ tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
-+ target_cpu_default=MASK_SOFT_FLOAT_ABI
-+ ;;
-+ mips64*-*-kfreebsd*-gnu)
-+ tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-kfreebsd64"
-+ ;;
-+ mipsisa64r2*-*-kfreebsd*-gnu)
-+ tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-kfreebsd64"
- tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
- ;;
-+ mipsisa64*-*-kfreebsd*-gnu)
-+ tm_file="${tm_file} kfreebsd-gnu.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-kfreebsd64"
-+ ;;
- esac
- gnu_ld=yes
- gas=yes
- test x$with_llsc != x || with_llsc=yes
- ;;
--mips*-*-linux*) # Linux MIPS, either endian.
-+mips*-*-linux*) # MIPS, either endian.
- tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h"
- if test x$enable_targets = xall; then
- tm_file="${tm_file} mips/gnu-user64.h mips/linux64.h"
-@@ -1840,6 +1883,22 @@
- esac
- test x$with_llsc != x || with_llsc=yes
- ;;
-+mips*-*-kfreebsd*-gnu) # MIPS, either endian.
-+ tm_file="dbxelf.h elfos.h gnu-user.h kfreebsd-gnu.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/kfreebsd-gnu.h"
-+ if test x$enable_targets = xall; then
-+ tm_file="${tm_file} mips/gnu-user64.h mips/kfreebsd-gnu64.h"
-+ tmake_file="${tmake_file} mips/t-kfreebsd64"
-+ fi
-+ tm_file="${tm_file} kfreebsd-gnu.h"
-+ case ${target} in
-+ mipsisa32r2*)
-+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
-+ ;;
-+ mipsisa32*)
-+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
-+ esac
-+ test x$with_llsc != x || with_llsc=yes
-+ ;;
- mips*-mti-elf*)
- tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h mips/mti-elf.h"
- tmake_file="mips/t-mti-elf"
-diff -Nur a/libgcc/config/mips/kfreebsd-gnu-unwind.h b/libgcc/config/mips/kfreebsd-gnu-unwind.h
---- a/libgcc/config/mips/kfreebsd-gnu-unwind.h 1969-12-31 21:00:00.000000000 -0300
-+++ b/libgcc/config/mips/kfreebsd-gnu-unwind.h 2013-02-25 11:53:16.000000000 -0200
-@@ -0,0 +1,120 @@
-+/* DWARF2 EH unwinding support for MIPS Linux.
-+ Copyright (C) 2004-2013 Free Software Foundation, Inc.
-+
-+This file is part of GCC.
-+
-+GCC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 3, or (at your option)
-+any later version.
-+
-+GCC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+Under Section 7 of GPL version 3, you are granted additional
-+permissions described in the GCC Runtime Library Exception, version
-+3.1, as published by the Free Software Foundation.
-+
-+You should have received a copy of the GNU General Public License and
-+a copy of the GCC Runtime Library Exception along with this program;
-+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-+<http://www.gnu.org/licenses/>. */
-+
-+#ifndef inhibit_libc
-+/* Do code reading to identify a signal frame, and set the frame
-+ state data appropriately. See unwind-dw2.c for the structs. */
-+
-+#include <signal.h>
-+#include <asm/unistd.h>
-+
-+/* The third parameter to the signal handler points to something with
-+ * this structure defined in asm/ucontext.h, but the name clashes with
-+ * struct ucontext from sys/ucontext.h so this private copy is used. */
-+typedef struct _sig_ucontext {
-+ unsigned long uc_flags;
-+ struct _sig_ucontext *uc_link;
-+ stack_t uc_stack;
-+ struct sigcontext uc_mcontext;
-+ sigset_t uc_sigmask;
-+} _sig_ucontext_t;
-+
-+#define MD_FALLBACK_FRAME_STATE_FOR mips_fallback_frame_state
-+
-+static _Unwind_Reason_Code
-+mips_fallback_frame_state (struct _Unwind_Context *context,
-+ _Unwind_FrameState *fs)
-+{
-+ u_int32_t *pc = (u_int32_t *) context->ra;
-+ struct sigcontext *sc;
-+ _Unwind_Ptr new_cfa, reg_offset;
-+ int i;
-+
-+ /* 24021061 li v0, 0x1061 (rt_sigreturn)*/
-+ /* 0000000c syscall */
-+ /* or */
-+ /* 24021017 li v0, 0x1017 (sigreturn) */
-+ /* 0000000c syscall */
-+ if (pc[1] != 0x0000000c)
-+ return _URC_END_OF_STACK;
-+#if _MIPS_SIM == _ABIO32
-+ if (pc[0] == (0x24020000 | __NR_sigreturn))
-+ {
-+ struct sigframe {
-+ u_int32_t ass[4]; /* Argument save space for o32. */
-+ u_int32_t trampoline[2];
-+ struct sigcontext sigctx;
-+ } *rt_ = context->cfa;
-+ sc = &rt_->sigctx;
-+ }
-+ else
-+#endif
-+ if (pc[0] == (0x24020000 | __NR_rt_sigreturn))
-+ {
-+ struct rt_sigframe {
-+ u_int32_t ass[4]; /* Argument save space for o32. */
-+ u_int32_t trampoline[2];
-+ siginfo_t info;
-+ _sig_ucontext_t uc;
-+ } *rt_ = context->cfa;
-+ sc = &rt_->uc.uc_mcontext;
-+ }
-+ else
-+ return _URC_END_OF_STACK;
-+
-+ new_cfa = (_Unwind_Ptr) sc;
-+ fs->regs.cfa_how = CFA_REG_OFFSET;
-+ fs->regs.cfa_reg = STACK_POINTER_REGNUM;
-+ fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
-+
-+ /* On o32 Linux, the register save slots in the sigcontext are
-+ eight bytes. We need the lower half of each register slot,
-+ so slide our view of the structure back four bytes. */
-+#if _MIPS_SIM == _ABIO32 && defined __MIPSEB__
-+ reg_offset = 4;
-+#else
-+ reg_offset = 0;
-+#endif
-+
-+ for (i = 0; i < 32; i++) {
-+ fs->regs.reg[i].how = REG_SAVED_OFFSET;
-+ fs->regs.reg[i].loc.offset
-+ = (_Unwind_Ptr)&(sc->sc_regs[i]) + reg_offset - new_cfa;
-+ }
-+ /* "PC & -2" points to the faulting instruction, but the unwind code
-+ searches for "(ADDR & -2) - 1". (See MASK_RETURN_ADDR for the source
-+ of the -2 mask.) Adding 2 here ensures that "(ADDR & -2) - 1" is the
-+ address of the second byte of the faulting instruction.
-+
-+ Note that setting fs->signal_frame would not work. As the comment
-+ above MASK_RETURN_ADDR explains, MIPS unwinders must earch for an
-+ odd-valued address. */
-+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
-+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
-+ = (_Unwind_Ptr)(sc->sc_pc) + 2 - new_cfa;
-+ fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
-+
-+ return _URC_NO_REASON;
-+}
-+#endif
-diff -Nur a/libgcc/config.host b/libgcc/config.host
---- a/libgcc/config.host 2014-01-21 17:50:02.000000000 -0200
-+++ b/libgcc/config.host 2014-03-16 05:04:15.960188275 -0300
-@@ -732,6 +732,14 @@
- tmake_file="${tmake_file} mips/t-tpbit"
- fi
- ;;
-+mips*-*-kfreebsd*-gnu) # MIPS, either endian.
-+ extra_parts="$extra_parts crtfastmath.o"
-+ tmake_file="${tmake_file} t-crtfm mips/t-mips16"
-+ md_unwind_header=mips/kfreebsd-gnu-unwind.h
-+ if test "${ac_cv_sizeof_long_double}" = 16; then
-+ tmake_file="${tmake_file} mips/t-tpbit"
-+ fi
-+ ;;
- mips*-sde-elf*)
- tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
- case "${with_newlib}" in
diff --git a/cross/cross-newlib/PKGBUILD b/cross/cross-newlib/PKGBUILD
new file mode 100644
index 000000000..4c3372ed8
--- /dev/null
+++ b/cross/cross-newlib/PKGBUILD
@@ -0,0 +1,152 @@
+# Maintainer: David P. <megver83@parabola.nu>
+
+# toolchain build order: {kernel}-api-headers->glibc->binutils->gcc->binutils->glibc
+
+# toolchain (for cross-compiler) build order:
+# {kernel}-api-headers(host system)->glibc(host system)
+# ->binutils(host system)->gcc(host system)->binutils(host system)->glibc(host system)
+# ->binutils(cross)->gcc(cross)
+# ->kernel-api-headers(target system)->glibc(target system)
+# ->binutils(target system)->gcc(target system)->binutils(target system)
+# ->glibc(target system)
+
+# NOTE: libtool requires rebuilt with each new gcc version
+
+#--------------------------------------------------------------------------------
+# cross-compile table
+#--------------------------------------------------------------------------------
+
+# +-------------+-------------+-----------------------------------------------------------------------------------------------------+-----------+---------+
+# | -march | CARCH | CTARGET (_CTARGET) | Multilib | QEMU |
+# +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
+# | _march | CARCH | _arch | <machine> | _os_target (GNU/*) | _multilib | - |
+# +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
+# | x86_64 | x86_64 | x86_64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kdragonflybsd,kopensolaris}-gnu|elf | yes | bin/sys |
+# | i[3-7]86 | i[3-7]86 | i[3-7]86 | pc | gnu|{linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnu|elf | no | bin/sys |
+# | armv8-a | aarch64 | aarch64 | unknown | {linux,kfreebsd,knetbsd}-gnu|elf | no | bin/sys |
+# | armv8-a | aarch64_be | aarch64_be | unknown | {linux,kfreebsd,knetbsd}-gnu|elf | no | bin/sys |
+# | armv7-a | armv7h | armv7l | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabihf|elf | no | bin/sys |
+# | armv6 | armv6h | armv6l | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabihf|elf | no | bin/sys |
+# | armv5te | arm | armv5tel | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabi | no | bin/sys |
+# | * | arm | arm | unknown | eabi | no | bin/sys |
+# | arm | armeb | armeb | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnueabi|eabi | no | bin |
+# | mips64el | mips64el | mips64el | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+# | mips64 | mips64 | mips64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+# | * | mipsel | mipsel | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+# | * | mips | mips | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+#v| powerpc64 | powerpc64 | powerpc64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin/sys |x|eabi
+#x| powerpc64le | powerpc64le | powerpc64le | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin |
+# | powerpc | powerpc | powerpc | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin/sys |
+# | powerpcle | powerpcle | powerpcle | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | - |
+# | - | spu | spu | unknown | elf | no | - |
+# | - | sh64 | sh64 | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - |
+# | - | sh64le | sh64le | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - |
+# | - | sh4 | sh4 | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+# | - | sh4le | sh4le | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
+# | - | sh | sh | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - @ |
+# | - | shle | shle | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - @ |
+# | - | m68k | m68k | unknown | gnu|{linux,knetbsd}-gnu|elf | no | bin/sys |
+# | - | avr | avr | unknown | linux-gnu|elf | no | - |
+# | - | xtensa | xtensa | unknown | linux-gnu|elf | no | sys |
+# | - | lm32 | lm32 | unknown | linux-gnu|elf | no | sys |
+# | - | or32 | or32 | unknown | linux-gnu|elf | no | bin/sys |x|linux-gnu
+# +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
+
+# For "Wine, Darling and DOSBox"
+# +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
+# | x86_64 | x86_64 | x86_64 | unknown | mingw64(Wine)|darwin | yes | bin/sys |
+# | i[3-7]86 | i[3-7]86 | i[3-7]86 | pc | mingw32(Wine)|msdosdjgpp(DOSBox)|darwin | no | bin/sys |
+# | armv7-a | armv7h | armv7l | unknown | mingw-arm(Wine)|darwin | no | bin/sys |
+# | powerpc | powerpc | powerpc | unknown | darwin | no | bin/sys |
+# +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
+
+# opt : Multilib is optional
+# * : Any supported by architecture.
+# - : None.
+# @ : bin/sys (Only sh4 and sh4l support)
+# < : experimental support. (future)
+
+#--------------------------------------------------------------------------------
+# Tips for build():
+#--------------------------------------------------------------------------------
+# * If builing without "--disable-multilib" make sure to have "--with-python-dir=share/gcc-$_target"
+
+# * When building using `make' instead of `make all-gcc' append "--with-sysroot=/usr/$_target" and
+# "--with-native-system-header-dir=/include". You'll also have to build and add a libc implementation
+# in makedepends as $_target-<libc> (e.g. $_target-newlib or $_target-glibc)
+
+# Toolchain triplet: <_arch>-<machine>-<_os_target>
+# <machine> is generally optional and uneeded
+_target=x86_64-pc-linux-gnu
+
+# This are some options for names. Change $_target_name in pkgdesc according to the target architecture
+case ${_target%%-*} in
+ arm*) _target_name=ARM
+ ;;
+ aarch64*) _target_name=ARM64
+ ;;
+ xtensa) _target_name=Xtensa
+ ;;
+ sh*) _target_name=SuperH
+ ;;
+ powerpc*) _target_name=PowerPC
+ ;;
+ riscv*) _target_name=RISC-V
+ ;;
+ mips*) _target_name=MIPS
+ ;;
+ i686) _target_name=x86
+ ;;
+ *) _target_name=${_target%%-*}
+ ;;
+esac
+
+pkgname=$_target-newlib
+pkgver=3.0.0
+pkgrel=1
+_upstream_ver=$pkgver
+pkgdesc="A C standard library implementation intended for use on embedded systems ($_target_name target)"
+arch=(any)
+url='http://www.sourceware.org/newlib/'
+license=(BSD)
+makedepends=($_target-gcc)
+options=(!emptydirs !strip)
+source=(ftp://sourceware.org/pub/newlib/newlib-$_upstream_ver.tar.gz
+ fix_build1.patch::'https://www.sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=b8272e3b8df8337744423e4dd23e727cf963d528'
+ fix_build2.patch::'https://www.sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=patch;h=b7e0f286a2ecab3b687ec9b3f95f5a88b9f85310')
+sha256sums=('c8566335ee74e5fcaeb8595b4ebd0400c4b043d6acb3263ecb1314f8f5501332'
+ '2be98412600b8d62b4f1456e95ae4bc3b7a6810981d3fde49fad1f42df0c49da'
+ '641978987fcfc9fc5c529192f34771db44d3257f95bc682da16e8351356177cf')
+
+prepare() {
+ cd newlib-$_upstream_ver
+ patch -p1 < ../fix_build1.patch
+ patch -p1 < ../fix_build2.patch
+}
+
+build() {
+ rm -rf build-newlib
+ mkdir build-newlib
+
+ export CFLAGS_FOR_TARGET='-g -O2 -ffunction-sections -fdata-sections'
+ cd "$srcdir"/build-newlib
+ ../newlib-$_upstream_ver/configure \
+ --target=$_target \
+ --prefix=/usr \
+ --disable-newlib-supplied-syscalls \
+ --disable-nls \
+ --enable-newlib-io-long-long \
+ --enable-newlib-register-fini
+ make
+
+}
+
+package() {
+ cd "$srcdir"/build-newlib
+ make DESTDIR="$pkgdir" install
+
+ find "$pkgdir"/usr/$_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 '{}' \;
+
+ install -d "$pkgdir"/usr/share/licenses/$pkgname/
+ install -m644 -t "$pkgdir"/usr/share/licenses/$pkgname/ "$srcdir"/newlib-$_upstream_ver/COPYING*
+}