summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-08 02:32:28 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-08 02:32:28 +0100
commit5741f4d6d17c1da2bfa83f184ef7afdbbe73ce7d (patch)
treedd5e358da568ff870703f4eb7ce289bb99cd785f
parent445da8012c3bb40263d06e4a7311a2f8613727ff (diff)
downloadabslibre-5741f4d6d17c1da2bfa83f184ef7afdbbe73ce7d.tar.gz
abslibre-5741f4d6d17c1da2bfa83f184ef7afdbbe73ce7d.tar.bz2
abslibre-5741f4d6d17c1da2bfa83f184ef7afdbbe73ce7d.zip
added pkgbuilds for riscv64-linux-gnu toolchain
-rw-r--r--pcr/riscv64-linux-gnu-binutils/PKGBUILD69
-rw-r--r--pcr/riscv64-linux-gnu-gcc-bootstrap/PKGBUILD103
-rw-r--r--pcr/riscv64-linux-gnu-gcc/PKGBUILD94
-rw-r--r--pcr/riscv64-linux-gnu-gdb/PKGBUILD62
-rw-r--r--pcr/riscv64-linux-gnu-glibc/PKGBUILD72
-rw-r--r--pcr/riscv64-linux-gnu-linux-libre-api-headers/PKGBUILD42
6 files changed, 442 insertions, 0 deletions
diff --git a/pcr/riscv64-linux-gnu-binutils/PKGBUILD b/pcr/riscv64-linux-gnu-binutils/PKGBUILD
new file mode 100644
index 000000000..abc12c0f8
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-binutils/PKGBUILD
@@ -0,0 +1,69 @@
+# $Id$
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-gnu-binutils
+
+_target=riscv64-linux-gnu
+pkgname=$_target-binutils
+_snapshot=20171231
+pkgver=2.29.v$_snapshot
+pkgrel=1
+pkgdesc='A set of programs to assemble and manipulate binary and object files for the riscv64 target'
+arch=(x86_64)
+url='https://github.com/riscv/riscv-gnu-toolchain'
+license=(GPL)
+depends=(zlib)
+makedepends=(git)
+source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
+sha256sums=('SKIP')
+
+prepare() {
+ cd "$srcdir/$_target"
+
+ # fix submodule repo paths
+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
+ # update submodule
+ git submodule update --init riscv-binutils-gdb
+
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
+}
+
+build() {
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+
+ ./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 \
+ --disable-gdb
+
+ make
+}
+
+check() {
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+
+ # unset LDFLAGS as testsuite makes assumptions about which ones are active
+ # do not abort on errors - manually check log files
+ make -k LDFLAGS="" check || true
+}
+
+package() {
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+
+ make DESTDIR="$pkgdir" install
+
+ # Remove file conflicting with host binutils and manpages for MS Windows tools
+ rm -r "$pkgdir"/usr/share/info
+ rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,nlmconv,windres,windmc}*
+}
diff --git a/pcr/riscv64-linux-gnu-gcc-bootstrap/PKGBUILD b/pcr/riscv64-linux-gnu-gcc-bootstrap/PKGBUILD
new file mode 100644
index 000000000..9a48ab126
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-gcc-bootstrap/PKGBUILD
@@ -0,0 +1,103 @@
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-gnu-gcc
+# - this is only used to bootstrap the toolchain, since you need gcc to compile
+# glibc, and glibc to compile gcc, we have this package as a 'stage1' gcc build
+# to create the initial glibc and the 'real' gcc
+
+_target=riscv64-linux-gnu
+pkgname=$_target-gcc-bootstrap
+_snapshot=20171231
+pkgver=7.2.0.v$_snapshot
+pkgrel=1
+pkgdesc='The GNU Compiler Collection - cross compiler for riscv64 target - bootstrap version. only used to build initial glibc and compiler'
+arch=(x86_64)
+url='https://github.com/riscv/riscv-gnu-toolchain'
+license=(GPL LGPL FDL)
+depends=($_target-binutils libmpc zlib)
+makedepends=(git)
+options=(!emptydirs !strip)
+provides=(${pkgname%-bootstrap})
+conflicts=(${pkgname%-bootstrap})
+source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
+sha256sums=('SKIP')
+
+prepare() {
+ cd "$srcdir/$_target"
+
+ # fix submodule repo paths
+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
+ # update submodule
+ git submodule update --init riscv-gcc
+
+ cd "$srcdir/$_target/riscv-gcc"
+
+ echo $pkgver > gcc/BASE-VER
+
+ ./contrib/download_prerequisites
+
+ # 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/" "$srcdir"/$_target/riscv-gcc/{libiberty,gcc}/configure
+
+ rm -rf $srcdir/gcc-build
+ mkdir $srcdir/gcc-build
+}
+
+build() {
+ cd 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/$_target/riscv-gcc/configure \
+ --prefix=/usr \
+ --program-prefix=$_target- \
+ --with-local-prefix=/usr/$_target \
+ --with-sysroot=/usr/$_target \
+ --with-build-sysroot=/usr/$_target \
+ --libdir=/usr/lib --libexecdir=/usr/lib \
+ --target=$_target --host=$CHOST --build=$CHOST \
+ --with-newlib \
+ --without-headers \
+ --disable-shared \
+ --disable-threads \
+ --with-system-zlib \
+ --enable-tls \
+ --enable-languages=c \
+ --disable-libatomic \
+ --disable-libmudflap \
+ --disable-libssp \
+ --disable-libquadmath \
+ --disable-libgomp \
+ --disable-nls \
+ --disable-bootstrap \
+ --enable-chehcking=release \
+ --disable-multilib \
+
+ make inhibit-libc=true all-gcc
+ make inhibit-libc=true all-target-libgcc
+}
+
+package() {
+ cd gcc-build
+
+ make DESTDIR="$pkgdir" inhibit-libc=true install-gcc
+ make DESTDIR="$pkgdir" inhibit-libc=true install-target-libgcc
+
+ # 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 '{}' \;
+
+ # 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
+}
diff --git a/pcr/riscv64-linux-gnu-gcc/PKGBUILD b/pcr/riscv64-linux-gnu-gcc/PKGBUILD
new file mode 100644
index 000000000..b94b26e43
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-gcc/PKGBUILD
@@ -0,0 +1,94 @@
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-gnu-gcc
+
+_target=riscv64-linux-gnu
+pkgname=$_target-gcc
+_snapshot=20171231
+pkgver=7.2.0.v$_snapshot
+pkgrel=1
+pkgdesc='The GNU Compiler Collection - cross compiler for riscv64 target'
+arch=(x86_64)
+url='https://github.com/riscv/riscv-gnu-toolchain'
+license=(GPL LGPL FDL)
+depends=($_target-binutils $_target-glibc libmpc zlib)
+makedepends=(git)
+options=(!emptydirs !strip)
+conflicts=($pkgname-bootstrap)
+replaces=($pkgname-bootstrap)
+source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
+sha256sums=('SKIP')
+
+prepare() {
+ cd "$srcdir/$_target"
+
+ # fix submodule repo paths
+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
+ # update submodule
+ git submodule update --init riscv-gcc
+
+ cd "$srcdir/$_target/riscv-gcc"
+
+ echo $pkgver > gcc/BASE-VER
+
+ ./contrib/download_prerequisites
+
+ # 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/" "$srcdir"/$_target/riscv-gcc/{libiberty,gcc}/configure
+
+ rm -rf $srcdir/gcc-build
+ mkdir $srcdir/gcc-build
+}
+
+build() {
+ cd 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/$_target/riscv-gcc/configure \
+ --prefix=/usr \
+ --program-prefix=$_target- \
+ --with-local-prefix=/usr/$_target \
+ --with-sysroot=/usr/$_target \
+ --with-build-sysroot=/usr/$_target \
+ --libdir=/usr/lib --libexecdir=/usr/lib \
+ --target=$_target --host=$CHOST --build=$CHOST \
+ --with-system-zlib \
+ --enable-shared \
+ --enable-tls \
+ --enable-languages=c,c++,fortran \
+ --disable-libmudflap \
+ --disable-libssp \
+ --disable-libquadmath \
+ --disable-nls \
+ --disable-bootstrap \
+ --enable-chehcking=release \
+ --disable-multilib
+
+ make
+}
+
+package() {
+ cd gcc-build
+
+ make DESTDIR="$pkgdir" install-gcc install-target-libgcc install-target-libstdc++-v3
+
+ # strip target binaries
+ find "$pkgdir"/usr/lib/gcc/$_target/ "$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
+ rm -r "$pkgdir"/usr/share/gcc-$pkgver
+}
diff --git a/pcr/riscv64-linux-gnu-gdb/PKGBUILD b/pcr/riscv64-linux-gnu-gdb/PKGBUILD
new file mode 100644
index 000000000..623a680da
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-gdb/PKGBUILD
@@ -0,0 +1,62 @@
+# $Id$
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-gnu-gdb
+
+_target=riscv64-linux-gnu
+pkgname=$_target-gdb
+_snapshot=20171231
+pkgver=8.0.v$_snapshot
+pkgrel=1
+pkgdesc='The GNU Debugger for the riscv64 target'
+arch=(x86_64)
+url='https://github.com/riscv/riscv-gnu-toolchain'
+license=(GPL3)
+depends=(xz ncurses expat python guile2.0 gdb-common mpfr)
+makedepends=(git)
+options=(!emptydirs)
+source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
+sha256sums=('SKIP')
+
+prepare() {
+ cd "$srcdir/$_target"
+
+ # fix submodule repo paths
+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
+ # update submodule
+ git submodule update --init riscv-binutils-gdb
+
+ cd riscv-binutils-gdb
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
+}
+
+build() {
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+
+ ./configure \
+ --target=$_target \
+ --prefix=/usr \
+ --enable-languages=c,c++ \
+ --disable-multilib \
+ --with-system-readline \
+ --disable-nls \
+ --with-python=/usr/bin/python3 \
+ --with-guile=guile-2.0 \
+ --with-system-gdbinit=/etc/gdb/gdbinit
+
+ make all-gdb
+}
+
+package() {
+ cd "$srcdir/$_target/riscv-binutils-gdb"
+
+ make DESTDIR="$pkgdir" install-gdb
+
+ # Following files conflict with 'gdb' package
+ rm -r "$pkgdir"/usr/share/info
+ rm -r "$pkgdir"/usr/share/gdb
+ rm -r "$pkgdir"/usr/include/gdb
+ rm -r "$pkgdir"/usr/share/man/man5
+}
diff --git a/pcr/riscv64-linux-gnu-glibc/PKGBUILD b/pcr/riscv64-linux-gnu-glibc/PKGBUILD
new file mode 100644
index 000000000..124836d15
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-glibc/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer (Arch): Anatol Pomozov
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-gnu-glibc
+
+_target=riscv64-linux-gnu
+pkgname=$_target-glibc
+_snapshot=20171231
+pkgver=2.26.v$_snapshot
+pkgrel=1
+pkgdesc="GNU C Library riscv64 target"
+arch=(any)
+url='https://github.com/riscv/riscv-gnu-toolchain'
+license=('GPL' 'LGPL')
+depends=($_target-gcc $_target-linux-api-headers)
+makedepends=(git)
+options=(!buildflags !strip staticlibs)
+source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
+sha256sums=('SKIP')
+
+prepare() {
+ mkdir -p glibc-build
+
+ cd "$srcdir/$_target"
+
+ # fix submodule repo paths
+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
+ # update submodule
+ git submodule update --init riscv-glibc
+}
+
+build() {
+ cd glibc-build
+
+ echo "slibdir=/lib" >> configparms
+ echo "rtlddir=/lib" >> configparms
+ echo "sbindir=/bin" >> configparms
+ echo "rootsbindir=/bin" >> configparms
+
+ unset LD_LIBRARY_PATH
+
+ export BUILD_CC=gcc
+ export CC=${_target}-gcc
+ export CXX=${_target}-g++
+ export AR=${_target}-ar
+ export RANLIB=${_target}-ranlib
+
+ ../$_target/riscv-glibc/configure \
+ --prefix=/usr \
+ --target=$_target \
+ --host=$_target \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/lib \
+ --disable-werror \
+ --enable-shared \
+ --enable-obsolete-rpc \
+ --with-headers=/usr/$_target/include \
+ --disable-multilib \
+ --enable-kernel=3.0.0
+
+ echo "build-programs=no" >> configparms
+ make
+}
+
+package() {
+ cd glibc-build
+
+ make install_root=$pkgdir/usr/$_target install
+
+ rm -rf $pkgdir/usr/$_target/{bin,sbin,etc,share,var}
+}
diff --git a/pcr/riscv64-linux-gnu-linux-libre-api-headers/PKGBUILD b/pcr/riscv64-linux-gnu-linux-libre-api-headers/PKGBUILD
new file mode 100644
index 000000000..df6068925
--- /dev/null
+++ b/pcr/riscv64-linux-gnu-linux-libre-api-headers/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: David P. <megver83@parabola.nu>
+# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Andreas Grapentin <andreas@grapentin.org>
+
+# parabola changes and rationale:
+# - adapted from aarch64-linux-libre-gnu-binutils
+
+_target_arch=riscv
+_target=riscv64-linux-gnu
+pkgname=$_target-linux-libre-api-headers
+_pkgver=4.15-gnu
+
+_archpkgver=${_pkgver%-*}
+pkgver=${_pkgver//-/_}
+pkgrel=1
+pkgdesc="Kernel headers sanitized for use in userspace ($_target)"
+arch=(any)
+url='https://linux-libre.fsfla.org'
+license=(GPL2)
+provides=("$_target-linux-api-headers=${_archpkgver}")
+conflicts=("$_target-linux-api-headers")
+replaces=("$_target-linux-api-headers")
+source=("https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgver}/linux-libre-${_pkgver}.tar.xz"{,.sign})
+sha512sums=('a55cc663c6fb1e1cfa7905282b368b5d5888bc2398f0acf37e5bb9a232ded04fd566b1980e654da26aaec005332e458581495184d6bd4cec669181085d4d78a5'
+ 'SKIP')
+validpgpkeys=('474402C8C582DAFBE389C427BCB7CF877E7D47A7') # Alexandre Oliva
+
+build() {
+ cd linux-$_archpkgver
+
+ make ARCH=$_target_arch mrproper
+ make ARCH=$_target_arch headers_check
+}
+
+package() {
+ cd linux-$_archpkgver
+
+ make INSTALL_HDR_PATH="$pkgdir/usr/$_target/" ARCH=$_target_arch V=0 headers_install
+
+ # clean-up unnecessary files generated during install
+ find "$pkgdir" \( -name .install -or -name ..install.cmd \) -delete
+}