summaryrefslogtreecommitdiff
path: root/src/stage1
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-22 10:38:14 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-22 10:38:14 +0100
commite5c45a1eb29278793cbcfb56fa1e5a335f39f719 (patch)
tree6df57af71fecaa3b826a7f0b16360aaad4c88b3d /src/stage1
parent3564366f5f5b48573b5861a56ff32cf18b5e3dcf (diff)
almost there - 16pkges to go
Diffstat (limited to 'src/stage1')
-rw-r--r--src/stage1/build_from_deptree.sh2
-rw-r--r--src/stage1/create_makepkg.sh5
-rw-r--r--src/stage1/create_package_tree.sh33
-rw-r--r--src/stage1/patches/ca-certificates-mozilla.patch0
-rw-r--r--src/stage1/patches/coreutils.patch10
-rw-r--r--src/stage1/patches/cryptsetup.patch10
-rw-r--r--src/stage1/patches/dbus.patch10
-rw-r--r--src/stage1/patches/device-mapper.patch28
-rw-r--r--src/stage1/patches/e2fsprogs.patch10
-rw-r--r--src/stage1/patches/fakeroot.patch20
-rw-r--r--src/stage1/patches/filesystem.patch14
-rw-r--r--src/stage1/patches/gc.patch11
-rw-r--r--src/stage1/patches/gcc-libs.patch26
-rw-r--r--src/stage1/patches/gettext.patch11
-rw-r--r--src/stage1/patches/glib2.patch51
-rw-r--r--src/stage1/patches/glibc.patch73
-rw-r--r--src/stage1/patches/gnutls.patch11
-rw-r--r--src/stage1/patches/gobject-introspection-runtime.patch11
-rw-r--r--src/stage1/patches/guile.patch13
-rw-r--r--src/stage1/patches/inetutils.patch10
-rw-r--r--src/stage1/patches/iputils.patch28
-rw-r--r--src/stage1/patches/kbd.patch11
-rw-r--r--src/stage1/patches/libassuan.patch11
-rw-r--r--src/stage1/patches/libatomic_ops.patch36
-rw-r--r--src/stage1/patches/libffi.patch7
-rw-r--r--src/stage1/patches/libgcrypt.patch10
-rw-r--r--src/stage1/patches/libgpg-error.patch48
-rw-r--r--src/stage1/patches/libksba.patch11
-rw-r--r--src/stage1/patches/libldap.patch20
-rw-r--r--src/stage1/patches/libsasl.patch18
-rw-r--r--src/stage1/patches/libseccomp.patch5
-rw-r--r--src/stage1/patches/libsecret.patch21
l---------src/stage1/patches/libsystemd-standalone.patch1
l---------src/stage1/patches/libsystemd.patch1
-rw-r--r--src/stage1/patches/libtirpc.patch20
l---------src/stage1/patches/libudev.patch1
-rw-r--r--src/stage1/patches/libusb.patch13
l---------src/stage1/patches/libutil-linux.patch1
-rw-r--r--src/stage1/patches/make.patch12
-rw-r--r--src/stage1/patches/man-db.patch10
l---------src/stage1/patches/nss-myhostname.patch1
l---------src/stage1/patches/nss-mymachines.patch1
l---------src/stage1/patches/nss-resolve.patch1
l---------src/stage1/patches/nss-systemd.patch1
-rw-r--r--src/stage1/patches/pam.patch28
-rw-r--r--src/stage1/patches/pkg-config.patch11
-rw-r--r--src/stage1/patches/shadow.patch61
-rw-r--r--src/stage1/patches/systemd.patch89
-rw-r--r--src/stage1/patches/unixodbc.patch13
-rw-r--r--src/stage1/patches/util-linux.patch38
50 files changed, 795 insertions, 93 deletions
diff --git a/src/stage1/build_from_deptree.sh b/src/stage1/build_from_deptree.sh
index 4f0c315..20f23f7 100644
--- a/src/stage1/build_from_deptree.sh
+++ b/src/stage1/build_from_deptree.sh
@@ -101,7 +101,7 @@ while [ -s "$_deptree" ]; do
rm -rf "$_chrootdir"/packages/$_arch/repo.{db,files}*
repo-add -q -R "$_chrootdir"/packages/$_arch/{repo.db.tar.gz,*.pkg.tar.xz}
(yes || true) | pacman --noscriptlet --config "$_chrootdir"/etc/pacman.conf \
- -r "$_chrootdir" -Syy $_pkgname
+ -r "$_chrootdir" -Syydd $_pkgname
# remove pkg from deptree
sed -i "/^$_pkgname :/d; s/ $_pkgname\b//g" "$_deptree"
diff --git a/src/stage1/create_makepkg.sh b/src/stage1/create_makepkg.sh
index eb49ed1..16748c3 100644
--- a/src/stage1/create_makepkg.sh
+++ b/src/stage1/create_makepkg.sh
@@ -46,7 +46,6 @@ if [ ! -f "$_makepkgdir"/makepkg-$_arch.sh ]; then
fi
# create temporary makepkg.conf
-# note that we disable stripping because it tends to break static libraries
cat > "$_makepkgdir"/makepkg-$_arch.conf << EOF
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
@@ -60,8 +59,8 @@ VCSCLIENTS=('bzr::bzr'
CARCH="$_arch"
CHOST="$_target"
CPPFLAGS="-D_FORTIFY_SOURCE=2"
-CFLAGS="-O2 -pipe -fstack-protector-strong -fno-plt"
-CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-plt"
+CFLAGS="$_archflags -O2 -pipe -fstack-protector-strong -fno-plt"
+CXXFLAGS="$_archflags -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
diff --git a/src/stage1/create_package_tree.sh b/src/stage1/create_package_tree.sh
index dab9221..d52a27f 100644
--- a/src/stage1/create_package_tree.sh
+++ b/src/stage1/create_package_tree.sh
@@ -26,10 +26,7 @@ if [ ! -f "$_deptree" ]; then
declare -A _tree
# remove a couple painful things from base we don't need for stage1
- _frontier=($(pacman -Sg $_groups | awk '{print $2}' \
- | grep -v lvm2 \
- | grep -v mdadm \
- | grep -v pciutils))
+ _frontier=($(pacman -Sg $_groups | awk '{print $2}'))
while [ ${#_frontier[@]} -gt 0 ]; do
# pop pkg from frontier
@@ -57,25 +54,29 @@ if [ ! -f "$_deptree" ]; then
_tree[gcc-libs]="${_tree[gcc-libs]} libmpc mpfr gmp"
_tree[gmp]="${_tree[gmp]/gcc-libs}"
_tree[gmp]="${_tree[gmp]/bash}"
- # building libpsl requires publisuffix-list in sysroot
+ # resolve pam dependency cycle
+ _tree[libtirpc]="${_tree[libtirpc]/krb5}"
+ # building libcap needs pam and unixodbc in sysroot
+ _tree[libcap]="${_tree[libcap]} pam unixodbc"
+ _tree[unixodbc]=" readline libtool"
+ # building libpsl requires publicsuffix-list in sysroot
_tree[libpsl]="${_tree[libpsl]} publicsuffix-list"
_tree[publicsuffix-list]=""
- # building libcap needs pam in sysroot
- _tree[libcap]="${_tree[libcap]} pam"
# building libutil-linux needs the same stuff as util-linux
_tree[libutil-linux]="${_tree[util-linux]/libutil-linux}"
# building sqlite requires tcl in sysroot
_tree[sqlite]="${_tree[sqlite]} tcl"
_tree[tcl]=" zlib"
- # building libsasl requires libldap
- _tree[libsasl]="${_tree[libsasl]} libldap"
- _tree[libldap]="${_tree[libldap]/libsasl}"
-
- # TODO: these do weird things when cross compiling
- _tree[libatomic_ops]="${_tree[libatomic_ops]} FIXME"
- _tree[libseccomp]="${_tree[libseccomp]} FIXME"
- _tree[libffi]="${_tree[libffi]} FIXME"
- _tree[libgpg-error]="${_tree[libgpg-error]} FIXME"
+ # building libsecret required gobject-introspection-runtime in sysroot
+ #_tree[libsecret]="${_tree[libsecret]} gobject-introspection-runtime"
+ #_tree[gobject-introspection-runtime]=" glib2"
+ # we build stage1 make without guile
+ _tree[make]="${_tree[make]/guile}"
+ unset _tree[guile]
+ unset _tree[gc]
+ # resolve systemd dependency situation
+ _tree[libutil-linux]="${_tree[libutil-linux]/libsystemd}"
+ _tree[util-linux]="${_tree[util-linux]/libsystemd}"
# write package dependency tree
truncate -s0 "$_deptree".FULL
diff --git a/src/stage1/patches/ca-certificates-mozilla.patch b/src/stage1/patches/ca-certificates-mozilla.patch
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/stage1/patches/ca-certificates-mozilla.patch
diff --git a/src/stage1/patches/coreutils.patch b/src/stage1/patches/coreutils.patch
new file mode 100644
index 0000000..8e497f7
--- /dev/null
+++ b/src/stage1/patches/coreutils.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-21 19:08:59.405457046 +0100
++++ b/PKGBUILD 2018-02-21 19:09:17.544717891 +0100
+@@ -34,6 +34,7 @@ prepare() {
+ build() {
+ cd $pkgname-$pkgver
+ ./configure \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --with-openssl \
diff --git a/src/stage1/patches/cryptsetup.patch b/src/stage1/patches/cryptsetup.patch
new file mode 100644
index 0000000..001145a
--- /dev/null
+++ b/src/stage1/patches/cryptsetup.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-21 21:02:19.655165323 +0100
++++ b/PKGBUILD 2018-02-21 21:03:34.912657502 +0100
+@@ -28,6 +28,7 @@ build() {
+ cd "${srcdir}"/$pkgname-${pkgver}
+
+ ./configure \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --enable-libargon2 \
diff --git a/src/stage1/patches/dbus.patch b/src/stage1/patches/dbus.patch
new file mode 100644
index 0000000..389022e
--- /dev/null
+++ b/src/stage1/patches/dbus.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-22 10:25:32.778956705 +0100
++++ b/PKGBUILD 2018-02-22 10:25:46.272000778 +0100
+@@ -40,6 +40,7 @@ prepare() {
+ build() {
+ cd $pkgbase
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --libexecdir=/usr/lib/dbus-1.0 --with-dbus-user=dbus \
+ --with-system-pid-file=/run/dbus/pid \
+ --with-system-socket=/run/dbus/system_bus_socket \
diff --git a/src/stage1/patches/device-mapper.patch b/src/stage1/patches/device-mapper.patch
new file mode 100644
index 0000000..22332f4
--- /dev/null
+++ b/src/stage1/patches/device-mapper.patch
@@ -0,0 +1,28 @@
+--- a/PKGBUILD 2018-02-22 10:27:36.222401768 +0100
++++ b/PKGBUILD 2018-02-22 10:33:51.959185267 +0100
+@@ -27,6 +27,9 @@ sha256sums=('4025a23ec9b15c2cb7486d151c2
+ prepare() {
+ cd LVM2.${pkgver}
+
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > autoconf/config.sub
++
+ # enable lvmetad
+ sed -i 's|use_lvmetad = 0|use_lvmetad = 1|' conf/example.conf.in
+
+@@ -40,6 +43,7 @@ prepare() {
+
+ build() {
+ local CONFIGUREOPTS=(
++ --host=@TARGET@ --build=@BUILDHOST@
+ --prefix=/usr
+ --sbindir=/usr/bin
+ --sysconfdir=/etc
+@@ -67,6 +71,7 @@ build() {
+
+ cd LVM2.${pkgver}
+
++ ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes \
+ ./configure "${CONFIGUREOPTS[@]}" --enable-udev-systemd-background-jobs
+ make
+
diff --git a/src/stage1/patches/e2fsprogs.patch b/src/stage1/patches/e2fsprogs.patch
new file mode 100644
index 0000000..086658a
--- /dev/null
+++ b/src/stage1/patches/e2fsprogs.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-21 21:46:56.529163326 +0100
++++ b/PKGBUILD 2018-02-21 21:47:33.048113095 +0100
+@@ -33,6 +33,7 @@ build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --prefix=/usr \
+ --with-root-prefix="" \
+ --libdir=/usr/lib \
diff --git a/src/stage1/patches/fakeroot.patch b/src/stage1/patches/fakeroot.patch
new file mode 100644
index 0000000..788707b
--- /dev/null
+++ b/src/stage1/patches/fakeroot.patch
@@ -0,0 +1,20 @@
+--- a/PKGBUILD 2018-02-21 21:52:04.800201713 +0100
++++ b/PKGBUILD 2018-02-21 21:53:10.410318949 +0100
+@@ -31,14 +31,15 @@ build() {
+ cd $pkgname-$pkgver
+
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --libdir=/usr/lib/libfakeroot \
+ --disable-static \
+ --with-ipc=sysv
+
+ make
+
+- cd doc
+- po4a -k 0 --rm-backups --variable 'srcdir=../doc/' po4a/po4a.cfg
++ #cd doc
++ #po4a -k 0 --rm-backups --variable 'srcdir=../doc/' po4a/po4a.cfg
+ }
+
+ check() {
diff --git a/src/stage1/patches/filesystem.patch b/src/stage1/patches/filesystem.patch
index e69de29..130c763 100644
--- a/src/stage1/patches/filesystem.patch
+++ b/src/stage1/patches/filesystem.patch
@@ -0,0 +1,14 @@
+--- a/PKGBUILD 2018-02-20 22:53:28.088939649 +0100
++++ b/PKGBUILD 2018-02-21 10:12:21.862501784 +0100
+@@ -103,6 +103,11 @@ package() {
+ ln -s usr/lib lib64
+ ln -s lib usr/lib64
+ }
++ [[ $CARCH = 'riscv64' ]] && {
++ ln -s usr/lib lib64
++ ln -s lib usr/lib64
++ ln -s . usr/lib64/lp64d
++ }
+
+ # add bin symlinks
+ ln -s usr/bin bin
diff --git a/src/stage1/patches/gc.patch b/src/stage1/patches/gc.patch
new file mode 100644
index 0000000..56ba5ff
--- /dev/null
+++ b/src/stage1/patches/gc.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-21 19:36:19.324934269 +0100
++++ b/PKGBUILD 2018-02-21 19:36:34.145999337 +0100
+@@ -19,7 +19,7 @@ prepare() {
+
+ build() {
+ cd ${pkgname}-${pkgver}
+- ./configure --prefix=/usr --enable-cplusplus --disable-static
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --enable-cplusplus --disable-static
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+ }
diff --git a/src/stage1/patches/gcc-libs.patch b/src/stage1/patches/gcc-libs.patch
index af33f10..792a541 100644
--- a/src/stage1/patches/gcc-libs.patch
+++ b/src/stage1/patches/gcc-libs.patch
@@ -1,5 +1,5 @@
---- a/PKGBUILD 2018-02-20 07:33:26.821634820 +0100
-+++ b/PKGBUILD 2018-02-20 08:15:13.516269932 +0100
+--- a/PKGBUILD 2018-02-21 11:24:36.137279640 +0100
++++ b/PKGBUILD 2018-02-21 13:55:40.607963706 +0100
@@ -5,7 +5,7 @@
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
@@ -18,13 +18,19 @@
checkdepends=(dejagnu inetutils)
options=(!emptydirs)
#source=(https://sources.archlinux.org/other/gcc/gcc-${pkgver/+/-}.tar.xz{,.sig}
-@@ -77,16 +77,18 @@ build() {
+@@ -77,16 +77,24 @@ build() {
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
- "$srcdir/gcc/configure" --prefix=/usr \
-+ sed -i 's#export_sym_check="\$gcc_cv_objdump#export_sym_check="@TARGET@-objdump#' $srcdir/gcc/libcc1/configure
++ CFLAGS=${CFLAGS/-march=rv64gc}
++ CFLAGS=${CFLAGS/-mabi=lp64d}
++ CXXFLAGS=${CXXFLAGS/-march=rv64gc}
++ CXXFLAGS=${CXXFLAGS/-mabi=lp64d}
++
++ sed -i 's/gcc_cv_objdump/ac_cv_prog_OBJDUMP/' $srcdir/gcc/libcc1/configure
+ "$srcdir/gcc/configure" --host=@TARGET@ --build=@BUILDHOST@ --target=@TARGET@ --prefix=/usr \
++ --with-arch=rv64gc --with-api=lp64d \
+ --disable-bootstrap \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
@@ -40,7 +46,7 @@
--with-system-zlib \
--with-isl \
--enable-__cxa_atexit \
-@@ -101,7 +103,7 @@ build() {
+@@ -101,7 +109,7 @@ build() {
--enable-install-libiberty \
--with-linker-hash-style=gnu \
--enable-gnu-indirect-function \
@@ -49,7 +55,7 @@
--disable-werror \
--enable-checking=release \
--enable-default-pie \
-@@ -134,32 +136,19 @@ package_gcc-libs() {
+@@ -134,32 +142,19 @@ package_gcc-libs() {
rm -f "$pkgdir/$_libdir/libgcc_eh.a"
for lib in libatomic \
@@ -83,7 +89,7 @@
# Install Runtime Library Exception
install -Dm644 "$srcdir/gcc/COPYING.RUNTIME" \
"$pkgdir/usr/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION"
-@@ -169,7 +158,6 @@ package_gcc() {
+@@ -169,7 +164,6 @@ package_gcc() {
pkgdesc="The GNU Compiler Collection - C and C++ frontends"
depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.28' libmpc)
groups=('base-devel')
@@ -91,7 +97,7 @@
provides=($pkgname-multilib)
replaces=($pkgname-multilib)
options+=(staticlibs)
-@@ -183,22 +171,18 @@ package_gcc() {
+@@ -183,22 +177,18 @@ package_gcc() {
install -m755 -t "$pkgdir/${_libdir}/" gcc/{cc1,cc1plus,collect2,lto1}
make -C $CHOST/libgcc DESTDIR="$pkgdir" install
@@ -116,7 +122,7 @@
make DESTDIR="$pkgdir" install-fixincludes
make -C gcc DESTDIR="$pkgdir" install-mkheaders
-@@ -208,26 +192,13 @@ package_gcc() {
+@@ -208,26 +198,13 @@ package_gcc() {
ln -s /${_libdir}/liblto_plugin.so \
"$pkgdir/usr/lib/bfd-plugins/"
@@ -143,7 +149,7 @@
make -C libcpp DESTDIR="$pkgdir" install
make -C gcc DESTDIR="$pkgdir" install-po
-@@ -239,147 +210,8 @@ package_gcc() {
+@@ -239,147 +216,8 @@ package_gcc() {
install -Dm755 "$srcdir/c89" "$pkgdir/usr/bin/c89"
install -Dm755 "$srcdir/c99" "$pkgdir/usr/bin/c99"
diff --git a/src/stage1/patches/gettext.patch b/src/stage1/patches/gettext.patch
new file mode 100644
index 0000000..6d62304
--- /dev/null
+++ b/src/stage1/patches/gettext.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-21 22:25:46.093110223 +0100
++++ b/PKGBUILD 2018-02-21 22:26:15.874439771 +0100
+@@ -17,7 +17,7 @@ validpgpkeys=('462225C3B46F34879FC8496CD
+
+ build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/glib2.patch b/src/stage1/patches/glib2.patch
new file mode 100644
index 0000000..3a9d4dc
--- /dev/null
+++ b/src/stage1/patches/glib2.patch
@@ -0,0 +1,51 @@
+--- a/PKGBUILD 2018-02-21 21:54:28.027494092 +0100
++++ b/PKGBUILD 2018-02-21 22:13:00.992257732 +0100
+@@ -2,7 +2,7 @@
+ # Maintainer: Jan de Groot <jgc@archlinux.org>
+
+ pkgbase=glib2
+-pkgname=(glib2 glib2-docs)
++pkgname=(glib2)
+ pkgver=2.54.3+2+g94b38beff
+ pkgrel=1
+ pkgdesc="Low level core library"
+@@ -40,13 +40,18 @@ prepare() {
+
+ build() {
+ cd glib
++ cat > config.cache << EOF
++glib_cv_stack_grows=no
++glib_cv_uscore=no
++EOF
+ ./configure \
++ --host=@TARGET@ --build=@BUILDHOST@ \
++ --cache-file=config.cache \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --sysconfdir=/etc \
+ --with-pcre=system \
+ --enable-debug=yes \
+- --enable-gtk-doc \
+ --disable-fam
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+@@ -60,19 +65,6 @@ check() {
+ package_glib2() {
+ cd glib
+ make DESTDIR="$pkgdir" install
+- mv "$pkgdir/usr/share/gtk-doc" "$srcdir"
+
+ install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 ../*.hook
+ }
+-
+-package_glib2-docs() {
+- pkgdesc="Documentation for GLib"
+- depends=()
+- optdepends=()
+- license+=(custom)
+-
+- mkdir -p "$pkgdir/usr/share"
+- mv gtk-doc "$pkgdir/usr/share"
+-
+- install -Dt "$pkgdir/usr/share/licenses/glib2-docs" -m644 glib/docs/reference/COPYING
+-}
diff --git a/src/stage1/patches/glibc.patch b/src/stage1/patches/glibc.patch
index b84941a..79a24c4 100644
--- a/src/stage1/patches/glibc.patch
+++ b/src/stage1/patches/glibc.patch
@@ -1,48 +1,43 @@
---- a/PKGBUILD 2018-02-14 14:48:10.984568398 +0100
-+++ b/PKGBUILD 2018-02-14 14:48:49.988404621 +0100
+--- a/PKGBUILD 2018-02-21 10:54:25.542580179 +0100
++++ b/PKGBUILD 2018-02-21 11:05:05.742063167 +0100
@@ -6,16 +6,16 @@
# NOTE: valgrind requires rebuilt with each major glibc version
pkgbase=glibc
-pkgname=(glibc lib32-glibc)
+-pkgver=2.26
+-pkgrel=11
+pkgname=(glibc)
- pkgver=2.26
- pkgrel=11
++pkgver=2.27
++pkgrel=1
arch=(x86_64)
url='http://www.gnu.org/software/libc'
license=(GPL LGPL)
-makedepends=(git gd lib32-gcc-libs)
-+makedepends=(git)
++makedepends=(git gd)
options=(!strip staticlibs)
--_commit=de51f431ed6226ec68ca76e578f2cbd55b6262cb
+ _commit=de51f431ed6226ec68ca76e578f2cbd55b6262cb
-source=(git+https://sourceware.org/git/glibc.git#commit=${_commit}
-+_snapshot=20171231
-+source=(git+https://github.com/riscv/riscv-gnu-toolchain#tag=v${_snapshot}
++source=(git+https://sourceware.org/git/glibc.git#tag=glibc-$pkgver
locale.gen.txt
locale-gen
lib32-glibc.conf
-@@ -29,7 +29,14 @@ md5sums=('SKIP'
+@@ -27,7 +27,7 @@ md5sums=('SKIP'
+ 'dc0d3ad59aeaaf591b085a77de6e03e9')
+
prepare() {
- mkdir -p glibc-build lib32-glibc-build
+- mkdir -p glibc-build lib32-glibc-build
++ mkdir -p glibc-build
-- cd glibc
-+ cd riscv-gnu-toolchain
-+
-+ # fix submodule repo paths
-+ sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
-+ # update submodule
-+ git submodule update --init riscv-glibc
-+
-+ cd riscv-glibc
+ cd glibc
- local i; for i in ${source[@]}; do
- case ${i%::*} in
-@@ -44,12 +51,12 @@ prepare() {
+@@ -44,12 +44,13 @@ prepare() {
build() {
local _configure_flags=(
--prefix=/usr
- --with-headers=/usr/include
-+ --with-headers=/usr/@TARGET@/include
++ --host=@TARGET@ --build=@BUILDHOST@
++ --with-headers=@SYSROOT@/usr/include
--with-bugurl=https://bugs.archlinux.org/
--enable-add-ons
--enable-bind-now
@@ -52,17 +47,7 @@
--enable-obsolete-nsl
--enable-obsolete-rpc
--enable-stack-protector=strong
-@@ -68,7 +75,8 @@ build() {
- # remove fortify for building libraries
- CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
-
-- "$srcdir/glibc/configure" \
-+ "$srcdir/riscv-gnu-toolchain/riscv-glibc/configure" \
-+ --host=@TARGET@ --build=@BUILDHOST@ \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
- ${_configure_flags[@]}
-@@ -83,38 +91,6 @@ build() {
+@@ -83,38 +84,6 @@ build() {
echo "CC += -D_FORTIFY_SOURCE=2" >> configparms
echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms
make
@@ -101,25 +86,7 @@
}
check() {
-@@ -143,7 +119,7 @@ package_glibc() {
- make -C glibc-build install_root="$pkgdir" install
- rm -f "$pkgdir"/etc/ld.so.{cache,conf}
-
-- cd glibc
-+ cd riscv-gnu-toolchain/riscv-glibc
-
- install -dm755 "$pkgdir"/usr/lib/{locale,systemd/system,tmpfiles.d}
- install -m644 nscd/nscd.conf "$pkgdir/etc/nscd.conf"
-@@ -158,7 +134,7 @@ package_glibc() {
- # create /etc/locale.gen
- install -m644 "$srcdir/locale.gen.txt" "$pkgdir/etc/locale.gen"
- sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
-- "$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
-+ "$srcdir/riscv-gnu-toolchain/riscv-glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
-
- # Do not strip the following files for improved debugging support
- # ("improved" as in not breaking gdb and valgrind...):
-@@ -169,56 +145,20 @@ package_glibc() {
+@@ -169,56 +138,20 @@ package_glibc() {
if check_option 'debug' n; then
cd "$pkgdir"
diff --git a/src/stage1/patches/gnutls.patch b/src/stage1/patches/gnutls.patch
new file mode 100644
index 0000000..061bb81
--- /dev/null
+++ b/src/stage1/patches/gnutls.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-21 15:03:51.826746352 +0100
++++ b/PKGBUILD 2018-02-21 15:11:06.745631750 +0100
+@@ -34,6 +34,8 @@ build() {
+ # http://lists.gnupg.org/pipermail/gnutls-devel/2015-May/007582.html
+
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
++ --with-libunistring-prefix=@SYSROOT@/usr \
+ --with-zlib \
+ --disable-static \
+ --without-idn \
diff --git a/src/stage1/patches/gobject-introspection-runtime.patch b/src/stage1/patches/gobject-introspection-runtime.patch
new file mode 100644
index 0000000..7b0dae4
--- /dev/null
+++ b/src/stage1/patches/gobject-introspection-runtime.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-22 08:44:15.636283407 +0100
++++ b/PKGBUILD 2018-02-22 08:45:01.928254941 +0100
+@@ -28,7 +28,7 @@ prepare() {
+
+ build() {
+ cd $pkgbase
+- ./configure --prefix=/usr --disable-static --enable-doctool --enable-gtk-doc
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --disable-static --disable-doctool --disable-gtk-doc
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+ }
diff --git a/src/stage1/patches/guile.patch b/src/stage1/patches/guile.patch
new file mode 100644
index 0000000..3b6a039
--- /dev/null
+++ b/src/stage1/patches/guile.patch
@@ -0,0 +1,13 @@
+--- a/PKGBUILD 2018-02-21 19:43:16.351151414 +0100
++++ b/PKGBUILD 2018-02-21 20:12:32.677790467 +0100
+@@ -21,6 +21,10 @@ sha256sums=('87ee07caef33c97ddc74bf3c29c
+ build() {
+ cd $pkgname-$pkgver
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
++ --with-libltdl-prefix=/usr/@TARGET@/usr \
++ --with-libgmp-prefix=/usr/riscv64-linux-gun/usr \
++ --with-libunistring-prefix=/usr/@TARGET@/usr \
+ --disable-static \
+ --disable-error-on-warning
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
diff --git a/src/stage1/patches/inetutils.patch b/src/stage1/patches/inetutils.patch
new file mode 100644
index 0000000..6dbea56
--- /dev/null
+++ b/src/stage1/patches/inetutils.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-21 19:11:52.847881134 +0100
++++ b/PKGBUILD 2018-02-21 19:12:06.357064054 +0100
+@@ -42,6 +42,7 @@ validpgpkeys=('4FBD67621082C4C502448E3B1
+ build() {
+ cd ${pkgname}-${pkgver}
+ ./configure --prefix=/usr --libexec=/usr/bin \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --localstatedir=/var --sysconfdir=/etc \
+ --without-wrap --with-pam \
+ --enable-ftp --enable-ftpd \
diff --git a/src/stage1/patches/iputils.patch b/src/stage1/patches/iputils.patch
new file mode 100644
index 0000000..c7a2f99
--- /dev/null
+++ b/src/stage1/patches/iputils.patch
@@ -0,0 +1,28 @@
+--- a/PKGBUILD 2018-02-21 19:19:53.058846708 +0100
++++ b/PKGBUILD 2018-02-21 19:25:13.491197185 +0100
+@@ -28,10 +28,11 @@ sha1sums=('SKIP'
+ build() {
+ cd "${srcdir}/${pkgname}"
+
++ CC=@TARGET@-gcc \
+ make USE_NETTLE=no USE_GNUTLS=no CCOPTOPT="$CFLAGS"
+ # fix perl-sgmls
+ sed -i -e 's#sgmlspl#sgmlspl.pl#g' "${srcdir}/${pkgname}/doc/Makefile"
+- make -C doc man
++ #make -C doc man
+ }
+
+ package() {
+@@ -41,9 +42,9 @@ package() {
+
+ install -m755 arping clockdiff ping rarpd rdisc tftpd tracepath "${pkgdir}"/usr/bin/
+
+- install -dm755 "${pkgdir}"/usr/share/man/man8
+- install -m644 doc/{arping,clockdiff,ping,rarpd,rdisc,tftpd,tracepath}.8 \
+- "${pkgdir}"/usr/share/man/man8/
++ #install -dm755 "${pkgdir}"/usr/share/man/man8
++ #install -m644 doc/{arping,clockdiff,ping,rarpd,rdisc,tftpd,tracepath}.8 \
++ # "${pkgdir}"/usr/share/man/man8/
+
+ # FS#24768
+ install -dm755 "${pkgdir}"/etc/xinetd.d/
diff --git a/src/stage1/patches/kbd.patch b/src/stage1/patches/kbd.patch
new file mode 100644
index 0000000..ee02fb0
--- /dev/null
+++ b/src/stage1/patches/kbd.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-21 18:41:17.141706035 +0100
++++ b/PKGBUILD 2018-02-21 18:41:43.627843941 +0100
+@@ -38,7 +38,7 @@ prepare() {
+
+ build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+- ./configure --prefix=/usr --datadir=/usr/share/kbd --mandir=/usr/share/man
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --datadir=/usr/share/kbd --mandir=/usr/share/man
+ make KEYCODES_PROGS=yes RESIZECONS_PROGS=yes
+ }
+
diff --git a/src/stage1/patches/libassuan.patch b/src/stage1/patches/libassuan.patch
new file mode 100644
index 0000000..11fe396
--- /dev/null
+++ b/src/stage1/patches/libassuan.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-22 08:47:40.952261927 +0100
++++ b/PKGBUILD 2018-02-22 08:47:59.137271654 +0100
+@@ -17,7 +17,7 @@ sha256sums=('47f96c37b4f2aac289f0bc1bacf
+
+ build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/libatomic_ops.patch b/src/stage1/patches/libatomic_ops.patch
new file mode 100644
index 0000000..7c832a6
--- /dev/null
+++ b/src/stage1/patches/libatomic_ops.patch
@@ -0,0 +1,36 @@
+--- a/PKGBUILD 2018-02-21 19:30:29.308880981 +0100
++++ b/PKGBUILD 2018-02-21 19:35:16.578673882 +0100
+@@ -14,26 +14,27 @@ url='https://github.com/ivmai/libatomic_
+ depends=(glibc)
+ license=(GPL2 MIT)
+ options=(!docs)
+-source=($url/releases/download/v$pkgver/${pkgname}-${pkgver}.tar.gz)
++source=("git+https://github.com/ivmai/libatomic_ops.git#commit=393d7a7ff54565230f44e59a9c73addc9e627f56")
+ sha256sums=('219724edad3d580d4d37b22e1d7cb52f0006d282d26a9b8681b560a625142ee6')
+
+ prepare() {
+- cd $pkgname-$pkgver
++ cd $pkgname
+ }
+
+ build() {
+- cd $pkgname-$pkgver
+- ./configure --prefix=/usr --disable-static --enable-shared
++ cd $pkgname
++ autoreconf --install
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --disable-static --enable-shared
+ make
+ }
+
+ check() {
+- cd $pkgname-$pkgver
++ cd $pkgname
+ make check
+ }
+
+ package() {
+- cd $pkgname-$pkgver
++ cd $pkgname
+ make DESTDIR="$pkgdir" install
+ install -Dm644 doc/LICENSING.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ }
diff --git a/src/stage1/patches/libffi.patch b/src/stage1/patches/libffi.patch
index f0e777e..6fdbda7 100644
--- a/src/stage1/patches/libffi.patch
+++ b/src/stage1/patches/libffi.patch
@@ -1,5 +1,5 @@
---- a/PKGBUILD 2018-02-15 08:27:03.495301696 +0100
-+++ b/PKGBUILD 2018-02-15 08:28:25.326381705 +0100
+--- a/PKGBUILD 2018-02-20 22:35:38.140743909 +0100
++++ b/PKGBUILD 2018-02-20 22:37:37.399728944 +0100
@@ -4,30 +4,32 @@
# Contributor: Jan de Groot <jgc@archlinux.org>
@@ -21,11 +21,12 @@
build() {
- cd $pkgname-$pkgver
- ./configure --prefix=/usr --disable-static \
+- --enable-pax_emutramp
+ cd riscv-libffi/libffi-3.1
+ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
+ > config.sub
+ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --disable-static \
- --enable-pax_emutramp
++ --enable-pax_emutramp CPPFLAGS="-D__riscv64 $CPPFLAGS"
make
}
diff --git a/src/stage1/patches/libgcrypt.patch b/src/stage1/patches/libgcrypt.patch
new file mode 100644
index 0000000..0d01736
--- /dev/null
+++ b/src/stage1/patches/libgcrypt.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-22 08:29:13.484044489 +0100
++++ b/PKGBUILD 2018-02-22 08:29:33.980655617 +0100
+@@ -37,6 +37,7 @@ prepare() {
+ build() {
+ cd ${pkgname}-${pkgver}
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --disable-static \
+ --disable-padlock-support
+ make
diff --git a/src/stage1/patches/libgpg-error.patch b/src/stage1/patches/libgpg-error.patch
index 603c093..11c4fa8 100644
--- a/src/stage1/patches/libgpg-error.patch
+++ b/src/stage1/patches/libgpg-error.patch
@@ -1,11 +1,53 @@
---- a/PKGBUILD 2018-02-20 09:22:44.020330630 +0100
-+++ b/PKGBUILD 2018-02-20 09:23:03.883548285 +0100
-@@ -19,7 +19,7 @@ validpgpkeys=('D8692123C4065DEA5E0F3AB52
+--- a/PKGBUILD 2018-02-22 08:03:14.564663999 +0100
++++ b/PKGBUILD 2018-02-22 08:26:37.783659199 +0100
+@@ -10,16 +10,19 @@ arch=(x86_64)
+ url="https://www.gnupg.org"
+ license=('LGPL')
+ depends=('glibc' 'sh')
+-source=(ftp://ftp.gnupg.org/gcrypt/libgpg-error/${pkgname}-${pkgver}.tar.bz2{,.sig})
++source=(ftp://ftp.gnupg.org/gcrypt/libgpg-error/${pkgname}-${pkgver}.tar.bz2{,.sig}
++ lock-obj-pub.riscv64-unknown-linux-gnu.h)
+ #ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/libgpg-error/${pkgname}-${pkgver}.tar.bz2)
+ # https://www.gnupg.org/download/integrity_check.html
+ sha1sums=('a428758999ff573e62d06892e3d2c0b0f335787c'
+- 'SKIP')
++ 'SKIP'
++ 'e7a718fdcca098d2ae5331313aef59b2d3031929')
+ validpgpkeys=('D8692123C4065DEA5E0F3AB5249B39D24F25E3B6' # Werner Koch
'031EC2536E580D8EA286A9F22071B08A33BD3F06') # NIIBE Yutaka (GnuPG Release Key) <gniibe@fsij.org>
build() {
cd ${pkgname}-${pkgver}
- ./configure --prefix=/usr
++ cp ${srcdir}/lock-obj-pub.riscv64-unknown-linux-gnu.h src/syscfg/
+ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
make
}
+--- /dev/null 2018-02-17 13:03:10.829324204 +0100
++++ b/lock-obj-pub.riscv64-unknown-linux-gnu.h 2018-02-22 08:24:44.383181745 +0100
+@@ -0,0 +1,25 @@
++## lock-obj-pub.riscv64-unknown-linux-gnu.h
++## File created by gen-posix-lock-obj - DO NOT EDIT
++## To be included by mkheader into gpg-error.h
++
++typedef struct
++{
++ long _vers;
++ union {
++ volatile char _priv[40];
++ long _x_align;
++ long *_xp_align;
++ } u;
++} gpgrt_lock_t;
++
++#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0, \
++ 0,0,0,0,0,0,0,0}}}
++##
++## Local Variables:
++## mode: c
++## buffer-read-only: t
++## End:
++##
diff --git a/src/stage1/patches/libksba.patch b/src/stage1/patches/libksba.patch
new file mode 100644
index 0000000..e82daa5
--- /dev/null
+++ b/src/stage1/patches/libksba.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-22 08:48:42.189301069 +0100
++++ b/PKGBUILD 2018-02-22 08:49:09.748324230 +0100
+@@ -16,7 +16,7 @@ sha1sums=('a98385734a0c3f5b713198e8d6e6e
+ validpgpkeys=('D8692123C4065DEA5E0F3AB5249B39D24F25E3B6') # Werner Koch
+ build() {
+ cd $srcdir/$pkgname-$pkgver
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/libldap.patch b/src/stage1/patches/libldap.patch
new file mode 100644
index 0000000..60168b8
--- /dev/null
+++ b/src/stage1/patches/libldap.patch
@@ -0,0 +1,20 @@
+--- a/PKGBUILD 2018-02-21 16:10:41.962839612 +0100
++++ b/PKGBUILD 2018-02-21 17:05:20.371247141 +0100
+@@ -26,6 +26,8 @@ sha1sums=('c98437385d3eaee80c9e2c09f3f0d
+ prepare() {
+ cd ${pkgbase}-${pkgver}
+ patch -p1 -i "${srcdir}"/openldap-ntlm.patch
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > build/config.sub
+ sed -i 's|-m 644 $(LIBRARY)|-m 755 $(LIBRARY)|' libraries/{liblber,libldap,libldap_r}/Makefile.in
+ sed -i 's|#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi"|#define LDAPI_SOCK LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi"|' include/ldap_defaults.h
+ sed -i 's|%LOCALSTATEDIR%/run|/run/openldap|' servers/slapd/slapd.{conf,ldif}
+@@ -36,6 +38,8 @@ build() {
+ cd ${pkgbase}-${pkgver}
+ autoconf
+ ./configure --prefix=/usr --libexecdir=/usr/lib \
++ --host=@TARGET@ --build=@BUILDHOST@ CC=@TARGET@-gcc \
++ --with-yielding_select=yes \
+ --sysconfdir=/etc --localstatedir=/var/lib/openldap --sbindir=/usr/bin \
+ --enable-dynamic --enable-syslog --enable-ipv6 --enable-local \
+ --enable-crypt --enable-spasswd --enable-modules \
diff --git a/src/stage1/patches/libsasl.patch b/src/stage1/patches/libsasl.patch
index b48d694..711c164 100644
--- a/src/stage1/patches/libsasl.patch
+++ b/src/stage1/patches/libsasl.patch
@@ -1,5 +1,5 @@
---- a/PKGBUILD 2018-02-20 19:33:10.397502335 +0100
-+++ b/PKGBUILD 2018-02-20 19:33:51.535246841 +0100
+--- a/PKGBUILD 2018-02-21 17:27:36.799321403 +0100
++++ b/PKGBUILD 2018-02-21 17:29:23.770185480 +0100
@@ -91,6 +91,7 @@ build() {
popd
@@ -8,3 +8,17 @@
--sbin=/usr/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
+@@ -115,11 +116,11 @@ build() {
+ --with-mysql=/usr \
+ --with-pgsql=/usr/lib \
+ --with-sqlite3=/usr/lib \
+- --enable-ldapdb \
++ --disable-ldapdb \
+ --disable-macos-framework \
+ --with-pam \
+ --with-saslauthd=/var/run/saslauthd \
+- --with-ldap \
++ --without-ldap \
+ --with-dblib=gdbm \
+ --with-configdir=/etc/sasl2:/etc/sasl:/usr/lib/sasl2 \
+ --sysconfdir=/etc \
diff --git a/src/stage1/patches/libseccomp.patch b/src/stage1/patches/libseccomp.patch
index 9dc1a98..8814331 100644
--- a/src/stage1/patches/libseccomp.patch
+++ b/src/stage1/patches/libseccomp.patch
@@ -616,7 +616,7 @@ diff -rupN a/PKGBUILD b/PKGBUILD
'190c6dd821ddad9ee0aefa720a86dd744acd279c095b07f099a7e0e72d1ce543')
prepare() {
-@@ -21,11 +27,16 @@ prepare() {
+@@ -21,11 +27,17 @@ prepare() {
# arch: add the statx syscall
patch -Np1 < "${srcdir}"/0001-arch-add-the-statx-syscall.patch
@@ -630,7 +630,8 @@ diff -rupN a/PKGBUILD b/PKGBUILD
cd $pkgname-$pkgver
- ./configure --prefix=/usr
+ autoreconf
-+ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr \
++ CPPFLAGS="-D__riscv64 $CPPFLAGS"
make
}
diff --git a/src/stage1/patches/libsecret.patch b/src/stage1/patches/libsecret.patch
new file mode 100644
index 0000000..0361db5
--- /dev/null
+++ b/src/stage1/patches/libsecret.patch
@@ -0,0 +1,21 @@
+--- a/PKGBUILD 2018-02-22 08:32:48.289759692 +0100
++++ b/PKGBUILD 2018-02-22 08:42:21.269426289 +0100
+@@ -23,13 +23,16 @@ pkgver() {
+
+ prepare() {
+ cd $pkgname
+- NOCONFIGURE=1 ./autogen.sh
++ sed -i 's/intltool/#&/; s/gtkdocize/#&/' autogen.sh
++ sed -i '/docs/d' configure.ac
++ NOCONFIGURE=1 ./autogen.sh || true
+ }
+
+ build() {
+ cd $pkgname
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+- --disable-static --enable-gtk-doc
++ --host=@TARGET@ --build=@BUILDHOST@ \
++ --disable-static --disable-gtk-doc
+ make
+ }
+
diff --git a/src/stage1/patches/libsystemd-standalone.patch b/src/stage1/patches/libsystemd-standalone.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/libsystemd-standalone.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/libsystemd.patch b/src/stage1/patches/libsystemd.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/libsystemd.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/libtirpc.patch b/src/stage1/patches/libtirpc.patch
new file mode 100644
index 0000000..4f53898
--- /dev/null
+++ b/src/stage1/patches/libtirpc.patch
@@ -0,0 +1,20 @@
+--- a/PKGBUILD 2018-02-21 18:06:57.527211918 +0100
++++ b/PKGBUILD 2018-02-21 18:15:29.193976527 +0100
+@@ -9,7 +9,7 @@ pkgdesc="Transport Independent RPC libra
+ arch=('x86_64')
+ url="http://libtirpc.sourceforge.net/"
+ license=('BSD')
+-depends=('krb5')
++depends=()
+ backup=('etc/netconfig')
+ # git tree: git://linux-nfs.org/~steved/libtirpc
+ source=(http://downloads.sourceforge.net/sourceforge/libtirpc/${pkgname}-${pkgver}.tar.bz2
+@@ -27,7 +27,7 @@ prepare() {
+
+ build() {
+ cd ${pkgname}-${pkgver}
+- ./configure --prefix=/usr --sysconf=/etc
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --disable-gssapi --prefix=/usr --sysconf=/etc
+ make
+ }
+
diff --git a/src/stage1/patches/libudev.patch b/src/stage1/patches/libudev.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/libudev.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/libusb.patch b/src/stage1/patches/libusb.patch
new file mode 100644
index 0000000..d355b10
--- /dev/null
+++ b/src/stage1/patches/libusb.patch
@@ -0,0 +1,13 @@
+--- a/PKGBUILD 2018-02-22 10:23:59.164686376 +0100
++++ b/PKGBUILD 2018-02-22 10:24:42.587803720 +0100
+@@ -19,7 +19,9 @@ md5sums=('1da9ea3c27b3858fa85c5f4466003e
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --prefix=/usr
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > config.sub
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
+ make -j1
+ }
+
diff --git a/src/stage1/patches/libutil-linux.patch b/src/stage1/patches/libutil-linux.patch
new file mode 120000
index 0000000..70ec2ed
--- /dev/null
+++ b/src/stage1/patches/libutil-linux.patch
@@ -0,0 +1 @@
+util-linux.patch \ No newline at end of file
diff --git a/src/stage1/patches/make.patch b/src/stage1/patches/make.patch
new file mode 100644
index 0000000..bd9432a
--- /dev/null
+++ b/src/stage1/patches/make.patch
@@ -0,0 +1,12 @@
+--- a/PKGBUILD 2018-02-21 20:40:30.577039973 +0100
++++ b/PKGBUILD 2018-02-21 20:42:35.027633492 +0100
+@@ -26,7 +26,8 @@ prepare() {
+
+ build() {
+ cd ${pkgname}-${pkgver}
+- ./configure --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --without-guile --prefix=/usr \
++ LDFLAGS="-lc $LDFLAGS"
+ make
+ }
+
diff --git a/src/stage1/patches/man-db.patch b/src/stage1/patches/man-db.patch
new file mode 100644
index 0000000..3d1ca92
--- /dev/null
+++ b/src/stage1/patches/man-db.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-02-20 22:33:07.050415016 +0100
++++ b/PKGBUILD 2018-02-20 22:33:35.982677664 +0100
+@@ -32,6 +32,7 @@ sha512sums=('82e75df32eb8575f47c3f36b5f2
+ build() {
+ cd ${pkgname}-${pkgver}
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib \
diff --git a/src/stage1/patches/nss-myhostname.patch b/src/stage1/patches/nss-myhostname.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/nss-myhostname.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/nss-mymachines.patch b/src/stage1/patches/nss-mymachines.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/nss-mymachines.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/nss-resolve.patch b/src/stage1/patches/nss-resolve.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/nss-resolve.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/nss-systemd.patch b/src/stage1/patches/nss-systemd.patch
new file mode 120000
index 0000000..fc81fda
--- /dev/null
+++ b/src/stage1/patches/nss-systemd.patch
@@ -0,0 +1 @@
+systemd.patch \ No newline at end of file
diff --git a/src/stage1/patches/pam.patch b/src/stage1/patches/pam.patch
new file mode 100644
index 0000000..68330dd
--- /dev/null
+++ b/src/stage1/patches/pam.patch
@@ -0,0 +1,28 @@
+--- a/PKGBUILD 2018-02-21 18:38:07.422735642 +0100
++++ b/PKGBUILD 2018-02-21 18:39:52.272267854 +0100
+@@ -31,11 +31,17 @@ prepare () {
+
+ build() {
+ cd $srcdir/Linux-PAM-$pkgver
+- ./configure --libdir=/usr/lib --sbindir=/usr/bin --disable-db
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > build-aux/config.sub
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --libdir=/usr/lib --sbindir=/usr/bin --disable-db
+ make
+
+ cd $srcdir/pam_unix2-2.9.1
+ # modify flags to build against the pam compiled here, not a system lib.
++ CFLAGS=${CFLAGS/-march=rv64gc}
++ CFLAGS=${CFLAGS/-mabi=lp64d}
++ CXXFLAGS=${CXXFLAGS/-march=rv64gc}
++ CXXFLAGS=${CXXFLAGS/-mabi=lp64d}
+ ./configure \
+ CFLAGS="$CFLAGS -I$srcdir/Linux-PAM-$pkgver/libpam/include/" \
+ LDFLAGS="$LDFLAGS -L$srcdir/Linux-PAM-$pkgver/libpam/.libs/" \
+@@ -64,5 +70,5 @@ package() {
+ chmod +s $pkgdir/usr/bin/unix_chkpwd
+ # remove doc which is not used anymore
+ # FS #40749
+- rm $pkgdir/usr/share/doc/Linux-PAM/sag-pam_userdb.html
++ rm -f $pkgdir/usr/share/doc/Linux-PAM/sag-pam_userdb.html
+ }
diff --git a/src/stage1/patches/pkg-config.patch b/src/stage1/patches/pkg-config.patch
new file mode 100644
index 0000000..3cbd432
--- /dev/null
+++ b/src/stage1/patches/pkg-config.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-02-21 22:16:49.089757092 +0100
++++ b/PKGBUILD 2018-02-21 22:17:09.426104699 +0100
+@@ -22,7 +22,7 @@ validpgpkeys=('6B99CE97F17F48C27F722D710
+
+ build() {
+ cd $pkgname-$pkgver
+- ./configure --build=$CHOST --prefix=/usr
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr
+ make
+ }
+
diff --git a/src/stage1/patches/shadow.patch b/src/stage1/patches/shadow.patch
new file mode 100644
index 0000000..203a1ed
--- /dev/null
+++ b/src/stage1/patches/shadow.patch
@@ -0,0 +1,61 @@
+--- a/PKGBUILD 2018-02-21 18:43:16.017328844 +0100
++++ b/PKGBUILD 2018-02-21 18:54:13.612174923 +0100
+@@ -55,6 +55,8 @@ pkgver() {
+ prepare() {
+ cd "$pkgname"
+
++ sed -i "/SUBDIRS/s/man//g" Makefile.am
++
+ # need to offer these upstream
+ patch -Np1 <"$srcdir/xstrdup.patch"
+ patch -Np1 <"$srcdir/shadow-strncpy-usage.patch"
+@@ -70,12 +72,13 @@ build() {
+
+ ./configure \
+ LIBS="-lcrypt" \
++ --host=@TARGET@ --build=@BUILDHOST@ \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --libdir=/usr/lib \
+ --mandir=/usr/share/man \
+- --enable-man \
++ --disable-man \
+ --sysconfdir=/etc \
+ --with-libpam \
+ --with-group-name-max-length=32 \
+@@ -129,20 +132,20 @@ package() {
+ mv "$pkgdir"/usr/bin/{newgrp,sg}
+
+ # ...and their many man pages
+- find "$pkgdir"/usr/share/man \
+- '(' -name 'chsh.1' -o \
+- -name 'chfn.1' -o \
+- -name 'su.1' -o \
+- -name 'logoutd.8' -o \
+- -name 'login.1' -o \
+- -name 'nologin.8' -o \
+- -name 'vipw.8' -o \
+- -name 'vigr.8' -o \
+- -name 'newgrp.1' ')' \
+- -delete
+- rmdir \
+- "$pkgdir"/usr/share/man/{fi,id,zh_TW}/man1 \
+- "$pkgdir"/usr/share/man/{fi,ko/man8}
++ # find "$pkgdir"/usr/share/man \
++ # '(' -name 'chsh.1' -o \
++ # -name 'chfn.1' -o \
++ # -name 'su.1' -o \
++ # -name 'logoutd.8' -o \
++ # -name 'login.1' -o \
++ # -name 'nologin.8' -o \
++ # -name 'vipw.8' -o \
++ # -name 'vigr.8' -o \
++ # -name 'newgrp.1' ')' \
++ # -delete
++ # rmdir \
++ # "$pkgdir"/usr/share/man/{fi,id,zh_TW}/man1 \
++ # "$pkgdir"/usr/share/man/{fi,ko/man8}
+
+ # move everything else to /usr/bin, because this isn't handled by ./configure
+ mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin
diff --git a/src/stage1/patches/systemd.patch b/src/stage1/patches/systemd.patch
new file mode 100644
index 0000000..431a493
--- /dev/null
+++ b/src/stage1/patches/systemd.patch
@@ -0,0 +1,89 @@
+--- a/PKGBUILD 2018-02-21 21:13:06.562254936 +0100
++++ b/PKGBUILD 2018-02-22 09:32:22.835497788 +0100
+@@ -26,7 +26,6 @@ makedepends=('acl' 'cryptsetup' 'docbook
+ 'meson' 'libseccomp' 'pcre2')
+ makedepends_i686=('gnu-efi-libs')
+ makedepends_x86_64=('gnu-efi-libs')
+-options=('strip')
+ validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4') # Lennart Poettering <lennart@poettering.net>
+ source=('git://github.com/systemd/systemd-stable.git'
+ 'git://github.com/systemd/systemd.git' # pull in for tags, backports & reverts
+@@ -146,10 +145,30 @@ build() {
+ CXXFLAGS+=" -fno-lto"
+ fi
+
++ cat > cross-file << EOF
++[binaries]
++c = '@TARGET@-gcc'
++cpp = '@TARGET@-g++'
++ar = '@TARGET@-ar'
++strip = '@TARGET@-strip'
++pkgconfig = 'pkg-config'
++[host_machine]
++system = 'linux'
++cpu_family = 'riscv64'
++cpu = 'rv64gc'
++endian = 'little'
++EOF
++
+ local meson_options=(
+ -Daudit=false
+ -Dima=false
+ -Dlz4=true
++ -Dlibcryptsetup=false
++ -Dlibiptc=false
++ -Dxkbcommon=false
++ -Dlibcurl=false
++ -Dman=false
++ -Dtests=false
+
+ -Ddbuspolicydir=/usr/share/dbus-1/system.d
+ -Ddefault-dnssec=no
+@@ -166,7 +185,7 @@ build() {
+ meson_options+=(-Dgnuefi=true)
+ fi
+
+- arch-meson "$pkgbase-stable" build "${meson_options[@]}"
++ arch-meson "$pkgbase-stable" build "${meson_options[@]}" --cross-file cross-file
+
+ ninja -C build
+
+@@ -181,28 +200,21 @@ build() {
+ mv -T "$srcdir/dest"/{systemd,libsystemd}/usr/include/systemd
+ mv -T "$srcdir/dest"/{systemd,libsystemd}/usr/lib/pkgconfig/libsystemd.pc
+ mv "$srcdir/dest"/systemd/usr/lib/libsystemd.so* -t "$srcdir/dest"/libsystemd/usr/lib/
+- mv "$srcdir/dest"/systemd/usr/share/man/man3/{SD,sd}* -t "$srcdir/dest"/libsystemd/usr/share/man/man3/
+
+ install -dm755 "$srcdir/dest/libudev"/usr/{lib/pkgconfig,share/man/man3,include}
+ mv -T "$srcdir/dest"/{systemd,libudev}/usr/include/libudev.h
+ mv -T "$srcdir/dest"/{systemd,libudev}/usr/lib/pkgconfig/libudev.pc
+ mv "$srcdir/dest"/systemd/usr/lib/libudev.so* -t "$srcdir/dest"/libudev/usr/lib/
+- mv "$srcdir/dest"/systemd/usr/share/man/man3/*udev* -t "$srcdir/dest"/libudev/usr/share/man/man3/
+
+ local nssmodule
+ for nssmodule in systemd myhostname mymachines resolve; do
+ install -dm755 "$srcdir/dest/nss-$nssmodule"/usr/{lib,share/man/man8}
+- mv -t "$srcdir/dest"/nss-$nssmodule/usr/share/man/man8/ -- \
+- "$srcdir/dest"/systemd/usr/share/man/man8/nss-$nssmodule.8 \
+- "$srcdir/dest"/systemd/usr/share/man/man8/libnss_$nssmodule.*.8
+ mv "$srcdir/dest"/systemd/usr/lib/libnss_$nssmodule.so* -t "$srcdir/dest"/nss-$nssmodule/usr/lib/
+ done
+
+ install -dm755 "$srcdir/dest/systemd-sysvcompat"/usr/share/man/man8
+- mv "$srcdir/dest/systemd"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \
+- -t "$srcdir/dest/systemd-sysvcompat"/usr/share/man/man8
+
+- rmdir "$srcdir/dest"/systemd/usr/{share/man/man3,lib/pkgconfig,include}
++ rmdir "$srcdir/dest"/systemd/usr/{share/man/man3,lib/pkgconfig,include} || true
+ }
+
+ package_systemd() {
+@@ -267,7 +279,7 @@ package_systemd() {
+ chmod 0750 "$pkgdir"/usr/share/polkit-1/rules.d
+
+ # we'll create this on installation
+- rmdir "$pkgdir/var/log/journal/remote"
++ rmdir "$pkgdir/var/log/journal/remote" || true
+
+ # ship default policy to leave services disabled
+ echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset
diff --git a/src/stage1/patches/unixodbc.patch b/src/stage1/patches/unixodbc.patch
new file mode 100644
index 0000000..1214c6b
--- /dev/null
+++ b/src/stage1/patches/unixodbc.patch
@@ -0,0 +1,13 @@
+--- a/PKGBUILD 2018-02-21 17:21:51.719593310 +0100
++++ b/PKGBUILD 2018-02-21 17:22:23.987843397 +0100
+@@ -17,7 +17,9 @@ md5sums=('abf14cf943f1f8c5e63a24cb26d54f
+
+ build() {
+ cd unixODBC-${pkgver}
+- ./configure --prefix=/usr --sysconfdir=/etc
++ curl "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" \
++ > config.sub
++ ./configure --host=@TARGET@ --build=@BUILDHOST@ --prefix=/usr --sysconfdir=/etc
+ make
+ }
+
diff --git a/src/stage1/patches/util-linux.patch b/src/stage1/patches/util-linux.patch
new file mode 100644
index 0000000..9f2aaae
--- /dev/null
+++ b/src/stage1/patches/util-linux.patch
@@ -0,0 +1,38 @@
+--- a/PKGBUILD 2018-02-21 21:08:31.805898301 +0100
++++ b/PKGBUILD 2018-02-21 21:36:01.371436135 +0100
+@@ -13,7 +13,7 @@ url="https://www.kernel.org/pub/linux/ut
+ arch=('x86_64')
+ makedepends=('systemd' 'python' 'libcap-ng')
+ license=('GPL2')
+-options=('strip' 'debug')
++options=('debug')
+ validpgpkeys=('B0C64D14301CC6EFAEDF60E4E4B71D5EEC39C284') # Karel Zak
+ source=("https://www.kernel.org/pub/linux/utils/util-linux/v$_pkgmajor/$pkgbase-$pkgver.tar."{xz,sign}
+ pam-{login,common,su}
+@@ -35,6 +35,8 @@ build() {
+ cd "$pkgbase-$pkgver"
+
+ ./configure --prefix=/usr \
++ --host=@TARGET@ --build=@BUILDHOST@ \
++ --without-systemd \
+ --libdir=/usr/lib \
+ --bindir=/usr/bin \
+ --localstatedir=/run \
+@@ -45,7 +47,7 @@ build() {
+ --enable-chfn-chsh \
+ --enable-write \
+ --enable-mesg \
+- --with-python=3
++ --without-python
+
+ make
+ }
+@@ -78,7 +80,7 @@ package_util-linux() {
+ install -m644 "$srcdir/pam-su" "$pkgdir/etc/pam.d/su-l"
+
+ # TODO(dreisner): offer this upstream?
+- sed -i '/ListenStream/ aRuntimeDirectory=uuidd' "$pkgdir/usr/lib/systemd/system/uuidd.socket"
++ #sed -i '/ListenStream/ aRuntimeDirectory=uuidd' "$pkgdir/usr/lib/systemd/system/uuidd.socket"
+
+ # adjust for usrmove
+ # TODO(dreisner): fix configure.ac upstream so that this isn't needed