summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/acl/APKBUILD23
-rw-r--r--system/at/APKBUILD6
-rw-r--r--system/attr/APKBUILD33
-rw-r--r--system/attr/fix-decls.patch35
-rw-r--r--system/attr/fix-throw.patch33
-rw-r--r--system/bison/APKBUILD4
-rw-r--r--system/bubblewrap/APKBUILD4
-rw-r--r--system/c-ares/APKBUILD2
-rw-r--r--system/cmake/APKBUILD10
-rw-r--r--system/coreutils/APKBUILD8
-rw-r--r--system/coreutils/localename-test-fix.patch17
-rw-r--r--system/curl/APKBUILD4
-rw-r--r--system/expat/APKBUILD6
-rw-r--r--system/file/APKBUILD4
-rw-r--r--system/gdb/APKBUILD4
-rw-r--r--system/git/APKBUILD8
-rw-r--r--system/git/dont-test-other-encodings.patch243
-rw-r--r--system/kmod/APKBUILD6
-rw-r--r--system/libarchive/APKBUILD14
-rw-r--r--system/libedit/APKBUILD8
-rw-r--r--system/libgpg-error/APKBUILD11
-rw-r--r--system/libuv/APKBUILD6
-rw-r--r--system/libuv/disable-process-priority.patch22
-rw-r--r--system/man-db/APKBUILD7
-rw-r--r--system/mpfr3/APKBUILD2
-rw-r--r--system/musl/APKBUILD9
-rw-r--r--system/musl/amalgamation.patch6528
-rw-r--r--system/ncurses/APKBUILD6
-rw-r--r--system/nspr/APKBUILD6
-rw-r--r--system/nss/APKBUILD6
-rw-r--r--system/openssl/3001-CVE-2018-0737.patch28
-rw-r--r--system/openssl/3002-CVE-2018-0732.patch39
-rw-r--r--system/openssl/APKBUILD10
-rw-r--r--system/perl-authen-sasl/APKBUILD2
-rw-r--r--system/perl-cpanel-json-xs/APKBUILD6
-rw-r--r--system/perl-dbd-sqlite/APKBUILD2
-rw-r--r--system/perl-dbi/APKBUILD2
-rw-r--r--system/perl-digest-hmac/APKBUILD2
-rw-r--r--system/perl-digest-sha1/APKBUILD2
-rw-r--r--system/perl-encode-locale/APKBUILD2
-rw-r--r--system/perl-error/APKBUILD2
-rw-r--r--system/perl-extutils-config/APKBUILD2
-rw-r--r--system/perl-extutils-helpers/APKBUILD2
-rw-r--r--system/perl-extutils-installpaths/APKBUILD2
-rw-r--r--system/perl-file-listing/APKBUILD2
-rw-r--r--system/perl-file-remove/APKBUILD2
-rw-r--r--system/perl-html-parser/APKBUILD2
-rw-r--r--system/perl-html-tagset/APKBUILD2
-rw-r--r--system/perl-http-cookies/APKBUILD2
-rw-r--r--system/perl-http-daemon/APKBUILD3
-rw-r--r--system/perl-http-date/APKBUILD2
-rw-r--r--system/perl-http-message/APKBUILD2
-rw-r--r--system/perl-http-negotiate/APKBUILD2
-rw-r--r--system/perl-io-html/APKBUILD2
-rw-r--r--system/perl-io-socket-ssl/APKBUILD6
-rw-r--r--system/perl-json-maybexs/APKBUILD4
-rw-r--r--system/perl-json/APKBUILD2
-rw-r--r--system/perl-libwww/APKBUILD10
-rw-r--r--system/perl-lwp-mediatypes/APKBUILD2
-rw-r--r--system/perl-module-build-tiny/APKBUILD2
-rw-r--r--system/perl-module-build/APKBUILD2
-rw-r--r--system/perl-module-install/APKBUILD2
-rw-r--r--system/perl-module-scandeps/APKBUILD6
-rw-r--r--system/perl-net-http/APKBUILD3
-rw-r--r--system/perl-net-libidn/APKBUILD1
-rw-r--r--system/perl-net-smtp-ssl/APKBUILD2
-rw-r--r--system/perl-net-ssleay/APKBUILD2
-rw-r--r--system/perl-sub-uplevel/APKBUILD2
-rw-r--r--system/perl-test-exception/APKBUILD2
-rw-r--r--system/perl-test-fatal/APKBUILD2
-rw-r--r--system/perl-test-harness/APKBUILD2
-rw-r--r--system/perl-test-leaktrace/APKBUILD2
-rw-r--r--system/perl-test-needs/APKBUILD2
-rw-r--r--system/perl-test-nowarnings/APKBUILD2
-rw-r--r--system/perl-test-pod/APKBUILD8
-rw-r--r--system/perl-test-requires/APKBUILD2
-rw-r--r--system/perl-test-requiresinternet/APKBUILD2
-rw-r--r--system/perl-test-simple/APKBUILD6
-rw-r--r--system/perl-test-warn/APKBUILD2
-rw-r--r--system/perl-test-without-module/APKBUILD2
-rw-r--r--system/perl-try-tiny/APKBUILD2
-rw-r--r--system/perl-uri/APKBUILD3
-rw-r--r--system/perl-www-robotrules/APKBUILD3
-rw-r--r--system/perl-yaml-syck/APKBUILD10
-rw-r--r--system/perl-yaml-tiny/APKBUILD2
-rw-r--r--system/sqlite/APKBUILD3
-rw-r--r--system/strace/APKBUILD4
-rw-r--r--system/sudo/APKBUILD2
-rw-r--r--system/vim/APKBUILD6
-rw-r--r--system/yaml/APKBUILD6
90 files changed, 452 insertions, 6868 deletions
diff --git a/system/acl/APKBUILD b/system/acl/APKBUILD
index 3ca79ebab..9c5b0e74b 100644
--- a/system/acl/APKBUILD
+++ b/system/acl/APKBUILD
@@ -1,38 +1,30 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=acl
-pkgver=2.2.52
-pkgrel=5
+pkgver=2.2.53
+pkgrel=0
pkgdesc="Access control list utilities"
url="https://savannah.nongnu.org/projects/acl"
arch="all"
+# depends on order of nftw, and requires test machine to have ACLs enabled on FS
+options="!check"
license="LGPL-2.1+ AND GPL-2.0+"
depends=""
makedepends_build="gzip gettext-tiny"
makedepends_host="attr-dev gettext-tiny-dev"
makedepends="$makedepends_build $makedepends_host"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang libacl"
-# depends on order of nftw, and requires test machine to have ACLs enabled on FS
-options="!check"
-source="http://download.savannah.nongnu.org/releases/acl/acl-$pkgver.src.tar.gz"
+source="https://download.savannah.nongnu.org/releases/acl/acl-$pkgver.tar.gz"
prepare() {
cd "$builddir"
default_prepare
- update_config_sub
sed -i \
-e '/^as_dummy=/s:=":="$PATH$PATH_SEPARATOR:' \
configure # hack PATH with AC_PATH_PROG
- sed -i \
- -e "/^PKG_DOC_DIR/s:@pkg_name@:$pkgname:" \
- -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
- include/builddefs.in
}
build() {
cd "$builddir"
- unset PLATFORM
- export OPTIMIZER="${CFLAGS}"
- export DEBUG=-DNDEBUG
CONFIG_SHELL=/bin/sh ./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -44,8 +36,7 @@ build() {
package() {
cd "$builddir"
- make DIST_ROOT="$pkgdir" install install-lib install-dev
- chown -R root:root "$pkgdir"/*
+ make DESTDIR="$pkgdir" install
}
libacl() {
@@ -54,4 +45,4 @@ libacl() {
mv "$pkgdir"/lib/libacl.so.* "$subpkgdir"/lib/
}
-sha512sums="59973199d371cd0b2368e95bc829a1b47f04e808a174fefba4c6854e766158bd19a71d9dbcc8d6fdc1573a1f971cdda39c453f7fa243bce02c1ab97c6e7c72e7 acl-2.2.52.src.tar.gz"
+sha512sums="176b7957fe0e7618e0b7bf2ac5071f7fa29417df718cce977661a576fa184e4af9d303b591c9d556b6ba8923e799457343afa401f5a9f7ecd9022185a4e06716 acl-2.2.53.tar.gz"
diff --git a/system/at/APKBUILD b/system/at/APKBUILD
index 280156524..f876de3ca 100644
--- a/system/at/APKBUILD
+++ b/system/at/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Alexander Belkov <msun00@yandex.ru>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=at
-pkgver=3.1.20
-pkgrel=3
+pkgver=3.1.23
+pkgrel=0
pkgdesc="Delayed job execution and batch processing daemon"
url="https://packages.qa.debian.org/a/at.html"
arch="all"
@@ -55,7 +55,7 @@ package() {
"$pkgdir"/etc/init.d/atd
}
-sha512sums="20a13512a86f988728f590712f5bf8a23f4dc44f4b42521a4dd4783dc1ba7ac2016ee87b4c2c14f2346a5839168a983d99c3195e947014aea3096a3db16d176f at_3.1.20.orig.tar.gz
+sha512sums="ee5cf5abf32cf1e89746e427d1cc20005ef49fad47db55512c90042a77e86b2c15f5de029c79573bc86ce4aead6ed2d561b89812510aadbc5763f9288b467cfd at_3.1.23.orig.tar.gz
ec24581fd59de62a93a5914f57b811baaf00fcc8fe969a4c8d0eb0cb2fd939762871725fec406eb127763935ab95ea10e23f314144a5d08ede78ba3bcf231e4a 10-parsetime.l-1.patch
9c06a4e92f3820a85ba75be8c14cb02762f6a5d4f0182bb2faafe51f5de2e35b0ce91e7e81f6e5b3127732c36c8e23e276a103aa0419661a602df93df274f855 10-parsetime.y-1.patch
ba57e93c9c90dc989e8ac299c12de13de0005b28fd934620a9a5b47af89db3c0dc63e39043ab3a50d313ed2bb4f4832b1f68db971b3f515c500a2b74ed18acbd 10-Makefile.in-1.patch
diff --git a/system/attr/APKBUILD b/system/attr/APKBUILD
index 10fca7144..ac91b0e12 100644
--- a/system/attr/APKBUILD
+++ b/system/attr/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=attr
-pkgver=2.4.47
-pkgrel=9
+pkgver=2.4.48
+pkgrel=0
pkgdesc="Utilities for managing filesystem extended attributes"
url="https://savannah.nongnu.org/projects/attr"
arch="all"
@@ -11,9 +11,7 @@ depends=""
makedepends="libtool autoconf automake bash gettext-tiny gettext-tiny-dev"
checkdepends="perl"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang libattr"
-source="http://download.savannah.nongnu.org/releases/attr/attr-$pkgver.src.tar.gz
- fix-decls.patch
- fix-throw.patch
+source="http://download.savannah.nongnu.org/releases/attr/attr-$pkgver.tar.gz
test-runner-musl.patch
test-runner-perl.patch
"
@@ -21,24 +19,18 @@ source="http://download.savannah.nongnu.org/releases/attr/attr-$pkgver.src.tar.g
prepare() {
cd "$builddir"
default_prepare
- update_config_sub
-
- sed -i -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
- include/builddefs.in
}
build() {
cd "$builddir"
- OPTIMIZER="${CFLAGS}" DEBUG=-DNDEBUG INSTALL_USER=root INSTALL_GROUP=root ./configure \
+ ./configure \
--build=$CBUILD \
--host=$CHOST \
- --prefix=/ \
+ --prefix=/usr \
--exec-prefix=/ \
- --sbindir=/bin \
- --bindir=/usr/bin \
+ --sbindir=/sbin \
--libdir=/lib \
- --libexecdir=/usr/lib \
--includedir=/usr/include \
--mandir=/usr/share/man \
--datadir=/usr/share
@@ -47,17 +39,12 @@ build() {
check() {
cd "$builddir"
- make tests
+ make check
}
package() {
cd "$builddir"
- make -j1 DESTDIR="$pkgdir" \
- install install-lib install-dev
-
- # provided by man-pages
- rm -r "$pkgdir"/usr/share/man/man2 \
- "$pkgdir"/usr/share/man/man5/attr.5
+ make -j1 DESTDIR="$pkgdir" install
}
libattr() {
@@ -67,8 +54,6 @@ libattr() {
mv "$pkgdir"/lib/lib*.so.* "$subpkgdir"/lib/
}
-sha512sums="2a333f63655758298650cf8f89c175efdc0112dcc4013e8d023e2a9a69f177e4bcb1f1d10b6666d6f2027dca4dec0833d54749952ab153d28367e1a72e6e2831 attr-2.4.47.src.tar.gz
-fa7925f63c611e39b28adbf8fa3838bd91c245e4694957c1a8e212cb8f289eb62e04f50806227f6c1947d432ddf7633a471c13dd08d513d1e2b8a9ac1906cb33 fix-decls.patch
-d758b864bac9bdbc3360df2e7a3bc7d04e06789975cf539b8e2b98b1d874744b55c80f0502e283f7233d6ec41f8a39624fe07b512a7fdc6af8d19dd3af5f9f5a fix-throw.patch
+sha512sums="75f870a0e6e19b8975f3fdceee786fbaff3eadaa9ab9af01996ffa8e50fe5b2bba6e4c22c44a6722d11b55feb9e89895d0151d6811c1d2b475ef4ed145f0c923 attr-2.4.48.tar.gz
da4b903ae0ba1c72bae60405745c1135d1c3c1cefd7525fca296f8dc7dac1e60e48eeba0ba80fddb035b24b847b00c5a9926d0d586c5d7989d0428e458d977d3 test-runner-musl.patch
d10821cc73751171c6b9cc4172cf4c85be9b6e154782090a262a16fd69172a291c5d5c94587aebcf5b5d1e02c27769245d88f0aa86478193cf1a277ac7f4f18e test-runner-perl.patch"
diff --git a/system/attr/fix-decls.patch b/system/attr/fix-decls.patch
deleted file mode 100644
index 0de70a93d..000000000
--- a/system/attr/fix-decls.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 667137acaffb8d0cc62b47821a67a52ba0637d5c Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Fri, 10 Jan 2014 13:56:37 +0000
-Subject: avoid glibc-specific DECLS defines
-
-This matches what we do in all the other headers.
----
-diff --git a/include/xattr.h b/include/xattr.h
-index 70a84be..070d7c5 100644
---- a/include/xattr.h
-+++ b/include/xattr.h
-@@ -30,8 +30,9 @@
- #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
- #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
-
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern int setxattr (const char *__path, const char *__name,
- const void *__value, size_t __size, int __flags) __THROW;
-@@ -58,6 +59,8 @@ extern int removexattr (const char *__path, const char *__name) __THROW;
- extern int lremovexattr (const char *__path, const char *__name) __THROW;
- extern int fremovexattr (int __filedes, const char *__name) __THROW;
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif /* __XATTR_H__ */
---
-cgit v0.9.0.2
diff --git a/system/attr/fix-throw.patch b/system/attr/fix-throw.patch
deleted file mode 100644
index 220e3ad28..000000000
--- a/system/attr/fix-throw.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 92247401984dd9a80d9d0c8c030692323f980678 Mon Sep 17 00:00:00 2001
-From: Emmanuel Dreyfus <manu@netbsd.org>
-Date: Mon, 30 Jun 2014 13:06:05 +0000
-Subject: Portability fixes
-
-- <features.h> is Linux specific
-- Define __THROW for non glibc based systems
----
-diff --git a/include/xattr.h b/include/xattr.h
-index 070d7c5..fd1f268 100644
---- a/include/xattr.h
-+++ b/include/xattr.h
-@@ -20,7 +20,18 @@
- #ifndef __XATTR_H__
- #define __XATTR_H__
-
-+#if defined(linux)
- #include <features.h>
-+#endif
-+
-+/* Portability non glibc c++ build systems */
-+#ifndef __THROW
-+# if defined __cplusplus
-+# define __THROW throw ()
-+# else
-+# define __THROW
-+# endif
-+#endif
-
- #include <errno.h>
- #ifndef ENOATTR
---
-cgit v0.9.0.2
diff --git a/system/bison/APKBUILD b/system/bison/APKBUILD
index f414e7542..921a1fdf3 100644
--- a/system/bison/APKBUILD
+++ b/system/bison/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=bison
-pkgver=3.0.5
+pkgver=3.1
pkgrel=0
pkgdesc="The GNU general-purpose parser generator"
arch="all"
@@ -38,4 +38,4 @@ package() {
rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}
-sha512sums="00b448db8abe91b07e32ff5273c6617bc1350d806f92073a9472f4c2f0de5d22c152795674171b74f2eb9eff8d36f8173b82dacb215601bb071ae39404d4a8a2 bison-3.0.5.tar.xz"
+sha512sums="2a8e217ffb55ed5b1fcc989377ac348a066e62b8a4b0b0da40c3c7202f3ea487b2aab6a704a10b48d2d17673be0e22f6ff1be91fc05c4e0a57969b42a59d0152 bison-3.1.tar.xz"
diff --git a/system/bubblewrap/APKBUILD b/system/bubblewrap/APKBUILD
index 2f73d6f45..2e1c8a628 100644
--- a/system/bubblewrap/APKBUILD
+++ b/system/bubblewrap/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer:
pkgname=bubblewrap
-pkgver=0.2.0
+pkgver=0.3.0
pkgrel=0
pkgdesc="Unprivileged sandboxing tool"
url="https://github.com/projectatomic/bubblewrap"
@@ -46,6 +46,6 @@ bashcomp() {
mv "$pkgdir"/usr/share/bash-completion/ "$subpkgdir"/usr/share/
}
-sha512sums="746f10cd9f9852ca4679d589357402ec10c352e02f77384844a4657fd9b2952189a3299319fbefedd35358d39fd16ded63cc3db95041ed2091548183786b8b63 bubblewrap-0.2.0.tar.gz
+sha512sums="0dc033f83547112cedc706e4ef80e39ba0ee63f3750f93454a7b1a38aeb922ee660b3491a5a5d060fce9a7c4b326798a66814ad94f53f1e666c27a557fec17a4 bubblewrap-0.3.0.tar.gz
400a0446670ebf80f16739f1a7a2878aadc3099424f957ba09ec3df780506c23a11368f0578c9e352d7ca6473fa713df826fad7a20c50338aa5f9fa9ac6b84a4 realpath-workaround.patch
f59cda3b09dd99db9ca6d97099a15bb2523e054063d677502317ae3165ba2e32105a0ae8f877afc3827bd28d093c9d9d413270f4c87d9fe5f26f3eee670d916e musl-fixes.patch"
diff --git a/system/c-ares/APKBUILD b/system/c-ares/APKBUILD
index 3effc2a1a..c2f577079 100644
--- a/system/c-ares/APKBUILD
+++ b/system/c-ares/APKBUILD
@@ -4,7 +4,7 @@ pkgname=c-ares
pkgver=1.14.0
pkgrel=0
pkgdesc="Asynchronous DNS/name resolver library"
-url="http://c-ares.haxx.se/"
+url="https://c-ares.haxx.se/"
arch="all"
options="!checkroot"
license="MIT"
diff --git a/system/cmake/APKBUILD b/system/cmake/APKBUILD
index f74bb7d76..9ea4e8c6f 100644
--- a/system/cmake/APKBUILD
+++ b/system/cmake/APKBUILD
@@ -1,15 +1,15 @@
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=cmake
-pkgver=3.11.4
+pkgver=3.12.1
pkgrel=0
pkgdesc="Cross-platform build system"
-url="http://www.cmake.org"
+url="https://cmake.org"
arch="all"
+options="!checkroot"
license="CMake"
makedepends="ncurses-dev curl-dev expat-dev zlib-dev bzip2-dev libarchive-dev
libuv-dev xz-dev rhash-dev"
-options="!checkroot"
checkdepends="musl-utils file"
subpackages="$pkgname-doc"
@@ -18,7 +18,7 @@ case $pkgver in
*.*.*) _v=v${pkgver%.*};;
esac
-source="http://www.cmake.org/files/$_v/cmake-${pkgver}.tar.gz"
+source="https://cmake.org/files/$_v/cmake-${pkgver}.tar.gz"
_parallel_opt() {
local i n
@@ -55,4 +55,4 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="c5d03ad66a004292038e49e391c390ebc328fbb089ea699742a9b75f0ada9398c3dc971b868f75d8438bf437ecbeaa62541beb53cae14a699bf244ad101a2290 cmake-3.11.4.tar.gz"
+sha512sums="7a0a769ef060785a8dc8c6aa272435a90a07cc8079f6c83c916da0b79d8bcdefca0d7be21f55f408ab4dfa6a57caa9ff8dec4be993145f4e3337ff392481b692 cmake-3.12.1.tar.gz"
diff --git a/system/coreutils/APKBUILD b/system/coreutils/APKBUILD
index f54e82463..840c55421 100644
--- a/system/coreutils/APKBUILD
+++ b/system/coreutils/APKBUILD
@@ -2,8 +2,8 @@
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=coreutils
-pkgver=8.29
-pkgrel=2
+pkgver=8.30
+pkgrel=0
pkgdesc="Basic file, shell, and text manipulation utilities"
url="http://www.gnu.org/software/coreutils/"
arch="all"
@@ -76,10 +76,10 @@ package() {
ln -s ../bin/coreutils "$pkgdir"/usr/sbin/chroot
}
-sha512sums="546bbcd5741beae7a68e7c4ca14d6d634f7c8be87feecdeddd00e226f4865bb89d503437c3a95622ba7bb0cb70addbb5bdf3767fa18d0b7410ab90ee53b29dfd coreutils-8.29.tar.xz
+sha512sums="25bc132c0d89ce71c33e417f04649c9fcfce6c5ef8b19f093b2e9e2851bfde9b5a31e20499d9c427332228ba54b88d445ddb445551e1944bb8f5cbff5ffa4eda coreutils-8.30.tar.xz
bd8b5cecba59eba30458c8afa895877d39a987b989bc06b70cd6836e0ef684677aaadcb4949b58a713779fe1df1e15e3903e9be14e306671b86b69018b75de8b disable-csplit-io-err-test.patch
532ef8210261437855ba3e2fc72ec57b0e0252b2b0f7817990c9629613ece2cdd86cf30aa049f3cff6fbda12ed3bb9a0db3a3642475378ae44ce319bdf005d9b disable-mbrtowc-test.patch
-a6cbe77d2fd3655e59ead9ec5cfcc80ae8c1a688f779219910d9370a0e5f86195e2d3a1ca427a374d8457c5ca04ebb72f8bac0b7a7415337bac3545a85d22e3d localename-test-fix.patch"
+86944e9ea5493c5b21ab62562a63aa134952738297b21cfb2e8f751db4a695ff25ee1592eb231ed1bb80999bc31f7504c7feffde2e93b4e068c05c44ac83cbdf localename-test-fix.patch"
[ ${CBUILD} != ${CHOST} ] && sha512sums="$sha512sums
bae804f057252c25452ac178c545dc2c4b4775cbfbdcfd4775edd1a4ed6507882bfac39e2b11ad01b74230ca48d761bf62f11bde5bcbc35a6e5a61cbe4a46e36 051_all_coreutils-mangen.patch
diff --git a/system/coreutils/localename-test-fix.patch b/system/coreutils/localename-test-fix.patch
index 9907eb67a..ff89319c7 100644
--- a/system/coreutils/localename-test-fix.patch
+++ b/system/coreutils/localename-test-fix.patch
@@ -1,14 +1,13 @@
+# if defined __APPLE__ && defined __MACH__
+# include <xlocale.h>
+# endif
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || defined __CYGWIN__
+# if (defined __linux__ && !defined __UCLIBC__) || defined __CYGWIN__
+# include <langinfo.h>
+# endif
+# if !defined IN_LIBINTL
--- coreutils-8.27/gnulib-tests/localename.c.old 2016-12-31 13:54:43.000000000 +0000
+++ coreutils-8.27/gnulib-tests/localename.c 2017-07-30 16:40:47.098541270 +0000
-@@ -40,7 +40,7 @@
- # if defined __APPLE__ && defined __MACH__
- # include <xlocale.h>
- # endif
--# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || defined __CYGWIN__
-+# if (defined __linux__ && !defined __UCLIBC__) || defined __CYGWIN__
- # include <langinfo.h>
- # endif
- # if !defined IN_LIBINTL
@@ -2692,16 +2692,19 @@
locale_t thread_locale = uselocale (NULL);
if (thread_locale != LC_GLOBAL_LOCALE)
diff --git a/system/curl/APKBUILD b/system/curl/APKBUILD
index 08e8007a5..e82cd55bf 100644
--- a/system/curl/APKBUILD
+++ b/system/curl/APKBUILD
@@ -6,14 +6,14 @@ pkgname=curl
pkgver=7.60.0
pkgrel=0
pkgdesc="An URL retrival utility and library"
-url="http://curl.haxx.se"
+url="https://curl.haxx.se"
arch="all"
license="MIT"
depends="ca-certificates"
makedepends_build="groff perl"
makedepends_host="zlib-dev openssl-dev libssh2-dev"
makedepends="$makedepends_build $makedepends_host"
-source="http://curl.haxx.se/download/$pkgname-$pkgver.tar.bz2
+source="https://curl.haxx.se/download/$pkgname-$pkgver.tar.bz2
"
subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev libcurl"
diff --git a/system/expat/APKBUILD b/system/expat/APKBUILD
index 8286b0db9..f57096314 100644
--- a/system/expat/APKBUILD
+++ b/system/expat/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=expat
-pkgver=2.2.5
+pkgver=2.2.6
pkgrel=0
pkgdesc="An XML Parser library written in C"
url="https://libexpat.github.io/"
@@ -12,6 +12,8 @@ subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/$pkgname-$pkgver"
# secfixes:
+# 2.2.1-r0:
+# - CVE-2016-9063
# 2.2.0-r1:
# - CVE-2017-9233
@@ -35,4 +37,4 @@ package() {
make DESTDIR="$pkgdir/" install
}
-sha512sums="8226970a7e5d2b8d7818081758ca59bb6ce2d655feaa9d3a92481629000b73fde4782f50343d58ec4e1cebe75649e1980f636775a731d8aa4b55ceb843d9f637 expat-2.2.5.tar.bz2"
+sha512sums="dbfb635a5fe7b190722664263a0dd437b512fdf519bc53bd4905567f4bfb4b1e89a021562da63df8cacd48b706d1dea60ccde47f279e57400ad3c846b6e9c4e6 expat-2.2.6.tar.bz2"
diff --git a/system/file/APKBUILD b/system/file/APKBUILD
index b101f5b06..c870be1ef 100644
--- a/system/file/APKBUILD
+++ b/system/file/APKBUILD
@@ -2,7 +2,7 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com>
pkgname=file
-pkgver=5.33
+pkgver=5.34
pkgrel=0
pkgdesc="File type identification utility"
url="http://www.darwinsys.com/file/"
@@ -38,4 +38,4 @@ libmagic() {
mv "$pkgdir"/usr/lib "$pkgdir"/usr/share "$subpkgdir"/usr
}
-sha512sums="36c9f2e2aa814b5557eef114fdd3de159688c7a3c9632a9f5c6355c4d2a5694cee81279bda80897616fca07289a7fedb1f797439a2903c76dc84870694773c9e file-5.33.tar.gz"
+sha512sums="57849f8496fd356a66e5559804fdd907059dc2e2f75ede470a25c65b1c499481aad3d7978454b15a15e94c07c9d6795864e8705304a2281dacf1c4e31501bed8 file-5.34.tar.gz"
diff --git a/system/gdb/APKBUILD b/system/gdb/APKBUILD
index 2bf45416d..b038ca23f 100644
--- a/system/gdb/APKBUILD
+++ b/system/gdb/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=gdb
-pkgver=8.1
+pkgver=8.2
pkgrel=0
pkgdesc="The GNU Debugger"
url="https://www.sourceware.org/gdb/"
@@ -56,7 +56,7 @@ package() {
rm -rf "$pkgdir"/usr/lib
}
-sha512sums="ffd82f415d7652d62dad1716c307836f594217a363429609beb7d70239e8bf06b73b393345b0e000796228e56681ed7656ac3c8be05e91d6d652ab0d5b1dc357 gdb-8.1.tar.xz
+sha512sums="11cc481bebc51eb6db73249ecb62b8c07455cf3db169f4860b3a83114849fbd2b5860a2db64488ba6c5909cf07b255c04770f1e36059eae6bee16d2a3581be90 gdb-8.2.tar.xz
986e68275f7692f39b5d8aedeb9f9e88f0e5bebb3f8c7f104933c525d35ca54fc90e18698c1e3e1009e8a188e5e70d6f252cb39e4c75e37db7bf479017e0da32 s390x-use-elf-gdb_fpregset_t.patch
04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01 ppc-musl.patch
b75e1c1ee503a1948a7d5b8d90427b5c7d38ded69978056cee0adca222771a5c95ed1ac73127fcae7b795ea94296344eee5fca47e4cd04b418c164a756fb0933 ppc-ptregs.patch
diff --git a/system/git/APKBUILD b/system/git/APKBUILD
index 7fdb90fff..d3b64080d 100644
--- a/system/git/APKBUILD
+++ b/system/git/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=git
-pkgver=2.17.1
+pkgver=2.18.0
pkgrel=0
pkgdesc="A distributed version control system"
url="https://www.git-scm.com/"
@@ -60,7 +60,7 @@ build() {
check() {
cd "$builddir"
- make prefix=/usr DESTDIR="$pkgdir" test
+ make prefix=/usr DESTDIR="$pkgdir" -j1 test
}
package() {
@@ -167,8 +167,8 @@ subtree_doc() {
gzip -9 "$subpkgdir"/usr/share/man/man1/git-subtree.1
}
-sha512sums="77c27569d40fbae1842130baa0cdda674a02e384631bd8fb1f2ddf67ce372dd4903b2ce6b4283a4ae506cdedd5daa55baa2afe6a6689528511e24e4beb864960 git-2.17.1.tar.xz
+sha512sums="db19363c9c2042248322d49874a27c0614acfb912183725e5d4f0331d6b44cef66a9a7da6a49bd4a17e5d86d30c5fed6bef7527f386494184595a433c4060e46 git-2.18.0.tar.xz
85767b5e03137008d6a96199e769e3979f75d83603ac8cb13a3481a915005637409a4fd94e0720da2ec6cd1124f35eba7cf20109a94816c4b4898a81fbc46bd2 bb-tar.patch
-135645fa57c41c50bec6d09f7d3c92f26d30334b5f342d50942c24e0dd11106e40c36b11346c9e6cd69e98b7a9ebeec80e4e4f1506ef689f39d7ef4539727dae dont-test-other-encodings.patch
+1e1cf54be8db0b7a63de2267f3cb0359070a50dcd940e5329a126f1d9f26b2596b93f2b836adc953e4d5b148bbba2eb8234dfeb2929ac3c1e3162507781141f6 dont-test-other-encodings.patch
89528cdd14c51fd568aa61cf6c5eae08ea0844e59f9af9292da5fc6c268261f4166017d002d494400945e248df6b844e2f9f9cd2d9345d516983f5a110e4c42a git-daemon.initd
fbf1f425206a76e2a8f82342537ed939ff7e623d644c086ca2ced5f69b36734695f9f80ebda1728f75a94d6cd2fcb71bf845b64239368caab418e4d368c141ec git-daemon.confd"
diff --git a/system/git/dont-test-other-encodings.patch b/system/git/dont-test-other-encodings.patch
index 98949bc1b..54a4012fe 100644
--- a/system/git/dont-test-other-encodings.patch
+++ b/system/git/dont-test-other-encodings.patch
@@ -191,3 +191,246 @@ We can't support Japanese people using musl
cat >expected <<EOF
author $UTF8_NAME
summary $UTF8_MSG
+--- git-2.18.0/t/t0028-working-tree-encoding.sh.old 2018-06-21 17:18:50.000000000 +0000
++++ git-2.18.0/t/t0028-working-tree-encoding.sh 2018-09-05 17:42:14.650000000 +0000
+@@ -6,240 +6,4 @@
+
+ GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING
+
+-test_expect_success 'setup test files' '
+- git config core.eol lf &&
+-
+- text="hallo there!\ncan you read me?" &&
+- echo "*.utf16 text working-tree-encoding=utf-16" >.gitattributes &&
+- printf "$text" >test.utf8.raw &&
+- printf "$text" | iconv -f UTF-8 -t UTF-16 >test.utf16.raw &&
+- printf "$text" | iconv -f UTF-8 -t UTF-32 >test.utf32.raw &&
+-
+- # Line ending tests
+- printf "one\ntwo\nthree\n" >lf.utf8.raw &&
+- printf "one\r\ntwo\r\nthree\r\n" >crlf.utf8.raw &&
+-
+- # BOM tests
+- printf "\0a\0b\0c" >nobom.utf16be.raw &&
+- printf "a\0b\0c\0" >nobom.utf16le.raw &&
+- printf "\376\777\0a\0b\0c" >bebom.utf16be.raw &&
+- printf "\777\376a\0b\0c\0" >lebom.utf16le.raw &&
+- printf "\0\0\0a\0\0\0b\0\0\0c" >nobom.utf32be.raw &&
+- printf "a\0\0\0b\0\0\0c\0\0\0" >nobom.utf32le.raw &&
+- printf "\0\0\376\777\0\0\0a\0\0\0b\0\0\0c" >bebom.utf32be.raw &&
+- printf "\777\376\0\0a\0\0\0b\0\0\0c\0\0\0" >lebom.utf32le.raw &&
+-
+- # Add only UTF-16 file, we will add the UTF-32 file later
+- cp test.utf16.raw test.utf16 &&
+- cp test.utf32.raw test.utf32 &&
+- git add .gitattributes test.utf16 &&
+- git commit -m initial
+-'
+-
+-test_expect_success 'ensure UTF-8 is stored in Git' '
+- test_when_finished "rm -f test.utf16.git" &&
+-
+- git cat-file -p :test.utf16 >test.utf16.git &&
+- test_cmp_bin test.utf8.raw test.utf16.git
+-'
+-
+-test_expect_success 're-encode to UTF-16 on checkout' '
+- test_when_finished "rm -f test.utf16.raw" &&
+-
+- rm test.utf16 &&
+- git checkout test.utf16 &&
+- test_cmp_bin test.utf16.raw test.utf16
+-'
+-
+-test_expect_success 'check $GIT_DIR/info/attributes support' '
+- test_when_finished "rm -f test.utf32.git" &&
+- test_when_finished "git reset --hard HEAD" &&
+-
+- echo "*.utf32 text working-tree-encoding=utf-32" >.git/info/attributes &&
+- git add test.utf32 &&
+-
+- git cat-file -p :test.utf32 >test.utf32.git &&
+- test_cmp_bin test.utf8.raw test.utf32.git
+-'
+-
+-for i in 16 32
+-do
+- test_expect_success "check prohibited UTF-${i} BOM" '
+- test_when_finished "git reset --hard HEAD" &&
+-
+- echo "*.utf${i}be text working-tree-encoding=utf-${i}be" >>.gitattributes &&
+- echo "*.utf${i}le text working-tree-encoding=utf-${i}LE" >>.gitattributes &&
+-
+- # Here we add a UTF-16 (resp. UTF-32) files with BOM (big/little-endian)
+- # but we tell Git to treat it as UTF-16BE/UTF-16LE (resp. UTF-32).
+- # In these cases the BOM is prohibited.
+- cp bebom.utf${i}be.raw bebom.utf${i}be &&
+- test_must_fail git add bebom.utf${i}be 2>err.out &&
+- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
+- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+-
+- cp lebom.utf${i}le.raw lebom.utf${i}be &&
+- test_must_fail git add lebom.utf${i}be 2>err.out &&
+- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out &&
+- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+-
+- cp bebom.utf${i}be.raw bebom.utf${i}le &&
+- test_must_fail git add bebom.utf${i}le 2>err.out &&
+- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
+- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out &&
+-
+- cp lebom.utf${i}le.raw lebom.utf${i}le &&
+- test_must_fail git add lebom.utf${i}le 2>err.out &&
+- test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out &&
+- test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out
+- '
+-
+- test_expect_success "check required UTF-${i} BOM" '
+- test_when_finished "git reset --hard HEAD" &&
+-
+- echo "*.utf${i} text working-tree-encoding=utf-${i}" >>.gitattributes &&
+-
+- cp nobom.utf${i}be.raw nobom.utf${i} &&
+- test_must_fail git add nobom.utf${i} 2>err.out &&
+- test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out &&
+- test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out &&
+-
+- cp nobom.utf${i}le.raw nobom.utf${i} &&
+- test_must_fail git add nobom.utf${i} 2>err.out &&
+- test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out &&
+- test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out
+- '
+-
+- test_expect_success "eol conversion for UTF-${i} encoded files on checkout" '
+- test_when_finished "rm -f crlf.utf${i}.raw lf.utf${i}.raw" &&
+- test_when_finished "git reset --hard HEAD^" &&
+-
+- cat lf.utf8.raw | iconv -f UTF-8 -t UTF-${i} >lf.utf${i}.raw &&
+- cat crlf.utf8.raw | iconv -f UTF-8 -t UTF-${i} >crlf.utf${i}.raw &&
+- cp crlf.utf${i}.raw eol.utf${i} &&
+-
+- cat >expectIndexLF <<-EOF &&
+- i/lf w/-text attr/text eol.utf${i}
+- EOF
+-
+- git add eol.utf${i} &&
+- git commit -m eol &&
+-
+- # UTF-${i} with CRLF (Windows line endings)
+- rm eol.utf${i} &&
+- git -c core.eol=crlf checkout eol.utf${i} &&
+- test_cmp_bin crlf.utf${i}.raw eol.utf${i} &&
+-
+- # Although the file has CRLF in the working tree,
+- # ensure LF in the index
+- git ls-files --eol eol.utf${i} >actual &&
+- test_cmp expectIndexLF actual &&
+-
+- # UTF-${i} with LF (Unix line endings)
+- rm eol.utf${i} &&
+- git -c core.eol=lf checkout eol.utf${i} &&
+- test_cmp_bin lf.utf${i}.raw eol.utf${i} &&
+-
+- # The file LF in the working tree, ensure LF in the index
+- git ls-files --eol eol.utf${i} >actual &&
+- test_cmp expectIndexLF actual
+- '
+-done
+-
+-test_expect_success 'check unsupported encodings' '
+- test_when_finished "git reset --hard HEAD" &&
+-
+- echo "*.set text working-tree-encoding" >.gitattributes &&
+- printf "set" >t.set &&
+- test_must_fail git add t.set 2>err.out &&
+- test_i18ngrep "true/false are no valid working-tree-encodings" err.out &&
+-
+- echo "*.unset text -working-tree-encoding" >.gitattributes &&
+- printf "unset" >t.unset &&
+- git add t.unset &&
+-
+- echo "*.empty text working-tree-encoding=" >.gitattributes &&
+- printf "empty" >t.empty &&
+- git add t.empty &&
+-
+- echo "*.garbage text working-tree-encoding=garbage" >.gitattributes &&
+- printf "garbage" >t.garbage &&
+- test_must_fail git add t.garbage 2>err.out &&
+- test_i18ngrep "failed to encode" err.out
+-'
+-
+-test_expect_success 'error if encoding round trip is not the same during refresh' '
+- BEFORE_STATE=$(git rev-parse HEAD) &&
+- test_when_finished "git reset --hard $BEFORE_STATE" &&
+-
+- # Add and commit a UTF-16 file but skip the "working-tree-encoding"
+- # filter. Consequently, the in-repo representation is UTF-16 and not
+- # UTF-8. This simulates a Git version that has no working tree encoding
+- # support.
+- echo "*.utf16le text working-tree-encoding=utf-16le" >.gitattributes &&
+- echo "hallo" >nonsense.utf16le &&
+- TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
+- git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
+- COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
+- git update-ref refs/heads/master $COMMIT &&
+-
+- test_must_fail git checkout HEAD^ 2>err.out &&
+- test_i18ngrep "error: .* overwritten by checkout:" err.out
+-'
+-
+-test_expect_success 'error if encoding garbage is already in Git' '
+- BEFORE_STATE=$(git rev-parse HEAD) &&
+- test_when_finished "git reset --hard $BEFORE_STATE" &&
+-
+- # Skip the UTF-16 filter for the added file
+- # This simulates a Git version that has no checkoutEncoding support
+- cp nobom.utf16be.raw nonsense.utf16 &&
+- TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
+- git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
+- COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
+- git update-ref refs/heads/master $COMMIT &&
+-
+- git diff 2>err.out &&
+- test_i18ngrep "error: BOM is required" err.out
+-'
+-
+-test_expect_success 'check roundtrip encoding' '
+- test_when_finished "rm -f roundtrip.shift roundtrip.utf16" &&
+- test_when_finished "git reset --hard HEAD" &&
+-
+- text="hallo there!\nroundtrip test here!" &&
+- printf "$text" | iconv -f UTF-8 -t SHIFT-JIS >roundtrip.shift &&
+- printf "$text" | iconv -f UTF-8 -t UTF-16 >roundtrip.utf16 &&
+- echo "*.shift text working-tree-encoding=SHIFT-JIS" >>.gitattributes &&
+-
+- # SHIFT-JIS encoded files are round-trip checked by default...
+- GIT_TRACE=1 git add .gitattributes roundtrip.shift 2>&1 |
+- grep "Checking roundtrip encoding for SHIFT-JIS" &&
+- git reset &&
+-
+- # ... unless we overwrite the Git config!
+- ! GIT_TRACE=1 git -c core.checkRoundtripEncoding=garbage \
+- add .gitattributes roundtrip.shift 2>&1 |
+- grep "Checking roundtrip encoding for SHIFT-JIS" &&
+- git reset &&
+-
+- # UTF-16 encoded files should not be round-trip checked by default...
+- ! GIT_TRACE=1 git add roundtrip.utf16 2>&1 |
+- grep "Checking roundtrip encoding for UTF-16" &&
+- git reset &&
+-
+- # ... unless we tell Git to check it!
+- GIT_TRACE=1 git -c core.checkRoundtripEncoding="UTF-16, UTF-32" \
+- add roundtrip.utf16 2>&1 |
+- grep "Checking roundtrip encoding for utf-16" &&
+- git reset &&
+-
+- # ... unless we tell Git to check it!
+- # (here we also check that the casing of the encoding is irrelevant)
+- GIT_TRACE=1 git -c core.checkRoundtripEncoding="UTF-32, utf-16" \
+- add roundtrip.utf16 2>&1 |
+- grep "Checking roundtrip encoding for utf-16" &&
+- git reset
+-'
+-
+ test_done
diff --git a/system/kmod/APKBUILD b/system/kmod/APKBUILD
index b0aab15a3..2499dcdd6 100644
--- a/system/kmod/APKBUILD
+++ b/system/kmod/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=kmod
-pkgver=24
-pkgrel=1
+pkgver=25
+pkgrel=0
pkgdesc="Linux kernel module management utilities"
url="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary"
arch="all"
@@ -61,6 +61,6 @@ bashcomp() {
}
-sha512sums="58c8da100418b6325de1595bceee4115cbdd7151d03a028c0b1f6d5d3e6611c667e27f3a0245d29781125581849fd1e854fa8d87b63c4b8fa3f196d0a97e1779 kmod-24.tar.xz
+sha512sums="d579cd0cea24a06362a74927b7a3c777e9e01c990306e1032e4781cd441ffe435c70f2c2c4f6ae39eb1d857e622746411d5824d0c0d8bb79f91dc9fa51956252 kmod-25.tar.xz
f2ea3527bfba182c5e15557c224a5bba8c7e2ea3d21cf604e6eb2277226dcf983c3aeb9ac44a322c7f2b4942b35135da999d63a5b946b829d3f3b09c050a0f17 strndupa.patch
7f0f89fe98167f71b7924f341ba701d001158225463c2f5e39f706a0224b1e952ee901b441f28cb15787563e83bb6e54eb752bf8669ae7c0ffbb11984542f354 kmod-static-nodes.initd"
diff --git a/system/libarchive/APKBUILD b/system/libarchive/APKBUILD
index 6acf2a96a..c3f3ceef6 100644
--- a/system/libarchive/APKBUILD
+++ b/system/libarchive/APKBUILD
@@ -1,19 +1,18 @@
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libarchive
-pkgver=3.3.2
-pkgrel=5
+pkgver=3.3.3
+pkgrel=0
pkgdesc="Library for creating and reading streaming archives"
url="http://libarchive.org/"
arch="all"
+options="!check" # needs EUC-JP and KOI8R support in iconv
license="BSD-2-Clause AND BSD-3-Clause AND Public-Domain"
makedepends="zlib-dev bzip2-dev xz-dev lz4-dev acl-dev openssl-dev expat-dev
attr-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="http://www.libarchive.org/downloads/$pkgname-$pkgver.tar.gz
- seek-error.patch
- CVE-2017-14166.patch"
-options="!check" # needs EUC-JP and KOI8R support in iconv
+ seek-error.patch"
builddir="$srcdir/$pkgname-$pkgver"
# secfixes:
@@ -57,6 +56,5 @@ tools() {
ln -s bsdcpio "$subpkgdir"/usr/bin/cpio
}
-sha512sums="1e538cd7d492f54b11c16c56f12c1632ba14302a3737ec0db786272aec0c8020f1e27616a7654d57e26737e5ed9bfc9a62f1fdda61a95c39eb726aa7c2f673e4 libarchive-3.3.2.tar.gz
-ff2567f243ba7e9ce20bc4f7fa422a922c5c23049004efdd8f71f29f93ab9be9aadd4c100e8c6dca318442d583fbad9bd6466017a23f83af18b9808c718b9fce seek-error.patch
-7cc9dbafd970c07fb4421b7a72a075cc0a000db77df4432222539c58625c93c45f01a144838b551980bc0c6dc5b4c3ab852eb1433006c3174581ba0897010dbe CVE-2017-14166.patch"
+sha512sums="9d12b47d6976efa9f98e62c25d8b85fd745d4e9ca7b7e6d36bfe095dfe5c4db017d4e785d110f3758f5938dad6f1a1b009267fd7e82cb7212e93e1aea237bab7 libarchive-3.3.3.tar.gz
+ff2567f243ba7e9ce20bc4f7fa422a922c5c23049004efdd8f71f29f93ab9be9aadd4c100e8c6dca318442d583fbad9bd6466017a23f83af18b9808c718b9fce seek-error.patch"
diff --git a/system/libedit/APKBUILD b/system/libedit/APKBUILD
index 899ee01ab..bd5362f82 100644
--- a/system/libedit/APKBUILD
+++ b/system/libedit/APKBUILD
@@ -1,7 +1,8 @@
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libedit
-pkgver=3.1_p20180525
+pkgver=20180525.3.1
+_realver=${pkgver/.3.1/-3.1}
pkgrel=0
pkgdesc="Library providing line editing, history, and tokenisation functions"
url="http://thrysoee.dk/editline/"
@@ -10,12 +11,11 @@ license="BSD-2-Clause"
depends=""
depends_dev="ncurses-dev" # XXX is this always unconditionally needed?
makedepends="$depends_dev autoconf automake"
-install=""
subpackages="$pkgname-dev $pkgname-doc"
-source="http://thrysoee.dk/editline/libedit-20180525-3.1.tar.gz
+source="http://thrysoee.dk/editline/libedit-$_realver.tar.gz
tinfo.patch
"
-builddir="$srcdir/$pkgname-20180525-3.1"
+builddir="$srcdir/$pkgname-$_realver"
prepare() {
cd "$builddir"
diff --git a/system/libgpg-error/APKBUILD b/system/libgpg-error/APKBUILD
index 4f8222cb9..803410a29 100644
--- a/system/libgpg-error/APKBUILD
+++ b/system/libgpg-error/APKBUILD
@@ -1,22 +1,19 @@
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libgpg-error
-pkgver=1.31
+pkgver=1.32
pkgrel=0
pkgdesc="GnuPG runtime library"
-url="http://www.gnupg.org"
+url="https://www.gnupg.org"
arch="all"
license="LGPL-2.1+"
depends=""
-depends_dev=""
makedepends=""
-install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-lisp:lisp:noarch"
source="ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2
"
-builddir="$srcdir"/$pkgname-$pkgver
-build () {
+build() {
cd "$builddir"
./configure \
--build=$CBUILD \
@@ -43,4 +40,4 @@ lisp() {
mv "$pkgdir"/usr/share "$subpkgdir"/usr/share/
}
-sha512sums="23983470be51035b2bc0cdbfa20f0915aec92c53c964c645eac51ba4e992b8436bd3a21f0b48d77d7c4ef178d2aacaf57ab33c7fad24b4f96f4ffb1d7116e67f libgpg-error-1.31.tar.bz2"
+sha512sums="0130af48fe81f4db401635757d22a330455aab5dc27edfffad44b7c7c5c439399e92d234c9e00f4d3a399646b52e06c95d53196ea19f5a166817e2032511cb20 libgpg-error-1.32.tar.bz2"
diff --git a/system/libuv/APKBUILD b/system/libuv/APKBUILD
index 3ccba6e53..30dfc1ed6 100644
--- a/system/libuv/APKBUILD
+++ b/system/libuv/APKBUILD
@@ -2,7 +2,7 @@
# Conttributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libuv
-pkgver=1.19.1
+pkgver=1.23.0
pkgrel=0
pkgdesc="Cross-platform asychronous I/O"
url="http://libuv.org"
@@ -11,6 +11,7 @@ license="MIT AND BSD-2-Clause AND BSD-3-Clause AND ISC"
makedepends="automake autoconf libtool linux-headers"
subpackages="$pkgname-dev"
source="https://dist.libuv.org/dist/v$pkgver/$pkgname-v$pkgver.tar.gz
+ disable-process-priority.patch
disable-setuid-test.patch
"
builddir="$srcdir/$pkgname-v$pkgver"
@@ -46,5 +47,6 @@ package() {
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
-sha512sums="516b17afe5ea12f5c53abe68ea5fac9853f20c89fff754c054c041bb9d88a55e5a691842e509348617444f6080311c963707dd272c91c7ff7baf2c4d516b2d7f libuv-v1.19.1.tar.gz
+sha512sums="1fe36cf285bdcfee485633e095e731999485ea156f07769c0ff277df5e4e1314c434021b4b697cef8e7e7e4299b24b7ee837f3f6348b27b300feb6e6c2781e4d libuv-v1.23.0.tar.gz
+58bc259a0f703fa6b8dda14909f718e14dfb9ddc9039ae13378f7e32e0ff7096774cbfb2964a0abb06f8a64a71cf298cc77b7475927df0fb50ce3f0e414a7787 disable-process-priority.patch
478d25c8905cd393b9ced0f1b16e70794a7ef20fb9eb212fd74e50beca3f5a33a6a5267616abecf470426ed3d00efec51df468745ff43c0de05c0ad8234f1eb3 disable-setuid-test.patch"
diff --git a/system/libuv/disable-process-priority.patch b/system/libuv/disable-process-priority.patch
new file mode 100644
index 000000000..f0f41fc95
--- /dev/null
+++ b/system/libuv/disable-process-priority.patch
@@ -0,0 +1,22 @@
+--- libuv-v1.23.0/test/test-list.h.old 2018-08-17 02:05:34.000000000 +0000
++++ libuv-v1.23.0/test/test-list.h 2018-09-05 19:06:26.360000000 +0000
+@@ -214,7 +214,9 @@
+ TEST_DECLARE (pipe_set_non_blocking)
+ TEST_DECLARE (pipe_set_chmod)
+ TEST_DECLARE (process_ref)
++#if 0
+ TEST_DECLARE (process_priority)
++#endif
+ TEST_DECLARE (has_ref)
+ TEST_DECLARE (active)
+ TEST_DECLARE (embed)
+@@ -690,7 +692,9 @@
+ TEST_ENTRY (pipe_ref4)
+ TEST_HELPER (pipe_ref4, pipe_echo_server)
+ TEST_ENTRY (process_ref)
++#if 0
+ TEST_ENTRY (process_priority)
++#endif
+ TEST_ENTRY (has_ref)
+
+ TEST_ENTRY (loop_handles)
diff --git a/system/man-db/APKBUILD b/system/man-db/APKBUILD
index 266a6fc93..e8b60b75f 100644
--- a/system/man-db/APKBUILD
+++ b/system/man-db/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=man-db
-pkgver=2.8.3
-pkgrel=1
+pkgver=2.8.4
+pkgrel=0
pkgdesc="The man command and related utilities for examining on-line help files"
url="http://www.nongnu.org/man-db/"
arch="all"
@@ -39,9 +39,8 @@ check() {
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
- rm "${pkgdir}"/usr/lib/charset.alias
rm -r "${pkgdir}"/usr/lib/tmpfiles.d # systemd
}
-sha512sums="35d5dda7a2bda94978d10770d24d4c78b3c62c71a68cfeb400df61b0df289ed17aa8aa223d4ae3ffa094d76df8d9172b878230fd7b0397ce7728b9c8ac0b1745 man-db-2.8.3.tar.xz
+sha512sums="3cc160a5a8a0a4e918f6f6546582d1e5fe9851a13c5bd8dc94e3fcbf4ec28cb3cd1524b1ae30722931c84981fa8ca9ac64c9c4d9544c2d0bea80ac9f39cb5e66 man-db-2.8.4.tar.xz
4bc9efaafa30dedb6da9d2a62436cf570bef5603b98494ca3c565c3e338b57a481ed40af2312a20cd9f64f965fc0c45607403d829339700c57f9dc0022d7c6ed man-db-2.8.3-iconv.patch"
diff --git a/system/mpfr3/APKBUILD b/system/mpfr3/APKBUILD
index 5d8b4e012..b648abf1a 100644
--- a/system/mpfr3/APKBUILD
+++ b/system/mpfr3/APKBUILD
@@ -3,7 +3,7 @@ pkgname=mpfr3
pkgver=3.1.6
pkgrel=0
pkgdesc="multiple-precision floating-point library"
-url="http://www.mpfr.org/"
+url="https://www.mpfr.org/"
arch="all"
license="LGPL-3.0+"
depends=""
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD
index adb527d8a..0505e9ebd 100644
--- a/system/musl/APKBUILD
+++ b/system/musl/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=musl
-pkgver=1.1.19
-pkgrel=13
+pkgver=1.1.20
+pkgrel=0
pkgdesc="System library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -72,6 +72,7 @@ package() {
s390*) ARCH="s390x" ;;
mips64*) ARCH="mips64" ;;
mips*) ARCH="mips" ;;
+ m68k) ARCH="m68k" ;;
esac
make ARCH="$ARCH" prefix=/usr DESTDIR="$pkgdir" install-headers
@@ -107,8 +108,8 @@ utils() {
install -D -m755 "$srcdir"/ldconfig "$subpkgdir"/sbin
}
-sha512sums="abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz
-b93eb56efadf4ac7e25be6cca22ef99553000e2c2d50f37cfa1430d2f5194cead34b4ca1afc394e97bda0b02eb916c2b85435e58bef686ce8b556546cf957880 amalgamation.patch
+sha512sums="d3a7a30aa375ca50d7dcfbd618581d59e1aa5378417f50a0ca5510099336fd74cc9db468e05c93dda3067abd890f6bd47af226c3446bb833adf0a5054bff2e5d musl-1.1.20.tar.gz
+3162b778101a46d9fb3a38927e3c4969781ccdabb9bb72de10d48ea31691215ecba605faee945ed86144a7e31fc948c31c2fee2881dc07897be3e82b6c6ff1e6 amalgamation.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
88ae443dbb8e0a4368235bdc3a1c5c7b718495afa75e06deb8e01becc76cb1f0d6964589e2204fc749c9c1b3190b8b9ac1ae2c0099cab8e2ce3ec877103d4332 3001-make-real-lastlog-h.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
diff --git a/system/musl/amalgamation.patch b/system/musl/amalgamation.patch
index 96dd545d9..d4d4465dc 100644
--- a/system/musl/amalgamation.patch
+++ b/system/musl/amalgamation.patch
@@ -1,2702 +1,3 @@
-diff --git a/Makefile b/Makefile
-index 308ddaae..e23a8332 100644
---- a/Makefile
-+++ b/Makefile
-@@ -116,17 +116,14 @@ obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
- OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
- $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
-
--MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c
--$(MEMOPS_SRCS:%.c=obj/%.o) $(MEMOPS_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
--
--NOSSP_SRCS = $(wildcard crt/*.c) \
-- src/env/__libc_start_main.c src/env/__init_tls.c \
-- src/env/__stack_chk_fail.c \
-- src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \
-- src/string/memset.c src/string/$(ARCH)/memset.c \
-- src/string/memcpy.c src/string/$(ARCH)/memcpy.c \
-- ldso/dlstart.c ldso/dynlink.c
--$(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
-+MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS))
-+$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
-+
-+NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \
-+ %/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \
-+ %/__set_thread_area.o %/memset.o %/memcpy.o \
-+ , $(LIBC_OBJS))
-+$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
-
- $(CRT_OBJS): CFLAGS_ALL += -DCRT
-
-diff --git a/arch/aarch64/bits/hwcap.h b/arch/aarch64/bits/hwcap.h
-index 11396d31..8541e329 100644
---- a/arch/aarch64/bits/hwcap.h
-+++ b/arch/aarch64/bits/hwcap.h
-@@ -14,3 +14,15 @@
- #define HWCAP_JSCVT (1 << 13)
- #define HWCAP_FCMA (1 << 14)
- #define HWCAP_LRCPC (1 << 15)
-+#define HWCAP_DCPOP (1 << 16)
-+#define HWCAP_SHA3 (1 << 17)
-+#define HWCAP_SM3 (1 << 18)
-+#define HWCAP_SM4 (1 << 19)
-+#define HWCAP_ASIMDDP (1 << 20)
-+#define HWCAP_SHA512 (1 << 21)
-+#define HWCAP_SVE (1 << 22)
-+#define HWCAP_ASIMDFHM (1 << 23)
-+#define HWCAP_DIT (1 << 24)
-+#define HWCAP_USCAT (1 << 25)
-+#define HWCAP_ILRCPC (1 << 26)
-+#define HWCAP_FLAGM (1 << 27)
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index 1c67313d..b71261f5 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -25,6 +25,7 @@ typedef struct sigcontext {
- #define FPSIMD_MAGIC 0x46508001
- #define ESR_MAGIC 0x45535201
- #define EXTRA_MAGIC 0x45585401
-+#define SVE_MAGIC 0x53564501
- struct _aarch64_ctx {
- unsigned int magic;
- unsigned int size;
-@@ -45,6 +46,44 @@ struct extra_context {
- unsigned int size;
- unsigned int __reserved[3];
- };
-+struct sve_context {
-+ struct _aarch64_ctx head;
-+ unsigned short vl;
-+ unsigned short __reserved[3];
-+};
-+#define SVE_VQ_BYTES 16
-+#define SVE_VQ_MIN 1
-+#define SVE_VQ_MAX 512
-+#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
-+#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
-+#define SVE_NUM_ZREGS 32
-+#define SVE_NUM_PREGS 16
-+#define sve_vl_valid(vl) \
-+ ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
-+#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
-+#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
-+#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
-+#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
-+#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
-+#define SVE_SIG_REGS_OFFSET \
-+ ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
-+ / SVE_VQ_BYTES * SVE_VQ_BYTES)
-+#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
-+#define SVE_SIG_ZREG_OFFSET(vq, n) \
-+ (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
-+#define SVE_SIG_ZREGS_SIZE(vq) \
-+ (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
-+#define SVE_SIG_PREGS_OFFSET(vq) \
-+ (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
-+#define SVE_SIG_PREG_OFFSET(vq, n) \
-+ (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
-+#define SVE_SIG_PREGS_SIZE(vq) \
-+ (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
-+#define SVE_SIG_FFR_OFFSET(vq) \
-+ (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
-+#define SVE_SIG_REGS_SIZE(vq) \
-+ (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
-+#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
- #else
- typedef struct {
- long double __regs[18+256];
-diff --git a/arch/aarch64/pthread_arch.h b/arch/aarch64/pthread_arch.h
-index b2e2d8f1..e8499d8e 100644
---- a/arch/aarch64/pthread_arch.h
-+++ b/arch/aarch64/pthread_arch.h
-@@ -2,10 +2,11 @@ static inline struct pthread *__pthread_self()
- {
- char *self;
- __asm__ __volatile__ ("mrs %0,tpidr_el0" : "=r"(self));
-- return (void*)(self + 16 - sizeof(struct pthread));
-+ return (void*)(self - sizeof(struct pthread));
- }
-
- #define TLS_ABOVE_TP
--#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 16)
-+#define GAP_ABOVE_TP 16
-+#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
-
- #define MC_PC pc
-diff --git a/arch/aarch64/reloc.h b/arch/aarch64/reloc.h
-index 51b66e23..40cf0b28 100644
---- a/arch/aarch64/reloc.h
-+++ b/arch/aarch64/reloc.h
-@@ -10,7 +10,7 @@
-
- #define NO_LEGACY_INITFINI
-
--#define TPOFF_K 16
-+#define TPOFF_K 0
-
- #define REL_SYMBOLIC R_AARCH64_ABS64
- #define REL_GOT R_AARCH64_GLOB_DAT
-diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h
-index c5c56f81..62458b45 100644
---- a/arch/arm/atomic_arch.h
-+++ b/arch/arm/atomic_arch.h
-@@ -7,8 +7,8 @@
- extern uintptr_t __attribute__((__visibility__("hidden")))
- __a_cas_ptr, __a_barrier_ptr;
-
--#if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \
-- || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
-+#if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
-+ || __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
-
- #define a_ll a_ll
- static inline int a_ll(volatile int *p)
-@@ -91,4 +91,16 @@ static inline int a_clz_32(uint32_t x)
- return x;
- }
-
-+#if __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
-+
-+#define a_ctz_32 a_ctz_32
-+static inline int a_ctz_32(uint32_t x)
-+{
-+ uint32_t xr;
-+ __asm__ ("rbit %0, %1" : "=r"(xr) : "r"(x));
-+ return a_clz_32(xr);
-+}
-+
-+#endif
-+
- #endif
-diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
-index c594152e..1920516a 100644
---- a/arch/arm/bits/syscall.h.in
-+++ b/arch/arm/bits/syscall.h.in
-@@ -359,4 +359,5 @@
- #define __ARM_NR_usr26 0x0f0003
- #define __ARM_NR_usr32 0x0f0004
- #define __ARM_NR_set_tls 0x0f0005
-+#define __ARM_NR_get_tls 0x0f0006
-
-diff --git a/arch/arm/pthread_arch.h b/arch/arm/pthread_arch.h
-index 197752ef..8f2ae8f8 100644
---- a/arch/arm/pthread_arch.h
-+++ b/arch/arm/pthread_arch.h
-@@ -1,11 +1,11 @@
--#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \
-+#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
- || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
-
- static inline pthread_t __pthread_self()
- {
- char *p;
- __asm__ __volatile__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(p) );
-- return (void *)(p+8-sizeof(struct pthread));
-+ return (void *)(p-sizeof(struct pthread));
- }
-
- #else
-@@ -21,12 +21,13 @@ static inline pthread_t __pthread_self()
- extern uintptr_t __attribute__((__visibility__("hidden"))) __a_gettp_ptr;
- register uintptr_t p __asm__("r0");
- __asm__ __volatile__ ( BLX " %1" : "=r"(p) : "r"(__a_gettp_ptr) : "cc", "lr" );
-- return (void *)(p+8-sizeof(struct pthread));
-+ return (void *)(p-sizeof(struct pthread));
- }
-
- #endif
-
- #define TLS_ABOVE_TP
--#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
-+#define GAP_ABOVE_TP 8
-+#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
-
- #define MC_PC arm_pc
-diff --git a/arch/arm/reloc.h b/arch/arm/reloc.h
-index b175711d..4b00bf64 100644
---- a/arch/arm/reloc.h
-+++ b/arch/arm/reloc.h
-@@ -16,7 +16,7 @@
-
- #define NO_LEGACY_INITFINI
-
--#define TPOFF_K 8
-+#define TPOFF_K 0
-
- #define REL_SYMBOLIC R_ARM_ABS32
- #define REL_GOT R_ARM_GLOB_DAT
-diff --git a/arch/arm/syscall_arch.h b/arch/arm/syscall_arch.h
-index 6023303b..53fb155c 100644
---- a/arch/arm/syscall_arch.h
-+++ b/arch/arm/syscall_arch.h
-@@ -3,74 +3,99 @@
- ((union { long long ll; long l[2]; }){ .ll = x }).l[1]
- #define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
-
-+#ifdef __thumb__
-+
-+/* Avoid use of r7 in asm constraints when producing thumb code,
-+ * since it's reserved as frame pointer and might not be supported. */
-+#define __ASM____R7__
-+#define __asm_syscall(...) do { \
-+ __asm__ __volatile__ ( "mov %1,r7 ; mov r7,%2 ; svc 0 ; mov r7,%1" \
-+ : "=r"(r0), "=&r"((int){0}) : __VA_ARGS__ : "memory"); \
-+ return r0; \
-+ } while (0)
-+
-+#else
-+
-+#define __ASM____R7__ __asm__("r7")
- #define __asm_syscall(...) do { \
- __asm__ __volatile__ ( "svc 0" \
- : "=r"(r0) : __VA_ARGS__ : "memory"); \
- return r0; \
- } while (0)
-+#endif
-+
-+/* For thumb2, we can allow 8-bit immediate syscall numbers, saving a
-+ * register in the above dance around r7. Does not work for thumb1 where
-+ * only movs, not mov, supports immediates, and we can't use movs because
-+ * it doesn't support high regs. */
-+#ifdef __thumb2__
-+#define R7_OPERAND "rI"(r7)
-+#else
-+#define R7_OPERAND "r"(r7)
-+#endif
-
- static inline long __syscall0(long n)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0");
-- __asm_syscall("r"(r7));
-+ __asm_syscall(R7_OPERAND);
- }
-
- static inline long __syscall1(long n, long a)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
-- __asm_syscall("r"(r7), "0"(r0));
-+ __asm_syscall(R7_OPERAND, "0"(r0));
- }
-
- static inline long __syscall2(long n, long a, long b)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
- register long r1 __asm__("r1") = b;
-- __asm_syscall("r"(r7), "0"(r0), "r"(r1));
-+ __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1));
- }
-
- static inline long __syscall3(long n, long a, long b, long c)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
- register long r1 __asm__("r1") = b;
- register long r2 __asm__("r2") = c;
-- __asm_syscall("r"(r7), "0"(r0), "r"(r1), "r"(r2));
-+ __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2));
- }
-
- static inline long __syscall4(long n, long a, long b, long c, long d)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
- register long r1 __asm__("r1") = b;
- register long r2 __asm__("r2") = c;
- register long r3 __asm__("r3") = d;
-- __asm_syscall("r"(r7), "0"(r0), "r"(r1), "r"(r2), "r"(r3));
-+ __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3));
- }
-
- static inline long __syscall5(long n, long a, long b, long c, long d, long e)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
- register long r1 __asm__("r1") = b;
- register long r2 __asm__("r2") = c;
- register long r3 __asm__("r3") = d;
- register long r4 __asm__("r4") = e;
-- __asm_syscall("r"(r7), "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
-+ __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
- }
-
- static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
- {
-- register long r7 __asm__("r7") = n;
-+ register long r7 __ASM____R7__ = n;
- register long r0 __asm__("r0") = a;
- register long r1 __asm__("r1") = b;
- register long r2 __asm__("r2") = c;
- register long r3 __asm__("r3") = d;
- register long r4 __asm__("r4") = e;
- register long r5 __asm__("r5") = f;
-- __asm_syscall("r"(r7), "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
-+ __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
- }
-
- #define VDSO_USEFUL
-@@ -78,3 +103,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
- #define VDSO_CGT_VER "LINUX_2.6"
-
- #define SYSCALL_FADVISE_6_ARG
-+
-+#define SYSCALL_IPC_BROKEN_MODE
-diff --git a/arch/generic/bits/kd.h b/arch/generic/bits/kd.h
-new file mode 100644
-index 00000000..33b873f4
---- /dev/null
-+++ b/arch/generic/bits/kd.h
-@@ -0,0 +1 @@
-+#include <linux/kd.h>
-diff --git a/arch/generic/bits/ptrace.h b/arch/generic/bits/ptrace.h
-new file mode 100644
-index 00000000..e69de29b
-diff --git a/arch/generic/bits/soundcard.h b/arch/generic/bits/soundcard.h
-new file mode 100644
-index 00000000..fade986f
---- /dev/null
-+++ b/arch/generic/bits/soundcard.h
-@@ -0,0 +1 @@
-+#include <linux/soundcard.h>
-diff --git a/arch/generic/bits/termios.h b/arch/generic/bits/termios.h
-index 434c02c8..124f71d2 100644
---- a/arch/generic/bits/termios.h
-+++ b/arch/generic/bits/termios.h
-@@ -51,6 +51,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0000400
- #define NL0 0000000
- #define NL1 0000400
-@@ -70,6 +71,7 @@ struct termios {
- #define FFDLY 0100000
- #define FF0 0000000
- #define FF1 0100000
-+#endif
-
- #define VTDLY 0040000
- #define VT0 0000000
-diff --git a/arch/generic/bits/vt.h b/arch/generic/bits/vt.h
-new file mode 100644
-index 00000000..834abfbc
---- /dev/null
-+++ b/arch/generic/bits/vt.h
-@@ -0,0 +1 @@
-+#include <linux/vt.h>
-diff --git a/arch/i386/atomic_arch.h b/arch/i386/atomic_arch.h
-index 7d2a48a5..047fb68d 100644
---- a/arch/i386/atomic_arch.h
-+++ b/arch/i386/atomic_arch.h
-@@ -92,10 +92,10 @@ static inline int a_ctz_64(uint64_t x)
- return r;
- }
-
--#define a_ctz_l a_ctz_l
--static inline int a_ctz_l(unsigned long x)
-+#define a_ctz_32 a_ctz_32
-+static inline int a_ctz_32(uint32_t x)
- {
-- long r;
-+ int r;
- __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
- return r;
- }
-diff --git a/arch/i386/bits/limits.h b/arch/i386/bits/limits.h
-index 65a3dd64..c340ceb2 100644
---- a/arch/i386/bits/limits.h
-+++ b/arch/i386/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 4096
-+#define PAGESIZE 4096
- #define LONG_BIT 32
- #endif
-
-diff --git a/arch/i386/bits/ptrace.h b/arch/i386/bits/ptrace.h
-new file mode 100644
-index 00000000..7d0efbf3
---- /dev/null
-+++ b/arch/i386/bits/ptrace.h
-@@ -0,0 +1,11 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_SYSEMU 31
-+#define PTRACE_SYSEMU_SINGLESTEP 32
-+#define PTRACE_SINGLEBLOCK 33
-+
-+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
-+#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
-+#define PT_SYSEMU PTRACE_SYSEMU
-+#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/i386/bits/user.h b/arch/i386/bits/user.h
-index 0e343930..33fea986 100644
---- a/arch/i386/bits/user.h
-+++ b/arch/i386/bits/user.h
-@@ -37,8 +37,8 @@ struct user {
- int u_debugreg[8];
- };
-
--#define PAGE_MASK (~(PAGE_SIZE-1))
--#define NBPG PAGE_SIZE
-+#define PAGE_MASK (~(PAGESIZE-1))
-+#define NBPG PAGESIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
- #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-diff --git a/arch/m68k/atomic_arch.h b/arch/m68k/atomic_arch.h
-new file mode 100644
-index 00000000..b369649a
---- /dev/null
-+++ b/arch/m68k/atomic_arch.h
-@@ -0,0 +1,8 @@
-+#define a_cas a_cas
-+static inline int a_cas(volatile int *p, int t, int s)
-+{
-+ __asm__ __volatile__ (
-+ "cas.l %0, %2, (%1)"
-+ : "+d"(t) : "a"(p), "d"(s) : "memory", "cc");
-+ return t;
-+}
-diff --git a/arch/m68k/bits/alltypes.h.in b/arch/m68k/bits/alltypes.h.in
-new file mode 100644
-index 00000000..a4a8141f
---- /dev/null
-+++ b/arch/m68k/bits/alltypes.h.in
-@@ -0,0 +1,31 @@
-+#define _Addr int
-+#define _Int64 long long
-+#define _Reg int
-+
-+TYPEDEF __builtin_va_list va_list;
-+TYPEDEF __builtin_va_list __isoc_va_list;
-+
-+#ifndef __cplusplus
-+TYPEDEF long wchar_t;
-+#endif
-+
-+#if __mcffpu__
-+TYPEDEF float float_t;
-+TYPEDEF double double_t;
-+#else
-+TYPEDEF long double float_t;
-+TYPEDEF long double double_t;
-+#endif
-+
-+TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
-+
-+TYPEDEF long time_t;
-+TYPEDEF long suseconds_t;
-+
-+TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
-+TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
-+TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
-+TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
-+TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
-+TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-+TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
-diff --git a/arch/m68k/bits/endian.h b/arch/m68k/bits/endian.h
-new file mode 100644
-index 00000000..ef074b77
---- /dev/null
-+++ b/arch/m68k/bits/endian.h
-@@ -0,0 +1 @@
-+#define __BYTE_ORDER __BIG_ENDIAN
-diff --git a/arch/m68k/bits/fcntl.h b/arch/m68k/bits/fcntl.h
-new file mode 100644
-index 00000000..f1c8400f
---- /dev/null
-+++ b/arch/m68k/bits/fcntl.h
-@@ -0,0 +1,40 @@
-+#define O_CREAT 0100
-+#define O_EXCL 0200
-+#define O_NOCTTY 0400
-+#define O_TRUNC 01000
-+#define O_APPEND 02000
-+#define O_NONBLOCK 04000
-+#define O_DSYNC 010000
-+#define O_SYNC 04010000
-+#define O_RSYNC 04010000
-+#define O_DIRECTORY 040000
-+#define O_NOFOLLOW 0100000
-+#define O_CLOEXEC 02000000
-+
-+#define O_ASYNC 020000
-+#define O_DIRECT 0200000
-+#define O_LARGEFILE 0400000
-+#define O_NOATIME 01000000
-+#define O_PATH 010000000
-+#define O_TMPFILE 020200000
-+#define O_NDELAY O_NONBLOCK
-+
-+#define F_DUPFD 0
-+#define F_GETFD 1
-+#define F_SETFD 2
-+#define F_GETFL 3
-+#define F_SETFL 4
-+
-+#define F_SETOWN 8
-+#define F_GETOWN 9
-+#define F_SETSIG 10
-+#define F_GETSIG 11
-+
-+#define F_GETLK 12
-+#define F_SETLK 13
-+#define F_SETLKW 14
-+
-+#define F_SETOWN_EX 15
-+#define F_GETOWN_EX 16
-+
-+#define F_GETOWNER_UIDS 17
-diff --git a/arch/m68k/bits/fenv.h b/arch/m68k/bits/fenv.h
-new file mode 100644
-index 00000000..c90a4a58
---- /dev/null
-+++ b/arch/m68k/bits/fenv.h
-@@ -0,0 +1,29 @@
-+#if __HAVE_68881__ || __mcffpu__
-+
-+#define FE_INEXACT 8
-+#define FE_DIVBYZERO 16
-+#define FE_UNDERFLOW 32
-+#define FE_OVERFLOW 64
-+#define FE_INVALID 128
-+
-+#define FE_ALL_EXCEPT 0xf8
-+
-+#define FE_TONEAREST 0
-+#define FE_TOWARDZERO 16
-+#define FE_DOWNWARD 32
-+#define FE_UPWARD 48
-+
-+#else
-+
-+#define FE_ALL_EXCEPT 0
-+#define FE_TONEAREST 0
-+
-+#endif
-+
-+typedef unsigned fexcept_t;
-+
-+typedef struct {
-+ unsigned __control_register, __status_register, __instruction_address;
-+} fenv_t;
-+
-+#define FE_DFL_ENV ((const fenv_t *) -1)
-diff --git a/arch/m68k/bits/float.h b/arch/m68k/bits/float.h
-new file mode 100644
-index 00000000..0e6899d5
---- /dev/null
-+++ b/arch/m68k/bits/float.h
-@@ -0,0 +1,39 @@
-+#if !__mcffpu__
-+
-+#define FLT_EVAL_METHOD 2
-+
-+#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
-+#define LDBL_MIN 1.68105157155604675313e-4932L
-+#define LDBL_MAX 1.1897314953572317650e+4932L
-+#define LDBL_EPSILON 1.0842021724855044340e-19L
-+
-+#define LDBL_MANT_DIG 64
-+#define LDBL_MIN_EXP (-16382)
-+#define LDBL_MAX_EXP 16384
-+
-+#define LDBL_DIG 18
-+#define LDBL_MIN_10_EXP (-4931)
-+#define LDBL_MAX_10_EXP 4932
-+
-+#define DECIMAL_DIG 21
-+
-+#else
-+
-+#define FLT_EVAL_METHOD 0
-+
-+#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
-+#define LDBL_MIN 2.22507385850720138309e-308L
-+#define LDBL_MAX 1.79769313486231570815e+308L
-+#define LDBL_EPSILON 2.22044604925031308085e-16L
-+
-+#define LDBL_MANT_DIG 53
-+#define LDBL_MIN_EXP (-1021)
-+#define LDBL_MAX_EXP 1024
-+
-+#define LDBL_DIG 15
-+#define LDBL_MIN_10_EXP (-307)
-+#define LDBL_MAX_10_EXP 308
-+
-+#define DECIMAL_DIG 17
-+
-+#endif
-diff --git a/arch/m68k/bits/limits.h b/arch/m68k/bits/limits.h
-new file mode 100644
-index 00000000..fbc6d238
---- /dev/null
-+++ b/arch/m68k/bits/limits.h
-@@ -0,0 +1,7 @@
-+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
-+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-+#define LONG_BIT 32
-+#endif
-+
-+#define LONG_MAX 0x7fffffffL
-+#define LLONG_MAX 0x7fffffffffffffffLL
-diff --git a/arch/m68k/bits/posix.h b/arch/m68k/bits/posix.h
-new file mode 100644
-index 00000000..30a38714
---- /dev/null
-+++ b/arch/m68k/bits/posix.h
-@@ -0,0 +1,2 @@
-+#define _POSIX_V6_ILP32_OFFBIG 1
-+#define _POSIX_V7_ILP32_OFFBIG 1
-diff --git a/arch/m68k/bits/ptrace.h b/arch/m68k/bits/ptrace.h
-new file mode 100644
-index 00000000..da93e7a7
---- /dev/null
-+++ b/arch/m68k/bits/ptrace.h
-@@ -0,0 +1,2 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SINGLEBLOCK 33
-diff --git a/arch/m68k/bits/reg.h b/arch/m68k/bits/reg.h
-new file mode 100644
-index 00000000..99201f70
---- /dev/null
-+++ b/arch/m68k/bits/reg.h
-@@ -0,0 +1,45 @@
-+#undef __WORDSIZE
-+#define __WORDSIZE 32
-+#define PT_D1 0
-+#define PT_D2 1
-+#define PT_D3 2
-+#define PT_D4 3
-+#define PT_D5 4
-+#define PT_D6 5
-+#define PT_D7 6
-+#define PT_A0 7
-+#define PT_A1 8
-+#define PT_A2 9
-+#define PT_A3 10
-+#define PT_A4 11
-+#define PT_A5 12
-+#define PT_A6 13
-+#define PT_D0 14
-+#define PT_USP 15
-+#define PT_ORIG_D0 16
-+#define PT_SR 17
-+#define PT_PC 18
-+
-+#if __mcffpu__
-+#define PT_FP0 21
-+#define PT_FP1 23
-+#define PT_FP2 25
-+#define PT_FP3 27
-+#define PT_FP4 29
-+#define PT_FP5 31
-+#define PT_FP6 33
-+#define PT_FP7 35
-+#else
-+#define PT_FP0 21
-+#define PT_FP1 24
-+#define PT_FP2 27
-+#define PT_FP3 30
-+#define PT_FP4 33
-+#define PT_FP5 36
-+#define PT_FP6 39
-+#define PT_FP7 42
-+#endif
-+
-+#define PT_FPCR 45
-+#define PT_FPSR 46
-+#define PT_FPIAR 47
-diff --git a/arch/m68k/bits/setjmp.h b/arch/m68k/bits/setjmp.h
-new file mode 100644
-index 00000000..5e091fb4
---- /dev/null
-+++ b/arch/m68k/bits/setjmp.h
-@@ -0,0 +1 @@
-+typedef unsigned long __jmp_buf[39];
-diff --git a/arch/m68k/bits/signal.h b/arch/m68k/bits/signal.h
-new file mode 100644
-index 00000000..2c369ca3
---- /dev/null
-+++ b/arch/m68k/bits/signal.h
-@@ -0,0 +1,140 @@
-+#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
-+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-+
-+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-+#define MINSIGSTKSZ 2048
-+#define SIGSTKSZ 8192
-+#endif
-+
-+#ifdef _GNU_SOURCE
-+enum { R_D0 = 0 };
-+#define R_D0 R_D0
-+enum { R_D1 = 1 };
-+#define R_D1 R_D1
-+enum { R_D2 = 2 };
-+#define R_D2 R_D2
-+enum { R_D3 = 3 };
-+#define R_D3 R_D3
-+enum { R_D4 = 4 };
-+#define R_D4 R_D4
-+enum { R_D5 = 5 };
-+#define R_D5 R_D5
-+enum { R_D6 = 6 };
-+#define R_D6 R_D6
-+enum { R_D7 = 7 };
-+#define R_D7 R_D7
-+enum { R_A0 = 8 };
-+#define R_A0 R_A0
-+enum { R_A1 = 9 };
-+#define R_A1 R_A1
-+enum { R_A2 = 10 };
-+#define R_A2 R_A2
-+enum { R_A3 = 11 };
-+#define R_A3 R_A3
-+enum { R_A4 = 12 };
-+#define R_A4 R_A4
-+enum { R_A5 = 13 };
-+#define R_A5 R_A5
-+enum { R_A6 = 14 };
-+#define R_A6 R_A6
-+enum { R_A7 = 15 };
-+#define R_A7 R_A7
-+enum { R_SP = 15 };
-+#define R_SP R_SP
-+enum { R_PC = 16 };
-+#define R_PC R_PC
-+enum { R_PS = 17 };
-+#define R_PS R_PS
-+#endif
-+
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-+
-+struct sigcontext {
-+ unsigned long sc_mask, sc_usp, sc_d0, sc_d1, sc_a0, sc_a1;
-+ unsigned short sc_sr;
-+ unsigned long sc_pc;
-+ unsigned short sc_formatvec;
-+ unsigned long sc_fpregs[6], sc_fpcntl[3];
-+ unsigned char sc_fpstate[216];
-+};
-+
-+typedef int greg_t, gregset_t[18];
-+typedef struct {
-+ int f_pcr, f_psr, f_fpiaddr, f_fpregs[8][3];
-+} fpregset_t;
-+
-+typedef struct {
-+ int version;
-+ gregset_t gregs;
-+ fpregset_t fpregs;
-+} mcontext_t;
-+#else
-+typedef struct {
-+ int __version;
-+ int __gregs[18];
-+ int __fpregs[27];
-+} mcontext_t;
-+#endif
-+
-+struct sigaltstack {
-+ void *ss_sp;
-+ int ss_flags;
-+ size_t ss_size;
-+};
-+
-+typedef struct __ucontext {
-+ unsigned long uc_flags;
-+ struct __ucontext *uc_link;
-+ stack_t uc_stack;
-+ mcontext_t uc_mcontext;
-+ long __reserved[80];
-+ sigset_t uc_sigmask;
-+} ucontext_t;
-+
-+#define SA_NOCLDSTOP 1
-+#define SA_NOCLDWAIT 2
-+#define SA_SIGINFO 4
-+#define SA_ONSTACK 0x08000000
-+#define SA_RESTART 0x10000000
-+#define SA_NODEFER 0x40000000
-+#define SA_RESETHAND 0x80000000
-+#define SA_RESTORER 0x04000000
-+
-+#endif
-+
-+#define SIGHUP 1
-+#define SIGINT 2
-+#define SIGQUIT 3
-+#define SIGILL 4
-+#define SIGTRAP 5
-+#define SIGABRT 6
-+#define SIGIOT SIGABRT
-+#define SIGBUS 7
-+#define SIGFPE 8
-+#define SIGKILL 9
-+#define SIGUSR1 10
-+#define SIGSEGV 11
-+#define SIGUSR2 12
-+#define SIGPIPE 13
-+#define SIGALRM 14
-+#define SIGTERM 15
-+#define SIGSTKFLT 16
-+#define SIGCHLD 17
-+#define SIGCONT 18
-+#define SIGSTOP 19
-+#define SIGTSTP 20
-+#define SIGTTIN 21
-+#define SIGTTOU 22
-+#define SIGURG 23
-+#define SIGXCPU 24
-+#define SIGXFSZ 25
-+#define SIGVTALRM 26
-+#define SIGPROF 27
-+#define SIGWINCH 28
-+#define SIGIO 29
-+#define SIGPOLL 29
-+#define SIGPWR 30
-+#define SIGSYS 31
-+#define SIGUNUSED SIGSYS
-+
-+#define _NSIG 65
-diff --git a/arch/m68k/bits/stat.h b/arch/m68k/bits/stat.h
-new file mode 100644
-index 00000000..0f7b66a1
---- /dev/null
-+++ b/arch/m68k/bits/stat.h
-@@ -0,0 +1,21 @@
-+/* copied from kernel definition, but with padding replaced
-+ * by the corresponding correctly-sized userspace types. */
-+
-+struct stat {
-+ dev_t st_dev;
-+ short __st_dev_padding;
-+ long __st_ino_truncated;
-+ mode_t st_mode;
-+ nlink_t st_nlink;
-+ uid_t st_uid;
-+ gid_t st_gid;
-+ dev_t st_rdev;
-+ short __st_rdev_padding;
-+ off_t st_size;
-+ blksize_t st_blksize;
-+ blkcnt_t st_blocks;
-+ struct timespec st_atim;
-+ struct timespec st_mtim;
-+ struct timespec st_ctim;
-+ ino_t st_ino;
-+};
-diff --git a/arch/m68k/bits/stdint.h b/arch/m68k/bits/stdint.h
-new file mode 100644
-index 00000000..d1b27121
---- /dev/null
-+++ b/arch/m68k/bits/stdint.h
-@@ -0,0 +1,20 @@
-+typedef int32_t int_fast16_t;
-+typedef int32_t int_fast32_t;
-+typedef uint32_t uint_fast16_t;
-+typedef uint32_t uint_fast32_t;
-+
-+#define INT_FAST16_MIN INT32_MIN
-+#define INT_FAST32_MIN INT32_MIN
-+
-+#define INT_FAST16_MAX INT32_MAX
-+#define INT_FAST32_MAX INT32_MAX
-+
-+#define UINT_FAST16_MAX UINT32_MAX
-+#define UINT_FAST32_MAX UINT32_MAX
-+
-+#define INTPTR_MIN INT32_MIN
-+#define INTPTR_MAX INT32_MAX
-+#define UINTPTR_MAX UINT32_MAX
-+#define PTRDIFF_MIN INT32_MIN
-+#define PTRDIFF_MAX INT32_MAX
-+#define SIZE_MAX UINT32_MAX
-diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
-new file mode 100644
-index 00000000..89cf114c
---- /dev/null
-+++ b/arch/m68k/bits/syscall.h.in
-@@ -0,0 +1,361 @@
-+#define __NR_restart_syscall 0
-+#define __NR_exit 1
-+#define __NR_fork 2
-+#define __NR_read 3
-+#define __NR_write 4
-+#define __NR_open 5
-+#define __NR_close 6
-+#define __NR_waitpid 7
-+#define __NR_creat 8
-+#define __NR_link 9
-+#define __NR_unlink 10
-+#define __NR_execve 11
-+#define __NR_chdir 12
-+#define __NR_time 13
-+#define __NR_mknod 14
-+#define __NR_chmod 15
-+#define __NR_chown 16
-+#define __NR_oldstat 18
-+#define __NR_lseek 19
-+#define __NR_getpid 20
-+#define __NR_mount 21
-+#define __NR_umount 22
-+#define __NR_setuid 23
-+#define __NR_getuid 24
-+#define __NR_stime 25
-+#define __NR_ptrace 26
-+#define __NR_alarm 27
-+#define __NR_oldfstat 28
-+#define __NR_pause 29
-+#define __NR_utime 30
-+#define __NR_access 33
-+#define __NR_nice 34
-+#define __NR_sync 36
-+#define __NR_kill 37
-+#define __NR_rename 38
-+#define __NR_mkdir 39
-+#define __NR_rmdir 40
-+#define __NR_dup 41
-+#define __NR_pipe 42
-+#define __NR_times 43
-+#define __NR_brk 45
-+#define __NR_setgid 46
-+#define __NR_getgid 47
-+#define __NR_signal 48
-+#define __NR_geteuid 49
-+#define __NR_getegid 50
-+#define __NR_acct 51
-+#define __NR_umount2 52
-+#define __NR_ioctl 54
-+#define __NR_fcntl 55
-+#define __NR_setpgid 57
-+#define __NR_umask 60
-+#define __NR_chroot 61
-+#define __NR_ustat 62
-+#define __NR_dup2 63
-+#define __NR_getppid 64
-+#define __NR_getpgrp 65
-+#define __NR_setsid 66
-+#define __NR_sigaction 67
-+#define __NR_sgetmask 68
-+#define __NR_ssetmask 69
-+#define __NR_setreuid 70
-+#define __NR_setregid 71
-+#define __NR_sigsuspend 72
-+#define __NR_sigpending 73
-+#define __NR_sethostname 74
-+#define __NR_setrlimit 75
-+#define __NR_getrlimit 76
-+#define __NR_getrusage 77
-+#define __NR_gettimeofday 78
-+#define __NR_settimeofday 79
-+#define __NR_getgroups 80
-+#define __NR_setgroups 81
-+#define __NR_select 82
-+#define __NR_symlink 83
-+#define __NR_oldlstat 84
-+#define __NR_readlink 85
-+#define __NR_uselib 86
-+#define __NR_swapon 87
-+#define __NR_reboot 88
-+#define __NR_readdir 89
-+#define __NR_mmap 90
-+#define __NR_munmap 91
-+#define __NR_truncate 92
-+#define __NR_ftruncate 93
-+#define __NR_fchmod 94
-+#define __NR_fchown 95
-+#define __NR_getpriority 96
-+#define __NR_setpriority 97
-+#define __NR_statfs 99
-+#define __NR_fstatfs 100
-+#define __NR_socketcall 102
-+#define __NR_syslog 103
-+#define __NR_setitimer 104
-+#define __NR_getitimer 105
-+#define __NR_stat 106
-+#define __NR_lstat 107
-+#define __NR_fstat 108
-+#define __NR_vhangup 111
-+#define __NR_wait4 114
-+#define __NR_swapoff 115
-+#define __NR_sysinfo 116
-+#define __NR_ipc 117
-+#define __NR_fsync 118
-+#define __NR_sigreturn 119
-+#define __NR_clone 120
-+#define __NR_setdomainname 121
-+#define __NR_uname 122
-+#define __NR_cacheflush 123
-+#define __NR_adjtimex 124
-+#define __NR_mprotect 125
-+#define __NR_sigprocmask 126
-+#define __NR_create_module 127
-+#define __NR_init_module 128
-+#define __NR_delete_module 129
-+#define __NR_get_kernel_syms 130
-+#define __NR_quotactl 131
-+#define __NR_getpgid 132
-+#define __NR_fchdir 133
-+#define __NR_bdflush 134
-+#define __NR_sysfs 135
-+#define __NR_personality 136
-+#define __NR_setfsuid 138
-+#define __NR_setfsgid 139
-+#define __NR__llseek 140
-+#define __NR_getdents 141
-+#define __NR__newselect 142
-+#define __NR_flock 143
-+#define __NR_msync 144
-+#define __NR_readv 145
-+#define __NR_writev 146
-+#define __NR_getsid 147
-+#define __NR_fdatasync 148
-+#define __NR__sysctl 149
-+#define __NR_mlock 150
-+#define __NR_munlock 151
-+#define __NR_mlockall 152
-+#define __NR_munlockall 153
-+#define __NR_sched_setparam 154
-+#define __NR_sched_getparam 155
-+#define __NR_sched_setscheduler 156
-+#define __NR_sched_getscheduler 157
-+#define __NR_sched_yield 158
-+#define __NR_sched_get_priority_max 159
-+#define __NR_sched_get_priority_min 160
-+#define __NR_sched_rr_get_interval 161
-+#define __NR_nanosleep 162
-+#define __NR_mremap 163
-+#define __NR_setresuid 164
-+#define __NR_getresuid 165
-+#define __NR_getpagesize 166
-+#define __NR_query_module 167
-+#define __NR_poll 168
-+#define __NR_nfsservctl 169
-+#define __NR_setresgid 170
-+#define __NR_getresgid 171
-+#define __NR_prctl 172
-+#define __NR_rt_sigreturn 173
-+#define __NR_rt_sigaction 174
-+#define __NR_rt_sigprocmask 175
-+#define __NR_rt_sigpending 176
-+#define __NR_rt_sigtimedwait 177
-+#define __NR_rt_sigqueueinfo 178
-+#define __NR_rt_sigsuspend 179
-+#define __NR_pread64 180
-+#define __NR_pwrite64 181
-+#define __NR_lchown 182
-+#define __NR_getcwd 183
-+#define __NR_capget 184
-+#define __NR_capset 185
-+#define __NR_sigaltstack 186
-+#define __NR_sendfile 187
-+#define __NR_getpmsg 188
-+#define __NR_putpmsg 189
-+#define __NR_vfork 190
-+#define __NR_ugetrlimit 191
-+#define __NR_mmap2 192
-+#define __NR_truncate64 193
-+#define __NR_ftruncate64 194
-+#define __NR_stat64 195
-+#define __NR_lstat64 196
-+#define __NR_fstat64 197
-+#define __NR_chown32 198
-+#define __NR_getuid32 199
-+#define __NR_getgid32 200
-+#define __NR_geteuid32 201
-+#define __NR_getegid32 202
-+#define __NR_setreuid32 203
-+#define __NR_setregid32 204
-+#define __NR_getgroups32 205
-+#define __NR_setgroups32 206
-+#define __NR_fchown32 207
-+#define __NR_setresuid32 208
-+#define __NR_getresuid32 209
-+#define __NR_setresgid32 210
-+#define __NR_getresgid32 211
-+#define __NR_lchown32 212
-+#define __NR_setuid32 213
-+#define __NR_setgid32 214
-+#define __NR_setfsuid32 215
-+#define __NR_setfsgid32 216
-+#define __NR_pivot_root 217
-+#define __NR_getdents64 220
-+#define __NR_gettid 221
-+#define __NR_tkill 222
-+#define __NR_setxattr 223
-+#define __NR_lsetxattr 224
-+#define __NR_fsetxattr 225
-+#define __NR_getxattr 226
-+#define __NR_lgetxattr 227
-+#define __NR_fgetxattr 228
-+#define __NR_listxattr 229
-+#define __NR_llistxattr 230
-+#define __NR_flistxattr 231
-+#define __NR_removexattr 232
-+#define __NR_lremovexattr 233
-+#define __NR_fremovexattr 234
-+#define __NR_futex 235
-+#define __NR_sendfile64 236
-+#define __NR_mincore 237
-+#define __NR_madvise 238
-+#define __NR_fcntl64 239
-+#define __NR_readahead 240
-+#define __NR_io_setup 241
-+#define __NR_io_destroy 242
-+#define __NR_io_getevents 243
-+#define __NR_io_submit 244
-+#define __NR_io_cancel 245
-+#define __NR_fadvise64 246
-+#define __NR_exit_group 247
-+#define __NR_lookup_dcookie 248
-+#define __NR_epoll_create 249
-+#define __NR_epoll_ctl 250
-+#define __NR_epoll_wait 251
-+#define __NR_remap_file_pages 252
-+#define __NR_set_tid_address 253
-+#define __NR_timer_create 254
-+#define __NR_timer_settime 255
-+#define __NR_timer_gettime 256
-+#define __NR_timer_getoverrun 257
-+#define __NR_timer_delete 258
-+#define __NR_clock_settime 259
-+#define __NR_clock_gettime 260
-+#define __NR_clock_getres 261
-+#define __NR_clock_nanosleep 262
-+#define __NR_statfs64 263
-+#define __NR_fstatfs64 264
-+#define __NR_tgkill 265
-+#define __NR_utimes 266
-+#define __NR_fadvise64_64 267
-+#define __NR_mbind 268
-+#define __NR_get_mempolicy 269
-+#define __NR_set_mempolicy 270
-+#define __NR_mq_open 271
-+#define __NR_mq_unlink 272
-+#define __NR_mq_timedsend 273
-+#define __NR_mq_timedreceive 274
-+#define __NR_mq_notify 275
-+#define __NR_mq_getsetattr 276
-+#define __NR_waitid 277
-+#define __NR_add_key 279
-+#define __NR_request_key 280
-+#define __NR_keyctl 281
-+#define __NR_ioprio_set 282
-+#define __NR_ioprio_get 283
-+#define __NR_inotify_init 284
-+#define __NR_inotify_add_watch 285
-+#define __NR_inotify_rm_watch 286
-+#define __NR_migrate_pages 287
-+#define __NR_openat 288
-+#define __NR_mkdirat 289
-+#define __NR_mknodat 290
-+#define __NR_fchownat 291
-+#define __NR_futimesat 292
-+#define __NR_fstatat64 293
-+#define __NR_unlinkat 294
-+#define __NR_renameat 295
-+#define __NR_linkat 296
-+#define __NR_symlinkat 297
-+#define __NR_readlinkat 298
-+#define __NR_fchmodat 299
-+#define __NR_faccessat 300
-+#define __NR_pselect6 301
-+#define __NR_ppoll 302
-+#define __NR_unshare 303
-+#define __NR_set_robust_list 304
-+#define __NR_get_robust_list 305
-+#define __NR_splice 306
-+#define __NR_sync_file_range 307
-+#define __NR_tee 308
-+#define __NR_vmsplice 309
-+#define __NR_move_pages 310
-+#define __NR_sched_setaffinity 311
-+#define __NR_sched_getaffinity 312
-+#define __NR_kexec_load 313
-+#define __NR_getcpu 314
-+#define __NR_epoll_pwait 315
-+#define __NR_utimensat 316
-+#define __NR_signalfd 317
-+#define __NR_timerfd_create 318
-+#define __NR_eventfd 319
-+#define __NR_fallocate 320
-+#define __NR_timerfd_settime 321
-+#define __NR_timerfd_gettime 322
-+#define __NR_signalfd4 323
-+#define __NR_eventfd2 324
-+#define __NR_epoll_create1 325
-+#define __NR_dup3 326
-+#define __NR_pipe2 327
-+#define __NR_inotify_init1 328
-+#define __NR_preadv 329
-+#define __NR_pwritev 330
-+#define __NR_rt_tgsigqueueinfo 331
-+#define __NR_perf_event_open 332
-+#define __NR_get_thread_area 333
-+#define __NR_set_thread_area 334
-+#define __NR_atomic_cmpxchg_32 335
-+#define __NR_atomic_barrier 336
-+#define __NR_fanotify_init 337
-+#define __NR_fanotify_mark 338
-+#define __NR_prlimit64 339
-+#define __NR_name_to_handle_at 340
-+#define __NR_open_by_handle_at 341
-+#define __NR_clock_adjtime 342
-+#define __NR_syncfs 343
-+#define __NR_setns 344
-+#define __NR_process_vm_readv 345
-+#define __NR_process_vm_writev 346
-+#define __NR_kcmp 347
-+#define __NR_finit_module 348
-+#define __NR_sched_setattr 349
-+#define __NR_sched_getattr 350
-+#define __NR_renameat2 351
-+#define __NR_getrandom 352
-+#define __NR_memfd_create 353
-+#define __NR_bpf 354
-+#define __NR_execveat 355
-+#define __NR_socket 356
-+#define __NR_socketpair 357
-+#define __NR_bind 358
-+#define __NR_connect 359
-+#define __NR_listen 360
-+#define __NR_accept4 361
-+#define __NR_getsockopt 362
-+#define __NR_setsockopt 363
-+#define __NR_getsockname 364
-+#define __NR_getpeername 365
-+#define __NR_sendto 366
-+#define __NR_sendmsg 367
-+#define __NR_recvfrom 368
-+#define __NR_recvmsg 369
-+#define __NR_shutdown 370
-+#define __NR_recvmmsg 371
-+#define __NR_sendmmsg 372
-+#define __NR_userfaultfd 373
-+#define __NR_membarrier 374
-+#define __NR_mlock2 375
-+#define __NR_copy_file_range 376
-+#define __NR_preadv2 377
-+#define __NR_pwritev2 378
-+#define __NR_statx 379
-diff --git a/arch/m68k/bits/user.h b/arch/m68k/bits/user.h
-new file mode 100644
-index 00000000..9a4ca128
---- /dev/null
-+++ b/arch/m68k/bits/user.h
-@@ -0,0 +1,33 @@
-+#undef __WORDSIZE
-+#define __WORDSIZE 32
-+
-+struct user_m68kfp_struct {
-+ unsigned long fpregs[24], fpcntl[3];
-+};
-+
-+struct user_regs_struct {
-+ long d1, d2, d3, d4, d5, d6, d7;
-+ long a0, a1, a2, a3, a4, a5, a6;
-+ long d0, usp, orig_d0;
-+ short stkadj, sr;
-+ long pc;
-+ short fmtvec, __pad;
-+};
-+
-+struct user {
-+ struct user_regs_struct regs;
-+ int u_fpvalid;
-+ struct user_m68kfp_struct m68kfp;
-+ unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack;
-+ long signal;
-+ int reserved;
-+ unsigned long u_ar0;
-+ struct user_m68kfp_struct *u_fpstate;
-+ unsigned long magic;
-+ char u_comm[32];
-+};
-+
-+#define NBPG 4096
-+#define UPAGES 1
-+#define HOST_TEXT_START_ADDR (u.start_code)
-+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-diff --git a/arch/m68k/crt_arch.h b/arch/m68k/crt_arch.h
-new file mode 100644
-index 00000000..48a42f29
---- /dev/null
-+++ b/arch/m68k/crt_arch.h
-@@ -0,0 +1,14 @@
-+__asm__(
-+".text\n"
-+".weak _DYNAMIC \n"
-+".hidden _DYNAMIC \n"
-+".global " START "\n"
-+START ":\n"
-+" suba.l %fp,%fp \n"
-+" movea.l %sp,%a0 \n"
-+" lea _DYNAMIC-.-8,%a1 \n"
-+" pea (%pc,%a1) \n"
-+" pea (%a0) \n"
-+" lea " START "_c-.-8,%a1 \n"
-+" jsr (%pc,%a1) \n"
-+);
-diff --git a/arch/m68k/pthread_arch.h b/arch/m68k/pthread_arch.h
-new file mode 100644
-index 00000000..02d5b8a0
---- /dev/null
-+++ b/arch/m68k/pthread_arch.h
-@@ -0,0 +1,13 @@
-+static inline struct pthread *__pthread_self()
-+{
-+ uintptr_t tp = __syscall(SYS_get_thread_area);
-+ return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
-+}
-+
-+#define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
-+#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-+
-+#define DTP_OFFSET 0x8000
-+
-+#define MC_PC gregs[R_PC]
-diff --git a/arch/m68k/reloc.h b/arch/m68k/reloc.h
-new file mode 100644
-index 00000000..f920b39e
---- /dev/null
-+++ b/arch/m68k/reloc.h
-@@ -0,0 +1,30 @@
-+#if __HAVE_68881__
-+#define FP_SUFFIX ""
-+#elif __mcffpu__
-+#define FP_SUFFIX "-fp64"
-+#else
-+#define FP_SUFFIX "-sf"
-+#endif
-+
-+#define LDSO_ARCH "m68k" FP_SUFFIX
-+
-+#define TPOFF_K (-0x7000)
-+
-+#define REL_SYMBOLIC R_68K_32
-+#define REL_OFFSET R_68K_PC32
-+#define REL_GOT R_68K_GLOB_DAT
-+#define REL_PLT R_68K_JMP_SLOT
-+#define REL_RELATIVE R_68K_RELATIVE
-+#define REL_COPY R_68K_COPY
-+#define REL_DTPMOD R_68K_TLS_DTPMOD32
-+#define REL_DTPOFF R_68K_TLS_DTPREL32
-+#define REL_TPOFF R_68K_TLS_TPREL32
-+
-+#define CRTJMP(pc,sp) __asm__ __volatile__( \
-+ "move.l %1,%%sp ; jmp (%0)" : : "r"(pc), "r"(sp) : "memory" )
-+
-+#define GETFUNCSYM(fp, sym, got) __asm__ ( \
-+ ".hidden " #sym "\n" \
-+ "lea " #sym "-.-8,%0 \n" \
-+ "lea (%%pc,%0),%0 \n" \
-+ : "=a"(*fp) : : "memory" )
-diff --git a/arch/m68k/syscall_arch.h b/arch/m68k/syscall_arch.h
-new file mode 100644
-index 00000000..af79c306
---- /dev/null
-+++ b/arch/m68k/syscall_arch.h
-@@ -0,0 +1,91 @@
-+#define __SYSCALL_LL_E(x) \
-+((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
-+((union { long long ll; long l[2]; }){ .ll = x }).l[1]
-+#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
-+
-+static __inline long __syscall0(long n)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ :
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall1(long n, long a)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1)
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall2(long n, long a, long b)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ register unsigned long d2 __asm__("d2") = b;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1), "r"(d2)
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall3(long n, long a, long b, long c)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ register unsigned long d2 __asm__("d2") = b;
-+ register unsigned long d3 __asm__("d3") = c;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1), "r"(d2), "r"(d3)
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall4(long n, long a, long b, long c, long d)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ register unsigned long d2 __asm__("d2") = b;
-+ register unsigned long d3 __asm__("d3") = c;
-+ register unsigned long d4 __asm__("d4") = d;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1), "r"(d2), "r"(d3), "r"(d4)
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall5(long n, long a, long b, long c, long d, long e)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ register unsigned long d2 __asm__("d2") = b;
-+ register unsigned long d3 __asm__("d3") = c;
-+ register unsigned long d4 __asm__("d4") = d;
-+ register unsigned long d5 __asm__("d5") = e;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5)
-+ : "memory");
-+ return d0;
-+}
-+
-+static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
-+{
-+ register unsigned long d0 __asm__("d0") = n;
-+ register unsigned long d1 __asm__("d1") = a;
-+ register unsigned long d2 __asm__("d2") = b;
-+ register unsigned long d3 __asm__("d3") = c;
-+ register unsigned long d4 __asm__("d4") = d;
-+ register unsigned long d5 __asm__("d5") = e;
-+ register unsigned long a0 __asm__("a0") = f;
-+ __asm__ __volatile__ ("trap #0" : "+r"(d0)
-+ : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5), "r"(a0)
-+ : "memory");
-+ return d0;
-+}
-+
-+#define SYSCALL_USE_SOCKETCALL
-+#define SYSCALL_IPC_BROKEN_MODE
-diff --git a/arch/microblaze/syscall_arch.h b/arch/microblaze/syscall_arch.h
-index 8e2de7ea..6cf631ad 100644
---- a/arch/microblaze/syscall_arch.h
-+++ b/arch/microblaze/syscall_arch.h
-@@ -102,3 +102,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
- #define SYSCALL_NO_INLINE
-
- #endif
-+
-+#define SYSCALL_IPC_BROKEN_MODE
-diff --git a/arch/mips/bits/hwcap.h b/arch/mips/bits/hwcap.h
-index 05cffba4..13e86fe7 100644
---- a/arch/mips/bits/hwcap.h
-+++ b/arch/mips/bits/hwcap.h
-@@ -1,2 +1,3 @@
- #define HWCAP_MIPS_R6 (1 << 0)
- #define HWCAP_MIPS_MSA (1 << 1)
-+#define HWCAP_MIPS_CRC32 (1 << 2)
-diff --git a/arch/mips/bits/mman.h b/arch/mips/bits/mman.h
-index c68aea88..9027bb63 100644
---- a/arch/mips/bits/mman.h
-+++ b/arch/mips/bits/mman.h
-@@ -18,6 +18,7 @@
- #define MAP_STACK 0x40000
- #undef MAP_HUGETLB
- #define MAP_HUGETLB 0x80000
-+#undef MAP_SYNC
-
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- #undef MADV_SOFT_OFFLINE
-diff --git a/arch/mips/bits/ptrace.h b/arch/mips/bits/ptrace.h
-new file mode 100644
-index 00000000..77a01c06
---- /dev/null
-+++ b/arch/mips/bits/ptrace.h
-@@ -0,0 +1,9 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_PEEKTEXT_3264 0xc0
-+#define PTRACE_PEEKDATA_3264 0xc1
-+#define PTRACE_POKETEXT_3264 0xc2
-+#define PTRACE_POKEDATA_3264 0xc3
-+#define PTRACE_GET_THREAD_AREA_3264 0xc4
-+#define PTRACE_GET_WATCH_REGS 0xd0
-+#define PTRACE_SET_WATCH_REGS 0xd1
-diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h
-index 191ebdb5..b82c7d34 100644
---- a/arch/mips/bits/socket.h
-+++ b/arch/mips/bits/socket.h
-@@ -45,6 +45,7 @@ struct cmsghdr {
- #define SO_BSDCOMPAT 14
- #define SO_PASSCRED 17
- #define SO_PEERCRED 18
-+#define SO_PEERSEC 30
- #define SO_SNDBUFFORCE 31
- #define SO_RCVBUFFORCE 33
-
-diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h
-index 6a1205d7..f7b9dd2e 100644
---- a/arch/mips/bits/termios.h
-+++ b/arch/mips/bits/termios.h
-@@ -52,6 +52,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0000400
- #define NL0 0000000
- #define NL1 0000400
-@@ -71,6 +72,7 @@ struct termios {
- #define FFDLY 0100000
- #define FF0 0000000
- #define FF1 0100000
-+#endif
-
- #define VTDLY 0040000
- #define VT0 0000000
-@@ -163,5 +165,5 @@ struct termios {
- #define EXTPROC 0200000
-
- #define XTABS 0014000
--#define TIOCSER_TEMT 1
-+#define TIOCSER_TEMT 0x01
- #endif
-diff --git a/arch/mips/pthread_arch.h b/arch/mips/pthread_arch.h
-index e5812655..5fea15ad 100644
---- a/arch/mips/pthread_arch.h
-+++ b/arch/mips/pthread_arch.h
-@@ -11,6 +11,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-
- #define DTP_OFFSET 0x8000
-diff --git a/arch/mips64/bits/hwcap.h b/arch/mips64/bits/hwcap.h
-index 05cffba4..13e86fe7 100644
---- a/arch/mips64/bits/hwcap.h
-+++ b/arch/mips64/bits/hwcap.h
-@@ -1,2 +1,3 @@
- #define HWCAP_MIPS_R6 (1 << 0)
- #define HWCAP_MIPS_MSA (1 << 1)
-+#define HWCAP_MIPS_CRC32 (1 << 2)
-diff --git a/arch/mips64/bits/mman.h b/arch/mips64/bits/mman.h
-index c68aea88..9027bb63 100644
---- a/arch/mips64/bits/mman.h
-+++ b/arch/mips64/bits/mman.h
-@@ -18,6 +18,7 @@
- #define MAP_STACK 0x40000
- #undef MAP_HUGETLB
- #define MAP_HUGETLB 0x80000
-+#undef MAP_SYNC
-
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- #undef MADV_SOFT_OFFLINE
-diff --git a/arch/mips64/bits/ptrace.h b/arch/mips64/bits/ptrace.h
-new file mode 100644
-index 00000000..77a01c06
---- /dev/null
-+++ b/arch/mips64/bits/ptrace.h
-@@ -0,0 +1,9 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_PEEKTEXT_3264 0xc0
-+#define PTRACE_PEEKDATA_3264 0xc1
-+#define PTRACE_POKETEXT_3264 0xc2
-+#define PTRACE_POKEDATA_3264 0xc3
-+#define PTRACE_GET_THREAD_AREA_3264 0xc4
-+#define PTRACE_GET_WATCH_REGS 0xd0
-+#define PTRACE_SET_WATCH_REGS 0xd1
-diff --git a/arch/mips64/bits/socket.h b/arch/mips64/bits/socket.h
-index cf801797..5aff0d91 100644
---- a/arch/mips64/bits/socket.h
-+++ b/arch/mips64/bits/socket.h
-@@ -61,6 +61,7 @@ struct cmsghdr {
- #define SO_BSDCOMPAT 14
- #define SO_PASSCRED 17
- #define SO_PEERCRED 18
-+#define SO_PEERSEC 30
- #define SO_SNDBUFFORCE 31
- #define SO_RCVBUFFORCE 33
-
-diff --git a/arch/mips64/bits/termios.h b/arch/mips64/bits/termios.h
-index 6a1205d7..f7b9dd2e 100644
---- a/arch/mips64/bits/termios.h
-+++ b/arch/mips64/bits/termios.h
-@@ -52,6 +52,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0000400
- #define NL0 0000000
- #define NL1 0000400
-@@ -71,6 +72,7 @@ struct termios {
- #define FFDLY 0100000
- #define FF0 0000000
- #define FF1 0100000
-+#endif
-
- #define VTDLY 0040000
- #define VT0 0000000
-@@ -163,5 +165,5 @@ struct termios {
- #define EXTPROC 0200000
-
- #define XTABS 0014000
--#define TIOCSER_TEMT 1
-+#define TIOCSER_TEMT 0x01
- #endif
-diff --git a/arch/mips64/pthread_arch.h b/arch/mips64/pthread_arch.h
-index e5812655..5fea15ad 100644
---- a/arch/mips64/pthread_arch.h
-+++ b/arch/mips64/pthread_arch.h
-@@ -11,6 +11,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-
- #define DTP_OFFSET 0x8000
-diff --git a/arch/mipsn32/bits/hwcap.h b/arch/mipsn32/bits/hwcap.h
-index 05cffba4..13e86fe7 100644
---- a/arch/mipsn32/bits/hwcap.h
-+++ b/arch/mipsn32/bits/hwcap.h
-@@ -1,2 +1,3 @@
- #define HWCAP_MIPS_R6 (1 << 0)
- #define HWCAP_MIPS_MSA (1 << 1)
-+#define HWCAP_MIPS_CRC32 (1 << 2)
-diff --git a/arch/mipsn32/bits/mman.h b/arch/mipsn32/bits/mman.h
-index c68aea88..9027bb63 100644
---- a/arch/mipsn32/bits/mman.h
-+++ b/arch/mipsn32/bits/mman.h
-@@ -18,6 +18,7 @@
- #define MAP_STACK 0x40000
- #undef MAP_HUGETLB
- #define MAP_HUGETLB 0x80000
-+#undef MAP_SYNC
-
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- #undef MADV_SOFT_OFFLINE
-diff --git a/arch/mipsn32/bits/ptrace.h b/arch/mipsn32/bits/ptrace.h
-new file mode 100644
-index 00000000..77a01c06
---- /dev/null
-+++ b/arch/mipsn32/bits/ptrace.h
-@@ -0,0 +1,9 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_PEEKTEXT_3264 0xc0
-+#define PTRACE_PEEKDATA_3264 0xc1
-+#define PTRACE_POKETEXT_3264 0xc2
-+#define PTRACE_POKEDATA_3264 0xc3
-+#define PTRACE_GET_THREAD_AREA_3264 0xc4
-+#define PTRACE_GET_WATCH_REGS 0xd0
-+#define PTRACE_SET_WATCH_REGS 0xd1
-diff --git a/arch/mipsn32/bits/socket.h b/arch/mipsn32/bits/socket.h
-index 191ebdb5..b82c7d34 100644
---- a/arch/mipsn32/bits/socket.h
-+++ b/arch/mipsn32/bits/socket.h
-@@ -45,6 +45,7 @@ struct cmsghdr {
- #define SO_BSDCOMPAT 14
- #define SO_PASSCRED 17
- #define SO_PEERCRED 18
-+#define SO_PEERSEC 30
- #define SO_SNDBUFFORCE 31
- #define SO_RCVBUFFORCE 33
-
-diff --git a/arch/mipsn32/bits/termios.h b/arch/mipsn32/bits/termios.h
-index 6a1205d7..f7b9dd2e 100644
---- a/arch/mipsn32/bits/termios.h
-+++ b/arch/mipsn32/bits/termios.h
-@@ -52,6 +52,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0000400
- #define NL0 0000000
- #define NL1 0000400
-@@ -71,6 +72,7 @@ struct termios {
- #define FFDLY 0100000
- #define FF0 0000000
- #define FF1 0100000
-+#endif
-
- #define VTDLY 0040000
- #define VT0 0000000
-@@ -163,5 +165,5 @@ struct termios {
- #define EXTPROC 0200000
-
- #define XTABS 0014000
--#define TIOCSER_TEMT 1
-+#define TIOCSER_TEMT 0x01
- #endif
-diff --git a/arch/mipsn32/pthread_arch.h b/arch/mipsn32/pthread_arch.h
-index e5812655..5fea15ad 100644
---- a/arch/mipsn32/pthread_arch.h
-+++ b/arch/mipsn32/pthread_arch.h
-@@ -11,6 +11,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-
- #define DTP_OFFSET 0x8000
-diff --git a/arch/or1k/bits/limits.h b/arch/or1k/bits/limits.h
-index 483b6749..3a811c99 100644
---- a/arch/or1k/bits/limits.h
-+++ b/arch/or1k/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 8192
-+#define PAGESIZE 8192
- #define LONG_BIT 32
- #endif
-
-diff --git a/arch/or1k/pthread_arch.h b/arch/or1k/pthread_arch.h
-index 7decd769..521b9c53 100644
---- a/arch/or1k/pthread_arch.h
-+++ b/arch/or1k/pthread_arch.h
-@@ -12,6 +12,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
-
- #define MC_PC regs.pc
-diff --git a/arch/powerpc/bits/hwcap.h b/arch/powerpc/bits/hwcap.h
-index 82c92a93..803de9b5 100644
---- a/arch/powerpc/bits/hwcap.h
-+++ b/arch/powerpc/bits/hwcap.h
-@@ -38,3 +38,6 @@
- #define PPC_FEATURE2_HTM_NOSC 0x01000000
- #define PPC_FEATURE2_ARCH_3_00 0x00800000
- #define PPC_FEATURE2_HAS_IEEE128 0x00400000
-+#define PPC_FEATURE2_DARN 0x00200000
-+#define PPC_FEATURE2_SCV 0x00100000
-+#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
-diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h
-index 95ec4358..b3a675a8 100644
---- a/arch/powerpc/bits/mman.h
-+++ b/arch/powerpc/bits/mman.h
-@@ -4,6 +4,7 @@
- #define MAP_NORESERVE 0x40
- #undef MAP_LOCKED
- #define MAP_LOCKED 0x80
-+#undef MAP_SYNC
-
- #undef MCL_CURRENT
- #define MCL_CURRENT 0x2000
-diff --git a/arch/powerpc/bits/ptrace.h b/arch/powerpc/bits/ptrace.h
-new file mode 100644
-index 00000000..75086ca0
---- /dev/null
-+++ b/arch/powerpc/bits/ptrace.h
-@@ -0,0 +1,23 @@
-+#define PTRACE_GETVRREGS 0x12
-+#define PTRACE_SETVRREGS 0x13
-+#define PTRACE_GETEVRREGS 0x14
-+#define PTRACE_SETEVRREGS 0x15
-+#define PTRACE_GETREGS64 0x16
-+#define PTRACE_SETREGS64 0x17
-+#define PTRACE_GET_DEBUGREG 0x19
-+#define PTRACE_SET_DEBUGREG 0x1a
-+#define PTRACE_GETVSRREGS 0x1b
-+#define PTRACE_SETVSRREGS 0x1c
-+#define PTRACE_SINGLEBLOCK 0x100
-+
-+#define PT_GETVRREGS PTRACE_GETVRREGS
-+#define PT_SETVRREGS PTRACE_SETVRREGS
-+#define PT_GETEVRREGS PTRACE_GETEVRREGS
-+#define PT_SETEVRREGS PTRACE_SETEVRREGS
-+#define PT_GETREGS64 PTRACE_GETREGS64
-+#define PT_SETREGS64 PTRACE_SETREGS64
-+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
-+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
-+#define PT_GETVSRREGS PTRACE_GETVSRREGS
-+#define PT_SETVSRREGS PTRACE_SETVSRREGS
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/powerpc/bits/socket.h b/arch/powerpc/bits/socket.h
-index 2fee8777..a94b8bdb 100644
---- a/arch/powerpc/bits/socket.h
-+++ b/arch/powerpc/bits/socket.h
-@@ -36,6 +36,7 @@ struct cmsghdr {
- #define SO_PASSCRED 20
- #define SO_PEERCRED 21
- #define SO_ACCEPTCONN 30
-+#define SO_PEERSEC 31
- #define SO_SNDBUFFORCE 32
- #define SO_RCVBUFFORCE 33
- #define SO_PROTOCOL 38
-diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
-index 20833915..7ce94bbd 100644
---- a/arch/powerpc/bits/syscall.h.in
-+++ b/arch/powerpc/bits/syscall.h.in
-@@ -368,4 +368,7 @@
- #define __NR_pwritev2 381
- #define __NR_kexec_file_load 382
- #define __NR_statx 383
-+#define __NR_pkey_alloc 384
-+#define __NR_pkey_free 385
-+#define __NR_pkey_mprotect 386
-
-diff --git a/arch/powerpc/bits/termios.h b/arch/powerpc/bits/termios.h
-index 0b09630c..e3f22e86 100644
---- a/arch/powerpc/bits/termios.h
-+++ b/arch/powerpc/bits/termios.h
-@@ -53,6 +53,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0001400
- #define NL0 0000000
- #define NL1 0000400
-@@ -74,6 +75,7 @@ struct termios {
- #define BSDLY 0100000
- #define BS0 0000000
- #define BS1 0100000
-+#endif
-
- #define VTDLY 0200000
- #define VT0 0000000
-@@ -165,5 +167,5 @@ struct termios {
- #define EXTPROC 0x10000000
-
- #define XTABS 00006000
--#define TIOCSER_TEMT 1
-+#define TIOCSER_TEMT 0x01
- #endif
-diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h
-index 7c5c4fad..79e5a09f 100644
---- a/arch/powerpc/pthread_arch.h
-+++ b/arch/powerpc/pthread_arch.h
-@@ -11,6 +11,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-
- #define DTP_OFFSET 0x8000
-diff --git a/arch/powerpc64/bits/hwcap.h b/arch/powerpc64/bits/hwcap.h
-index 82c92a93..803de9b5 100644
---- a/arch/powerpc64/bits/hwcap.h
-+++ b/arch/powerpc64/bits/hwcap.h
-@@ -38,3 +38,6 @@
- #define PPC_FEATURE2_HTM_NOSC 0x01000000
- #define PPC_FEATURE2_ARCH_3_00 0x00800000
- #define PPC_FEATURE2_HAS_IEEE128 0x00400000
-+#define PPC_FEATURE2_DARN 0x00200000
-+#define PPC_FEATURE2_SCV 0x00100000
-+#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
-diff --git a/arch/powerpc64/bits/mman.h b/arch/powerpc64/bits/mman.h
-index 95ec4358..b3a675a8 100644
---- a/arch/powerpc64/bits/mman.h
-+++ b/arch/powerpc64/bits/mman.h
-@@ -4,6 +4,7 @@
- #define MAP_NORESERVE 0x40
- #undef MAP_LOCKED
- #define MAP_LOCKED 0x80
-+#undef MAP_SYNC
-
- #undef MCL_CURRENT
- #define MCL_CURRENT 0x2000
-diff --git a/arch/powerpc64/bits/ptrace.h b/arch/powerpc64/bits/ptrace.h
-new file mode 100644
-index 00000000..75086ca0
---- /dev/null
-+++ b/arch/powerpc64/bits/ptrace.h
-@@ -0,0 +1,23 @@
-+#define PTRACE_GETVRREGS 0x12
-+#define PTRACE_SETVRREGS 0x13
-+#define PTRACE_GETEVRREGS 0x14
-+#define PTRACE_SETEVRREGS 0x15
-+#define PTRACE_GETREGS64 0x16
-+#define PTRACE_SETREGS64 0x17
-+#define PTRACE_GET_DEBUGREG 0x19
-+#define PTRACE_SET_DEBUGREG 0x1a
-+#define PTRACE_GETVSRREGS 0x1b
-+#define PTRACE_SETVSRREGS 0x1c
-+#define PTRACE_SINGLEBLOCK 0x100
-+
-+#define PT_GETVRREGS PTRACE_GETVRREGS
-+#define PT_SETVRREGS PTRACE_SETVRREGS
-+#define PT_GETEVRREGS PTRACE_GETEVRREGS
-+#define PT_SETEVRREGS PTRACE_SETEVRREGS
-+#define PT_GETREGS64 PTRACE_GETREGS64
-+#define PT_SETREGS64 PTRACE_SETREGS64
-+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
-+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
-+#define PT_GETVSRREGS PTRACE_GETVSRREGS
-+#define PT_SETVSRREGS PTRACE_SETVSRREGS
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/powerpc64/bits/socket.h b/arch/powerpc64/bits/socket.h
-index 2f748ae8..0f3c9aac 100644
---- a/arch/powerpc64/bits/socket.h
-+++ b/arch/powerpc64/bits/socket.h
-@@ -54,6 +54,7 @@ struct cmsghdr {
- #define SO_PASSCRED 20
- #define SO_PEERCRED 21
- #define SO_ACCEPTCONN 30
-+#define SO_PEERSEC 31
- #define SO_SNDBUFFORCE 32
- #define SO_RCVBUFFORCE 33
- #define SO_PROTOCOL 38
-diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
-index 936f43c0..1da1ecc0 100644
---- a/arch/powerpc64/bits/syscall.h.in
-+++ b/arch/powerpc64/bits/syscall.h.in
-@@ -359,4 +359,7 @@
- #define __NR_pwritev2 381
- #define __NR_kexec_file_load 382
- #define __NR_statx 383
-+#define __NR_pkey_alloc 384
-+#define __NR_pkey_free 385
-+#define __NR_pkey_mprotect 386
-
-diff --git a/arch/powerpc64/bits/termios.h b/arch/powerpc64/bits/termios.h
-index 0b09630c..e3f22e86 100644
---- a/arch/powerpc64/bits/termios.h
-+++ b/arch/powerpc64/bits/termios.h
-@@ -53,6 +53,7 @@ struct termios {
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define NLDLY 0001400
- #define NL0 0000000
- #define NL1 0000400
-@@ -74,6 +75,7 @@ struct termios {
- #define BSDLY 0100000
- #define BS0 0000000
- #define BS1 0100000
-+#endif
-
- #define VTDLY 0200000
- #define VT0 0000000
-@@ -165,5 +167,5 @@ struct termios {
- #define EXTPROC 0x10000000
-
- #define XTABS 00006000
--#define TIOCSER_TEMT 1
-+#define TIOCSER_TEMT 0x01
- #endif
-diff --git a/arch/powerpc64/pthread_arch.h b/arch/powerpc64/pthread_arch.h
-index 2f976fe2..37b75e29 100644
---- a/arch/powerpc64/pthread_arch.h
-+++ b/arch/powerpc64/pthread_arch.h
-@@ -6,6 +6,7 @@ static inline struct pthread *__pthread_self()
- }
-
- #define TLS_ABOVE_TP
-+#define GAP_ABOVE_TP 0
- #define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
-
- #define DTP_OFFSET 0x8000
-diff --git a/arch/s390x/bits/limits.h b/arch/s390x/bits/limits.h
-index 792a30b9..86ef7663 100644
---- a/arch/s390x/bits/limits.h
-+++ b/arch/s390x/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 4096
-+#define PAGESIZE 4096
- #define LONG_BIT 64
- #endif
-
-diff --git a/arch/s390x/bits/ptrace.h b/arch/s390x/bits/ptrace.h
-new file mode 100644
-index 00000000..d50e3262
---- /dev/null
-+++ b/arch/s390x/bits/ptrace.h
-@@ -0,0 +1,9 @@
-+#define PTRACE_SINGLEBLOCK 12
-+#define PTRACE_PEEKUSR_AREA 0x5000
-+#define PTRACE_POKEUSR_AREA 0x5001
-+#define PTRACE_GET_LAST_BREAK 0x5006
-+#define PTRACE_ENABLE_TE 0x5009
-+#define PTRACE_DISABLE_TE 0x5010
-+#define PTRACE_TE_ABORT_RAND 0x5011
-+
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
-index 4fe1a64f..409e9155 100644
---- a/arch/s390x/bits/syscall.h.in
-+++ b/arch/s390x/bits/syscall.h.in
-@@ -322,4 +322,6 @@
- #define __NR_pwritev2 377
- #define __NR_s390_guarded_storage 378
- #define __NR_statx 379
-+#define __NR_s390_sthyi 380
-+#define __NR_kexec_file_load 381
-
-diff --git a/arch/s390x/bits/user.h b/arch/s390x/bits/user.h
-index 17bce16f..ff3f0483 100644
---- a/arch/s390x/bits/user.h
-+++ b/arch/s390x/bits/user.h
-@@ -54,8 +54,8 @@ struct user {
- char u_comm[32];
- };
-
--#define PAGE_MASK (~(PAGE_SIZE-1))
--#define NBPG PAGE_SIZE
-+#define PAGE_MASK (~(PAGESIZE-1))
-+#define NBPG PAGESIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
- #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-diff --git a/arch/sh/bits/limits.h b/arch/sh/bits/limits.h
-index 65a3dd64..c340ceb2 100644
---- a/arch/sh/bits/limits.h
-+++ b/arch/sh/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 4096
-+#define PAGESIZE 4096
- #define LONG_BIT 32
- #endif
-
-diff --git a/arch/sh/pthread_arch.h b/arch/sh/pthread_arch.h
-index 2756e7ec..a7dd27a6 100644
---- a/arch/sh/pthread_arch.h
-+++ b/arch/sh/pthread_arch.h
-@@ -2,10 +2,16 @@ static inline struct pthread *__pthread_self()
- {
- char *self;
- __asm__ __volatile__ ("stc gbr,%0" : "=r" (self) );
-- return (struct pthread *) (self + 8 - sizeof(struct pthread));
-+ return (struct pthread *) (self - sizeof(struct pthread));
- }
-
- #define TLS_ABOVE_TP
--#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) - 8)
-+#define GAP_ABOVE_TP 8
-+#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread))
-
- #define MC_PC sc_pc
-+
-+#ifdef __FDPIC__
-+#define MC_GOT sc_regs[12]
-+#define CANCEL_GOT (*(uintptr_t *)((char *)__syscall_cp_asm+sizeof(uintptr_t)))
-+#endif
-diff --git a/arch/sh/reloc.h b/arch/sh/reloc.h
-index 0238ce07..a1f16cb1 100644
---- a/arch/sh/reloc.h
-+++ b/arch/sh/reloc.h
-@@ -20,7 +20,7 @@
-
- #define LDSO_ARCH "sh" ENDIAN_SUFFIX FP_SUFFIX ABI_SUFFIX
-
--#define TPOFF_K 8
-+#define TPOFF_K 0
-
- #define REL_SYMBOLIC R_SH_DIR32
- #define REL_OFFSET R_SH_REL32
-diff --git a/arch/sh/syscall_arch.h b/arch/sh/syscall_arch.h
-index 84758fe0..48f61d94 100644
---- a/arch/sh/syscall_arch.h
-+++ b/arch/sh/syscall_arch.h
-@@ -86,3 +86,5 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
- register long r1 __asm__("r1") = f;
- __asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
- }
-+
-+#define SYSCALL_IPC_BROKEN_MODE
-diff --git a/arch/x32/atomic_arch.h b/arch/x32/atomic_arch.h
-index a744c299..918c2d4e 100644
---- a/arch/x32/atomic_arch.h
-+++ b/arch/x32/atomic_arch.h
-@@ -106,8 +106,8 @@ static inline int a_ctz_64(uint64_t x)
- return x;
- }
-
--#define a_ctz_l a_ctz_l
--static inline int a_ctz_l(unsigned long x)
-+#define a_ctz_32 a_ctz_32
-+static inline int a_ctz_32(uint32_t x)
- {
- __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
- return x;
-diff --git a/arch/x32/bits/limits.h b/arch/x32/bits/limits.h
-index 65a3dd64..c340ceb2 100644
---- a/arch/x32/bits/limits.h
-+++ b/arch/x32/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 4096
-+#define PAGESIZE 4096
- #define LONG_BIT 32
- #endif
-
-diff --git a/arch/x32/bits/ptrace.h b/arch/x32/bits/ptrace.h
-new file mode 100644
-index 00000000..7f8a09b5
---- /dev/null
-+++ b/arch/x32/bits/ptrace.h
-@@ -0,0 +1,13 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_ARCH_PRCTL 30
-+#define PTRACE_SYSEMU 31
-+#define PTRACE_SYSEMU_SINGLESTEP 32
-+#define PTRACE_SINGLEBLOCK 33
-+
-+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
-+#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
-+#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
-+#define PT_SYSEMU PTRACE_SYSEMU
-+#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/x32/bits/user.h b/arch/x32/bits/user.h
-index 471bb19d..4073cc06 100644
---- a/arch/x32/bits/user.h
-+++ b/arch/x32/bits/user.h
-@@ -34,8 +34,8 @@ struct user {
- unsigned long u_debugreg[8];
- };
-
--#define PAGE_MASK (~(PAGE_SIZE-1))
--#define NBPG PAGE_SIZE
-+#define PAGE_MASK (~(PAGESIZE-1))
-+#define NBPG PAGESIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
- #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-diff --git a/arch/x86_64/bits/limits.h b/arch/x86_64/bits/limits.h
-index 792a30b9..86ef7663 100644
---- a/arch/x86_64/bits/limits.h
-+++ b/arch/x86_64/bits/limits.h
-@@ -1,6 +1,6 @@
- #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define PAGE_SIZE 4096
-+#define PAGESIZE 4096
- #define LONG_BIT 64
- #endif
-
-diff --git a/arch/x86_64/bits/ptrace.h b/arch/x86_64/bits/ptrace.h
-new file mode 100644
-index 00000000..7f8a09b5
---- /dev/null
-+++ b/arch/x86_64/bits/ptrace.h
-@@ -0,0 +1,13 @@
-+#define PTRACE_GET_THREAD_AREA 25
-+#define PTRACE_SET_THREAD_AREA 26
-+#define PTRACE_ARCH_PRCTL 30
-+#define PTRACE_SYSEMU 31
-+#define PTRACE_SYSEMU_SINGLESTEP 32
-+#define PTRACE_SINGLEBLOCK 33
-+
-+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
-+#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
-+#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
-+#define PT_SYSEMU PTRACE_SYSEMU
-+#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
-+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
-diff --git a/arch/x86_64/bits/user.h b/arch/x86_64/bits/user.h
-index 471bb19d..4073cc06 100644
---- a/arch/x86_64/bits/user.h
-+++ b/arch/x86_64/bits/user.h
-@@ -34,8 +34,8 @@ struct user {
- unsigned long u_debugreg[8];
- };
-
--#define PAGE_MASK (~(PAGE_SIZE-1))
--#define NBPG PAGE_SIZE
-+#define PAGE_MASK (~(PAGESIZE-1))
-+#define NBPG PAGESIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
- #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
-diff --git a/configure b/configure
-index 1e59c461..f940af9a 100755
---- a/configure
-+++ b/configure
-@@ -320,6 +320,7 @@ i?86*) ARCH=i386 ;;
- x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
- x86_64-nt64*) ARCH=nt64 ;;
- x86_64*) ARCH=x86_64 ;;
-+m68k*) ARCH=m68k ;;
- mips64*|mipsisa64*) ARCH=mips64 ;;
- mips*) ARCH=mips ;;
- microblaze*) ARCH=microblaze ;;
-@@ -590,10 +591,12 @@ tryldflag LDFLAGS_AUTO -Wl,--no-undefined
- # versions built without shared library support and pcc are broken.
- tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
-
--# Linking with -Bsymbolic-functions is no longer mandatory for
--# the dynamic linker to work, but enable it if it works as
--# a linking optimization.
--tryldflag LDFLAGS_AUTO -Wl,-Bsymbolic-functions
-+# Public data symbols must be interposable to allow for copy
-+# relocations, but otherwise we want to bind symbols at libc link
-+# time to eliminate startup relocations and PLT overhead. Use
-+# --dynamic-list rather than -Bsymbolic-functions for greater
-+# control over what symbols are left unbound.
-+tryldflag LDFLAGS_AUTO -Wl,--dynamic-list="$srcdir/dynamic.list"
-
- # Find compiler runtime library
- test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
-@@ -639,6 +642,13 @@ if test "$ARCH" = "aarch64" ; then
- trycppif __AARCH64EB__ "$t" && SUBARCH=${SUBARCH}_be
- fi
-
-+if test "$ARCH" = "m68k" ; then
-+if trycppif "__HAVE_68881__" ; then : ;
-+elif trycppif "__mcffpu__" ; then SUBARCH="-fp64"
-+else SUBARCH="-sf"
-+fi
-+fi
-+
- if test "$ARCH" = "mips" ; then
- trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6
- trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
-diff --git a/dynamic.list b/dynamic.list
-new file mode 100644
-index 00000000..686f8eb4
---- /dev/null
-+++ b/dynamic.list
-@@ -0,0 +1,44 @@
-+{
-+environ;
-+__environ;
-+
-+stdin;
-+stdout;
-+stderr;
-+
-+malloc;
-+calloc;
-+realloc;
-+free;
-+memalign;
-+posix_memalign;
-+aligned_alloc;
-+malloc_usable_size;
-+
-+timezone;
-+daylight;
-+tzname;
-+__timezone;
-+__daylight;
-+__tzname;
-+
-+signgam;
-+__signgam;
-+
-+optarg;
-+optind;
-+opterr;
-+optreset;
-+__optreset;
-+
-+getdate_err;
-+
-+h_errno;
-+
-+program_invocation_name;
-+program_invocation_short_name;
-+__progname;
-+__progname_full;
-+
-+__stack_chk_guard;
-+};
-diff --git a/include/alltypes.h.in b/include/alltypes.h.in
-index 6a9c105f..622ca01d 100644
---- a/include/alltypes.h.in
-+++ b/include/alltypes.h.in
-@@ -7,10 +7,10 @@ TYPEDEF _Addr regoff_t;
- TYPEDEF _Reg register_t;
-
- TYPEDEF signed char int8_t;
--TYPEDEF short int16_t;
--TYPEDEF int int32_t;
--TYPEDEF _Int64 int64_t;
--TYPEDEF _Int64 intmax_t;
-+TYPEDEF signed short int16_t;
-+TYPEDEF signed int int32_t;
-+TYPEDEF signed _Int64 int64_t;
-+TYPEDEF signed _Int64 intmax_t;
- TYPEDEF unsigned char uint8_t;
- TYPEDEF unsigned short uint16_t;
- TYPEDEF unsigned int uint32_t;
-diff --git a/include/elf.h b/include/elf.h
-index e79915fe..c2297353 100644
---- a/include/elf.h
-+++ b/include/elf.h
-@@ -623,6 +623,7 @@ typedef struct {
-
-
- #define NT_PRSTATUS 1
-+#define NT_PRFPREG 2
- #define NT_FPREGSET 2
- #define NT_PRPSINFO 3
- #define NT_PRXREG 4
-@@ -644,6 +645,19 @@ typedef struct {
- #define NT_PPC_VMX 0x100
- #define NT_PPC_SPE 0x101
- #define NT_PPC_VSX 0x102
-+#define NT_PPC_TAR 0x103
-+#define NT_PPC_PPR 0x104
-+#define NT_PPC_DSCR 0x105
-+#define NT_PPC_EBB 0x106
-+#define NT_PPC_PMU 0x107
-+#define NT_PPC_TM_CGPR 0x108
-+#define NT_PPC_TM_CFPR 0x109
-+#define NT_PPC_TM_CVMX 0x10a
-+#define NT_PPC_TM_CVSX 0x10b
-+#define NT_PPC_TM_SPR 0x10c
-+#define NT_PPC_TM_CTAR 0x10d
-+#define NT_PPC_TM_CPPR 0x10e
-+#define NT_PPC_TM_CDSCR 0x10f
- #define NT_386_TLS 0x200
- #define NT_386_IOPERM 0x201
- #define NT_X86_XSTATE 0x202
-@@ -656,14 +670,21 @@ typedef struct {
- #define NT_S390_LAST_BREAK 0x306
- #define NT_S390_SYSTEM_CALL 0x307
- #define NT_S390_TDB 0x308
-+#define NT_S390_VXRS_LOW 0x309
-+#define NT_S390_VXRS_HIGH 0x30a
-+#define NT_S390_GS_CB 0x30b
-+#define NT_S390_GS_BC 0x30c
-+#define NT_S390_RI_CB 0x30d
- #define NT_ARM_VFP 0x400
- #define NT_ARM_TLS 0x401
- #define NT_ARM_HW_BREAK 0x402
- #define NT_ARM_HW_WATCH 0x403
- #define NT_ARM_SYSTEM_CALL 0x404
-+#define NT_ARM_SVE 0x405
- #define NT_METAG_CBUF 0x500
- #define NT_METAG_RPIPE 0x501
- #define NT_METAG_TLS 0x502
-+#define NT_ARC_V2 0x600
- #define NT_VERSION 1
-
-
-@@ -721,7 +742,8 @@ typedef struct {
- #define DT_ENCODING 32
- #define DT_PREINIT_ARRAY 32
- #define DT_PREINIT_ARRAYSZ 33
--#define DT_NUM 34
-+#define DT_SYMTAB_SHNDX 34
-+#define DT_NUM 35
- #define DT_LOOS 0x6000000d
- #define DT_HIOS 0x6ffff000
- #define DT_LOPROC 0x70000000
-@@ -821,6 +843,8 @@ typedef struct {
- #define DF_1_SYMINTPOSE 0x00800000
- #define DF_1_GLOBAUDIT 0x01000000
- #define DF_1_SINGLETON 0x02000000
-+#define DF_1_STUB 0x04000000
-+#define DF_1_PIE 0x08000000
-
- #define DTF_1_PARINIT 0x00000001
- #define DTF_1_CONFEXP 0x00000002
-@@ -1002,6 +1026,14 @@ typedef struct {
- #define AT_L2_CACHESHAPE 36
- #define AT_L3_CACHESHAPE 37
-
-+#define AT_L1I_CACHESIZE 40
-+#define AT_L1I_CACHEGEOMETRY 41
-+#define AT_L1D_CACHESIZE 42
-+#define AT_L1D_CACHEGEOMETRY 43
-+#define AT_L2_CACHESIZE 44
-+#define AT_L2_CACHEGEOMETRY 45
-+#define AT_L3_CACHESIZE 46
-+#define AT_L3_CACHEGEOMETRY 47
-
-
-
-@@ -1097,7 +1129,25 @@ typedef struct {
- #define R_68K_GLOB_DAT 20
- #define R_68K_JMP_SLOT 21
- #define R_68K_RELATIVE 22
--#define R_68K_NUM 23
-+#define R_68K_TLS_GD32 25
-+#define R_68K_TLS_GD16 26
-+#define R_68K_TLS_GD8 27
-+#define R_68K_TLS_LDM32 28
-+#define R_68K_TLS_LDM16 29
-+#define R_68K_TLS_LDM8 30
-+#define R_68K_TLS_LDO32 31
-+#define R_68K_TLS_LDO16 32
-+#define R_68K_TLS_LDO8 33
-+#define R_68K_TLS_IE32 34
-+#define R_68K_TLS_IE16 35
-+#define R_68K_TLS_IE8 36
-+#define R_68K_TLS_LE32 37
-+#define R_68K_TLS_LE16 38
-+#define R_68K_TLS_LE8 39
-+#define R_68K_TLS_DTPMOD32 40
-+#define R_68K_TLS_DTPREL32 41
-+#define R_68K_TLS_TPREL32 42
-+#define R_68K_NUM 43
-
- #define R_386_NONE 0
- #define R_386_32 1
-@@ -2233,6 +2283,7 @@ enum
-
- #define PPC64_OPT_TLS 1
- #define PPC64_OPT_MULTI_TOC 2
-+#define PPC64_OPT_LOCALENTRY 4
-
- #define STO_PPC64_LOCAL_BIT 5
- #define STO_PPC64_LOCAL_MASK 0xe0
-diff --git a/include/limits.h b/include/limits.h
-index f9805a1e..02c2139d 100644
---- a/include/limits.h
-+++ b/include/limits.h
-@@ -9,7 +9,7 @@
-
- /* Support signed or unsigned plain-char */
-
--#if '\0'-1 > 0
-+#if '\xff' > 0
- #define CHAR_MIN 0
- #define CHAR_MAX 255
- #else
-@@ -40,14 +40,9 @@
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-
- #define PIPE_BUF 4096
--#ifdef PAGE_SIZE
--#define PAGESIZE PAGE_SIZE
--#endif
- #define FILESIZEBITS 64
- #define NAME_MAX 255
--#define SYMLINK_MAX 255
- #define PATH_MAX 4096
--#define NZERO 20
- #define NGROUPS_MAX 32
- #define ARG_MAX 131072
- #define IOV_MAX 1024
-@@ -82,13 +77,22 @@
- #define RE_DUP_MAX 255
-
- #define NL_ARGMAX 9
--#define NL_LANGMAX 32
- #define NL_MSGMAX 32767
- #define NL_SETMAX 255
- #define NL_TEXTMAX 2048
-
- #endif
-
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
-+
-+#ifdef PAGESIZE
-+#define PAGE_SIZE PAGESIZE
-+#endif
-+#define NZERO 20
-+#define NL_LANGMAX 32
-+
-+#endif
-+
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
- || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
-
-diff --git a/include/math.h b/include/math.h
-index 6ac91da2..fea34686 100644
---- a/include/math.h
-+++ b/include/math.h
-@@ -27,7 +27,7 @@ extern "C" {
- #define MATH_ERREXCEPT 2
- #define math_errhandling 2
-
--#define FP_ILOGBNAN (-1-(int)(((unsigned)-1)>>1))
-+#define FP_ILOGBNAN (-1-0x7fffffff)
- #define FP_ILOGB0 FP_ILOGBNAN
-
- #define FP_NAN 0
-diff --git a/include/net/if_arp.h b/include/net/if_arp.h
-index c832ff95..27becc83 100644
---- a/include/net/if_arp.h
-+++ b/include/net/if_arp.h
-@@ -59,6 +59,7 @@ struct arphdr {
- #define ARPHRD_LAPB 516
- #define ARPHRD_DDCMP 517
- #define ARPHRD_RAWHDLC 518
-+#define ARPHRD_RAWIP 519
-
- #define ARPHRD_TUNNEL 768
- #define ARPHRD_TUNNEL6 769
-diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
-index 97134d75..ecd6c73c 100644
---- a/include/netinet/if_ether.h
-+++ b/include/netinet/if_ether.h
-@@ -5,6 +5,7 @@
- #include <sys/types.h>
-
- #define ETH_ALEN 6
-+#define ETH_TLEN 2
- #define ETH_HLEN 14
- #define ETH_ZLEN 60
- #define ETH_DATA_LEN 1500
-@@ -17,6 +18,7 @@
- #define ETH_P_PUP 0x0200
- #define ETH_P_PUPAT 0x0201
- #define ETH_P_TSN 0x22F0
-+#define ETH_P_ERSPAN2 0x22EB
- #define ETH_P_IP 0x0800
- #define ETH_P_X25 0x0805
- #define ETH_P_ARP 0x0806
-@@ -53,6 +55,8 @@
- #define ETH_P_AOE 0x88A2
- #define ETH_P_8021AD 0x88A8
- #define ETH_P_802_EX1 0x88B5
-+#define ETH_P_ERSPAN 0x88BE
-+#define ETH_P_PREAUTH 0x88C7
- #define ETH_P_TIPC 0x88CA
- #define ETH_P_MACSEC 0x88E5
- #define ETH_P_8021AH 0x88E7
-@@ -66,11 +70,13 @@
- #define ETH_P_IBOE 0x8915
- #define ETH_P_80221 0x8917
- #define ETH_P_HSR 0x892F
-+#define ETH_P_NSH 0x894F
- #define ETH_P_LOOPBACK 0x9000
- #define ETH_P_QINQ1 0x9100
- #define ETH_P_QINQ2 0x9200
- #define ETH_P_QINQ3 0x9300
- #define ETH_P_EDSA 0xDADA
-+#define ETH_P_IFE 0xED3E
- #define ETH_P_AF_IUCV 0xFBFB
-
- #define ETH_P_802_3_MIN 0x0600
-@@ -100,6 +106,7 @@
- #define ETH_P_IEEE802154 0x00F6
- #define ETH_P_CAIF 0x00F7
- #define ETH_P_XDSA 0x00F8
-+#define ETH_P_MAP 0x00F9
-
- struct ethhdr {
- uint8_t h_dest[ETH_ALEN];
-diff --git a/include/netinet/in.h b/include/netinet/in.h
-index f18b478d..192679a6 100644
---- a/include/netinet/in.h
-+++ b/include/netinet/in.h
-@@ -363,6 +363,7 @@ struct ip6_mtuinfo {
- #define IPV6_TRANSPARENT 75
- #define IPV6_UNICAST_IF 76
- #define IPV6_RECVFRAGSIZE 77
-+#define IPV6_FREEBIND 78
-
- #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
- #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
-index 4d20936a..1e2acfbf 100644
---- a/include/netinet/tcp.h
-+++ b/include/netinet/tcp.h
-@@ -34,6 +34,8 @@
- #define TCP_FASTOPEN_CONNECT 30
- #define TCP_ULP 31
- #define TCP_MD5SIG_EXT 32
-+#define TCP_FASTOPEN_KEY 33
-+#define TCP_FASTOPEN_NO_COOKIE 34
-
- #define TCP_ESTABLISHED 1
- #define TCP_SYN_SENT 2
-@@ -54,6 +56,16 @@ enum {
- TCP_NLA_SNDBUF_LIMITED,
- TCP_NLA_DATA_SEGS_OUT,
- TCP_NLA_TOTAL_RETRANS,
-+ TCP_NLA_PACING_RATE,
-+ TCP_NLA_DELIVERY_RATE,
-+ TCP_NLA_SND_CWND,
-+ TCP_NLA_REORDERING,
-+ TCP_NLA_MIN_RTT,
-+ TCP_NLA_RECUR_RETRANS,
-+ TCP_NLA_DELIVERY_RATE_APP_LMT,
-+ TCP_NLA_SNDQ_SIZE,
-+ TCP_NLA_CA_STATE,
-+ TCP_NLA_SND_SSTHRESH,
- };
-
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-@@ -220,6 +232,14 @@ struct tcp_md5sig {
- uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
- };
-
-+struct tcp_diag_md5sig {
-+ uint8_t tcpm_family;
-+ uint8_t tcpm_prefixlen;
-+ uint16_t tcpm_keylen;
-+ uint32_t tcpm_addr[4];
-+ uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN];
-+};
-+
- struct tcp_repair_window {
- uint32_t snd_wl1;
- uint32_t snd_wnd;
-diff --git a/include/signal.h b/include/signal.h
-index 2c8b3d55..a4f85cca 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -210,7 +210,7 @@ int sigpending(sigset_t *);
- int sigwait(const sigset_t *__restrict, int *__restrict);
- int sigwaitinfo(const sigset_t *__restrict, siginfo_t *__restrict);
- int sigtimedwait(const sigset_t *__restrict, siginfo_t *__restrict, const struct timespec *__restrict);
--int sigqueue(pid_t, int, const union sigval);
-+int sigqueue(pid_t, int, union sigval);
-
- int pthread_sigmask(int, const sigset_t *__restrict, sigset_t *__restrict);
- int pthread_kill(pthread_t, int);
-@@ -231,6 +231,8 @@ int sigrelse(int);
- void (*sigset(int, void (*)(int)))(int);
- #define TRAP_BRKPT 1
- #define TRAP_TRACE 2
-+#define TRAP_BRANCH 3
-+#define TRAP_HWBKPT 4
- #define POLL_IN 1
- #define POLL_OUT 2
- #define POLL_MSG 3
-diff --git a/include/stdio.h b/include/stdio.h
-index 7c4f9ee4..afadd912 100644
---- a/include/stdio.h
-+++ b/include/stdio.h
-@@ -49,6 +49,7 @@ extern "C" {
-
- typedef union _G_fpos64_t {
- char __opaque[16];
-+ long long __lldata;
- double __align;
- } fpos_t;
-
diff --git a/include/stdlib.h b/include/stdlib.h
index 42ca8336..4bbaded0 100644
--- a/include/stdlib.h
@@ -2736,369 +37,6 @@ index 42ca8336..4bbaded0 100644
int mkostemps (char *, int, int);
void *valloc (size_t);
void *memalign(size_t, size_t);
-diff --git a/include/string.h b/include/string.h
-index ce1dc300..795a2abc 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -82,6 +82,7 @@ void *memccpy (void *__restrict, const void *__restrict, int, size_t);
- char *strsep(char **, const char *);
- size_t strlcat (char *, const char *, size_t);
- size_t strlcpy (char *, const char *, size_t);
-+void explicit_bzero (void *, size_t);
- #endif
-
- #ifdef _GNU_SOURCE
-diff --git a/include/sys/epoll.h b/include/sys/epoll.h
-index ffe2311f..ac81a841 100644
---- a/include/sys/epoll.h
-+++ b/include/sys/epoll.h
-@@ -21,6 +21,7 @@ enum EPOLL_EVENTS { __EPOLL_DUMMY };
- #define EPOLLPRI 0x002
- #define EPOLLOUT 0x004
- #define EPOLLRDNORM 0x040
-+#define EPOLLNVAL 0x020
- #define EPOLLRDBAND 0x080
- #define EPOLLWRNORM 0x100
- #define EPOLLWRBAND 0x200
-diff --git a/include/sys/kd.h b/include/sys/kd.h
-index 793fd59f..42122b9c 100644
---- a/include/sys/kd.h
-+++ b/include/sys/kd.h
-@@ -1,8 +1 @@
--#ifndef _SYS_KD_H
--#define _SYS_KD_H
--
--#define _LINUX_TYPES_H
--#include <linux/kd.h>
--#undef _LINUX_TYPES_H
--
--#endif
-+#include <bits/kd.h>
-diff --git a/include/sys/mman.h b/include/sys/mman.h
-index 8a5149c9..99d02a2e 100644
---- a/include/sys/mman.h
-+++ b/include/sys/mman.h
-@@ -20,6 +20,7 @@ extern "C" {
-
- #define MAP_SHARED 0x01
- #define MAP_PRIVATE 0x02
-+#define MAP_SHARED_VALIDATE 0x03
- #define MAP_TYPE 0x0f
- #define MAP_FIXED 0x10
- #define MAP_ANON 0x20
-@@ -33,8 +34,23 @@ extern "C" {
- #define MAP_NONBLOCK 0x10000
- #define MAP_STACK 0x20000
- #define MAP_HUGETLB 0x40000
-+#define MAP_SYNC 0x80000
-+#define MAP_FIXED_NOREPLACE 0x100000
- #define MAP_FILE 0
-
-+#define MAP_HUGE_SHIFT 26
-+#define MAP_HUGE_MASK 0x3f
-+#define MAP_HUGE_64KB (16 << 26)
-+#define MAP_HUGE_512KB (19 << 26)
-+#define MAP_HUGE_1MB (20 << 26)
-+#define MAP_HUGE_2MB (21 << 26)
-+#define MAP_HUGE_8MB (23 << 26)
-+#define MAP_HUGE_16MB (24 << 26)
-+#define MAP_HUGE_256MB (28 << 26)
-+#define MAP_HUGE_1GB (30 << 26)
-+#define MAP_HUGE_2GB (31 << 26)
-+#define MAP_HUGE_16GB (34U << 26)
-+
- #define PROT_NONE 0
- #define PROT_READ 1
- #define PROT_WRITE 2
-@@ -72,10 +88,23 @@ extern "C" {
- #define MADV_NOHUGEPAGE 15
- #define MADV_DONTDUMP 16
- #define MADV_DODUMP 17
-+#define MADV_WIPEONFORK 18
-+#define MADV_KEEPONFORK 19
- #define MADV_HWPOISON 100
- #define MADV_SOFT_OFFLINE 101
- #endif
-
-+#ifdef _GNU_SOURCE
-+#define MREMAP_MAYMOVE 1
-+#define MREMAP_FIXED 2
-+
-+#define MLOCK_ONFAULT 0x01
-+
-+#define MFD_CLOEXEC 0x0001U
-+#define MFD_ALLOW_SEALING 0x0002U
-+#define MFD_HUGETLB 0x0004U
-+#endif
-+
- #include <bits/mman.h>
-
- void *mmap (void *, size_t, int, int, int, off_t);
-@@ -92,14 +121,13 @@ int mlockall (int);
- int munlockall (void);
-
- #ifdef _GNU_SOURCE
--#define MREMAP_MAYMOVE 1
--#define MREMAP_FIXED 2
- void *mremap (void *, size_t, size_t, int, ...);
- int remap_file_pages (void *, size_t, int, size_t, int);
-+int memfd_create (const char *, unsigned);
-+int mlock2 (const void *, size_t, unsigned);
- #endif
-
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
--#define MLOCK_ONFAULT 0x01
- int madvise (void *, size_t, int);
- int mincore (void *, size_t, unsigned char *);
- #endif
-diff --git a/include/sys/msg.h b/include/sys/msg.h
-index 139f22b7..be6afc34 100644
---- a/include/sys/msg.h
-+++ b/include/sys/msg.h
-@@ -27,6 +27,7 @@ typedef unsigned long msglen_t;
-
- #define MSG_STAT 11
- #define MSG_INFO 12
-+#define MSG_STAT_ANY 13
-
- struct msginfo {
- int msgpool, msgmap, msgmax, msgmnb, msgmni, msgssz, msgtql;
-diff --git a/include/sys/prctl.h b/include/sys/prctl.h
-index 24f4f8bd..af76408c 100644
---- a/include/sys/prctl.h
-+++ b/include/sys/prctl.h
-@@ -130,6 +130,21 @@ struct prctl_mm_map {
- #define PR_CAP_AMBIENT_LOWER 3
- #define PR_CAP_AMBIENT_CLEAR_ALL 4
-
-+#define PR_SVE_SET_VL 50
-+#define PR_SVE_SET_VL_ONEXEC (1 << 18)
-+#define PR_SVE_GET_VL 51
-+#define PR_SVE_VL_LEN_MASK 0xffff
-+#define PR_SVE_VL_INHERIT (1 << 17)
-+
-+#define PR_GET_SPECULATION_CTRL 52
-+#define PR_SET_SPECULATION_CTRL 53
-+#define PR_SPEC_STORE_BYPASS 0
-+#define PR_SPEC_NOT_AFFECTED 0
-+#define PR_SPEC_PRCTL (1UL << 0)
-+#define PR_SPEC_ENABLE (1UL << 1)
-+#define PR_SPEC_DISABLE (1UL << 2)
-+#define PR_SPEC_FORCE_DISABLE (1UL << 3)
-+
- int prctl (int, ...);
-
- #ifdef __cplusplus
-diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h
-index d9d45408..229e1f3d 100644
---- a/include/sys/ptrace.h
-+++ b/include/sys/ptrace.h
-@@ -40,6 +40,7 @@ extern "C" {
- #define PTRACE_GETSIGMASK 0x420a
- #define PTRACE_SETSIGMASK 0x420b
- #define PTRACE_SECCOMP_GET_FILTER 0x420c
-+#define PTRACE_SECCOMP_GET_METADATA 0x420d
-
- #define PT_READ_I PTRACE_PEEKTEXT
- #define PT_READ_D PTRACE_PEEKDATA
-@@ -83,15 +84,23 @@ extern "C" {
- #define PTRACE_EVENT_VFORK_DONE 5
- #define PTRACE_EVENT_EXIT 6
- #define PTRACE_EVENT_SECCOMP 7
-+#define PTRACE_EVENT_STOP 128
-
- #define PTRACE_PEEKSIGINFO_SHARED 1
-
--struct ptrace_peeksiginfo_args {
-+#include <bits/ptrace.h>
-+
-+struct __ptrace_peeksiginfo_args {
- uint64_t off;
- uint32_t flags;
- int32_t nr;
- };
-
-+struct __ptrace_seccomp_metadata {
-+ uint64_t filter_off;
-+ uint64_t flags;
-+};
-+
- long ptrace(int, ...);
-
- #ifdef __cplusplus
-diff --git a/include/sys/random.h b/include/sys/random.h
-new file mode 100644
-index 00000000..4ee7bf2c
---- /dev/null
-+++ b/include/sys/random.h
-@@ -0,0 +1,19 @@
-+#ifndef _SYS_RANDOM_H
-+#define _SYS_RANDOM_H
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#define __NEED_size_t
-+#define __NEED_ssize_t
-+#include <bits/alltypes.h>
-+
-+#define GRND_NONBLOCK 0x0001
-+#define GRND_RANDOM 0x0002
-+
-+ssize_t getrandom(void *, size_t, unsigned);
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+#endif
-diff --git a/include/sys/sem.h b/include/sys/sem.h
-index e7c36980..61cdb83d 100644
---- a/include/sys/sem.h
-+++ b/include/sys/sem.h
-@@ -33,6 +33,7 @@ extern "C" {
-
- #define SEM_STAT 18
- #define SEM_INFO 19
-+#define SEM_STAT_ANY 20
-
- struct seminfo {
- int semmap;
-diff --git a/include/sys/shm.h b/include/sys/shm.h
-index 67be822b..662fde59 100644
---- a/include/sys/shm.h
-+++ b/include/sys/shm.h
-@@ -35,11 +35,25 @@ extern "C" {
- #define SHM_UNLOCK 12
- #define SHM_STAT 13
- #define SHM_INFO 14
-+#define SHM_STAT_ANY 15
- #define SHM_DEST 01000
- #define SHM_LOCKED 02000
- #define SHM_HUGETLB 04000
- #define SHM_NORESERVE 010000
-
-+#define SHM_HUGE_SHIFT 26
-+#define SHM_HUGE_MASK 0x3f
-+#define SHM_HUGE_64KB (16 << 26)
-+#define SHM_HUGE_512KB (19 << 26)
-+#define SHM_HUGE_1MB (20 << 26)
-+#define SHM_HUGE_2MB (21 << 26)
-+#define SHM_HUGE_8MB (23 << 26)
-+#define SHM_HUGE_16MB (24 << 26)
-+#define SHM_HUGE_256MB (28 << 26)
-+#define SHM_HUGE_1GB (30 << 26)
-+#define SHM_HUGE_2GB (31 << 26)
-+#define SHM_HUGE_16GB (34U << 26)
-+
- typedef unsigned long shmatt_t;
-
- void *shmat(int, const void *, int);
-diff --git a/include/sys/socket.h b/include/sys/socket.h
-index 051d20e0..14be6e99 100644
---- a/include/sys/socket.h
-+++ b/include/sys/socket.h
-@@ -108,7 +108,8 @@ struct linger {
- #define PF_VSOCK 40
- #define PF_KCM 41
- #define PF_QIPCRTR 42
--#define PF_MAX 43
-+#define PF_SMC 43
-+#define PF_MAX 44
-
- #define AF_UNSPEC PF_UNSPEC
- #define AF_LOCAL PF_LOCAL
-@@ -156,6 +157,7 @@ struct linger {
- #define AF_VSOCK PF_VSOCK
- #define AF_KCM PF_KCM
- #define AF_QIPCRTR PF_QIPCRTR
-+#define AF_SMC PF_SMC
- #define AF_MAX PF_MAX
-
- #ifndef SO_DEBUG
-@@ -181,6 +183,7 @@ struct linger {
- #define SO_RCVTIMEO 20
- #define SO_SNDTIMEO 21
- #define SO_ACCEPTCONN 30
-+#define SO_PEERSEC 31
- #define SO_SNDBUFFORCE 32
- #define SO_RCVBUFFORCE 33
- #define SO_PROTOCOL 38
-@@ -201,7 +204,6 @@ struct linger {
- #define SO_TIMESTAMP 29
- #define SCM_TIMESTAMP SO_TIMESTAMP
-
--#define SO_PEERSEC 31
- #define SO_PASSSEC 34
- #define SO_TIMESTAMPNS 35
- #define SCM_TIMESTAMPNS SO_TIMESTAMPNS
-@@ -230,6 +232,7 @@ struct linger {
- #define SO_COOKIE 57
- #define SCM_TIMESTAMPING_PKTINFO 58
- #define SO_PEERGROUPS 59
-+#define SO_ZEROCOPY 60
-
- #ifndef SOL_SOCKET
- #define SOL_SOCKET 1
-@@ -261,6 +264,7 @@ struct linger {
- #define SOL_ALG 279
- #define SOL_NFC 280
- #define SOL_KCM 281
-+#define SOL_TLS 282
-
- #define SOMAXCONN 128
-
-@@ -282,6 +286,7 @@ struct linger {
- #define MSG_MORE 0x8000
- #define MSG_WAITFORONE 0x10000
- #define MSG_BATCH 0x40000
-+#define MSG_ZEROCOPY 0x4000000
- #define MSG_FASTOPEN 0x20000000
- #define MSG_CMSG_CLOEXEC 0x40000000
-
-diff --git a/include/sys/soundcard.h b/include/sys/soundcard.h
-index fade986f..5ca77646 100644
---- a/include/sys/soundcard.h
-+++ b/include/sys/soundcard.h
-@@ -1 +1 @@
--#include <linux/soundcard.h>
-+#include <bits/soundcard.h>
-diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h
-index e0839eca..ef07d684 100644
---- a/include/sys/statvfs.h
-+++ b/include/sys/statvfs.h
-@@ -42,6 +42,7 @@ int fstatvfs (int, struct statvfs *);
- #define ST_IMMUTABLE 512
- #define ST_NOATIME 1024
- #define ST_NODIRATIME 2048
-+#define ST_RELATIME 4096
-
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
- #define statvfs64 statvfs
-diff --git a/include/sys/vt.h b/include/sys/vt.h
-index 834abfbc..5000de49 100644
---- a/include/sys/vt.h
-+++ b/include/sys/vt.h
-@@ -1 +1 @@
--#include <linux/vt.h>
-+#include <bits/vt.h>
-diff --git a/include/tar.h b/include/tar.h
-index be589842..2eba66ec 100644
---- a/include/tar.h
-+++ b/include/tar.h
-@@ -1,9 +1,13 @@
- #ifndef _TAR_H
- #define _TAR_H
-
-+#include <features.h>
-+
- #define TSUID 04000
- #define TSGID 02000
-+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
- #define TSVTX 01000
-+#endif
- #define TUREAD 00400
- #define TUWRITE 00200
- #define TUEXEC 00100
diff --git a/include/time.h b/include/time.h
index 672b3fc3..c5946dd0 100644
--- a/include/time.h
@@ -3120,47 +58,10 @@ index 672b3fc3..c5946dd0 100644
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
-diff --git a/include/uchar.h b/include/uchar.h
-index 8dabf1ed..7e5c4d40 100644
---- a/include/uchar.h
-+++ b/include/uchar.h
-@@ -3,7 +3,9 @@
-
- #ifdef __cplusplus
- extern "C" {
--#else
-+#endif
-+
-+#if __cplusplus < 201103L
- typedef unsigned short char16_t;
- typedef unsigned char32_t;
- #endif
diff --git a/include/unistd.h b/include/unistd.h
-index 09190af4..1bdd3292 100644
+index 9485da7a..1bdd3292 100644
--- a/include/unistd.h
+++ b/include/unistd.h
-@@ -128,12 +128,11 @@ long fpathconf(int, int);
- long sysconf(int);
- size_t confstr(int, char *, size_t);
-
-+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- #define F_ULOCK 0
- #define F_LOCK 1
- #define F_TLOCK 2
- #define F_TEST 3
--
--#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- int setreuid(uid_t, uid_t);
- int setregid(gid_t, gid_t);
- int lockf(int, int, off_t);
-@@ -176,6 +175,7 @@ int acct(const char *);
- long syscall(long, ...);
- int execvpe(const char *, char *const [], char *const []);
- int issetugid(void);
-+int getentropy(void *, size_t);
- #endif
-
- #ifdef _GNU_SOURCE
@@ -274,6 +274,7 @@ int eaccess(const char *, int);
#define _PC_ALLOC_SIZE_MIN 18
#define _PC_SYMLINK_MAX 19
@@ -3186,328 +87,6 @@ index 09190af4..1bdd3292 100644
#ifdef __cplusplus
}
-diff --git a/ldso/dynlink.c b/ldso/dynlink.c
-index 9bf6924b..87281ddb 100644
---- a/ldso/dynlink.c
-+++ b/ldso/dynlink.c
-@@ -133,6 +133,9 @@ static struct dso *const nodeps_dummy;
-
- struct debug *_dl_debug_addr = &debug;
-
-+__attribute__((__visibility__("hidden")))
-+extern int __malloc_replaced;
-+
- __attribute__((__visibility__("hidden")))
- void (*const __init_array_start)(void)=0, (*const __fini_array_start)(void)=0;
-
-@@ -158,10 +161,26 @@ static void *laddr(const struct dso *p, size_t v)
- for (j=0; v-p->loadmap->segs[j].p_vaddr >= p->loadmap->segs[j].p_memsz; j++);
- return (void *)(v - p->loadmap->segs[j].p_vaddr + p->loadmap->segs[j].addr);
- }
-+static void *laddr_pg(const struct dso *p, size_t v)
-+{
-+ size_t j=0;
-+ size_t pgsz = PAGE_SIZE;
-+ if (!p->loadmap) return p->base + v;
-+ for (j=0; ; j++) {
-+ size_t a = p->loadmap->segs[j].p_vaddr;
-+ size_t b = a + p->loadmap->segs[j].p_memsz;
-+ a &= -pgsz;
-+ b += pgsz-1;
-+ b &= -pgsz;
-+ if (v-a<b-a) break;
-+ }
-+ return (void *)(v - p->loadmap->segs[j].p_vaddr + p->loadmap->segs[j].addr);
-+}
- #define fpaddr(p, v) ((void (*)())&(struct funcdesc){ \
- laddr(p, v), (p)->got })
- #else
- #define laddr(p, v) (void *)((p)->base + (v))
-+#define laddr_pg(p, v) laddr(p, v)
- #define fpaddr(p, v) ((void (*)())laddr(p, v))
- #endif
-
-@@ -366,6 +385,14 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri
- sym_val = def.sym ? (size_t)laddr(def.dso, def.sym->st_value) : 0;
- tls_val = def.sym ? def.sym->st_value : 0;
-
-+ if ((type == REL_TPOFF || type == REL_TPOFF_NEG)
-+ && runtime && def.dso->tls_id > static_tls_cnt) {
-+ error("Error relocating %s: %s: initial-exec TLS "
-+ "resolves to dynamic definition in %s",
-+ dso->name, name, def.dso->name);
-+ longjmp(*rtld_fail, 1);
-+ }
-+
- switch(type) {
- case REL_NONE:
- break;
-@@ -419,7 +446,7 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri
- #endif
- case REL_TLSDESC:
- if (stride<3) addend = reloc_addr[1];
-- if (runtime && def.dso->tls_id >= static_tls_cnt) {
-+ if (runtime && def.dso->tls_id > static_tls_cnt) {
- struct td_index *new = malloc(sizeof *new);
- if (!new) {
- error(
-@@ -476,23 +503,16 @@ static void redo_lazy_relocs()
- /* A huge hack: to make up for the wastefulness of shared libraries
- * needing at least a page of dirty memory even if they have no global
- * data, we reclaim the gaps at the beginning and end of writable maps
-- * and "donate" them to the heap by setting up minimal malloc
-- * structures and then freeing them. */
-+ * and "donate" them to the heap. */
-
- static void reclaim(struct dso *dso, size_t start, size_t end)
- {
-- size_t *a, *z;
-+ void __malloc_donate(char *, char *);
- if (start >= dso->relro_start && start < dso->relro_end) start = dso->relro_end;
- if (end >= dso->relro_start && end < dso->relro_end) end = dso->relro_start;
-- start = start + 6*sizeof(size_t)-1 & -4*sizeof(size_t);
-- end = (end & -4*sizeof(size_t)) - 2*sizeof(size_t);
-- if (start>end || end-start < 4*sizeof(size_t)) return;
-- a = laddr(dso, start);
-- z = laddr(dso, end);
-- a[-2] = 1;
-- a[-1] = z[0] = end-start + 2*sizeof(size_t) | 1;
-- z[1] = 1;
-- free(a);
-+ if (start >= end) return;
-+ char *base = laddr_pg(dso, start);
-+ __malloc_donate(base, base+(end-start));
- }
-
- static void reclaim_gaps(struct dso *dso)
-@@ -500,7 +520,6 @@ static void reclaim_gaps(struct dso *dso)
- Phdr *ph = dso->phdr;
- size_t phcnt = dso->phnum;
-
-- if (DL_FDPIC) return; // FIXME
- for (; phcnt--; ph=(void *)((char *)ph+dso->phentsize)) {
- if (ph->p_type!=PT_LOAD) continue;
- if ((ph->p_flags&(PF_R|PF_W))!=(PF_R|PF_W)) continue;
-@@ -695,18 +714,17 @@ static void *map_library(int fd, struct dso *dso)
- dso->phnum = eh->e_phnum;
- dso->phentsize = eh->e_phentsize;
- }
-- /* Reuse the existing mapping for the lowest-address LOAD */
-- if ((ph->p_vaddr & -PAGE_SIZE) == addr_min && !DL_NOMMU_SUPPORT)
-- continue;
- this_min = ph->p_vaddr & -PAGE_SIZE;
- this_max = ph->p_vaddr+ph->p_memsz+PAGE_SIZE-1 & -PAGE_SIZE;
- off_start = ph->p_offset & -PAGE_SIZE;
- prot = (((ph->p_flags&PF_R) ? PROT_READ : 0) |
- ((ph->p_flags&PF_W) ? PROT_WRITE: 0) |
- ((ph->p_flags&PF_X) ? PROT_EXEC : 0));
-- if (mmap_fixed(base+this_min, this_max-this_min, prot, MAP_PRIVATE|MAP_FIXED, fd, off_start) == MAP_FAILED)
-- goto error;
-- if (ph->p_memsz > ph->p_filesz) {
-+ /* Reuse the existing mapping for the lowest-address LOAD */
-+ if ((ph->p_vaddr & -PAGE_SIZE) != addr_min || DL_NOMMU_SUPPORT)
-+ if (mmap_fixed(base+this_min, this_max-this_min, prot, MAP_PRIVATE|MAP_FIXED, fd, off_start) == MAP_FAILED)
-+ goto error;
-+ if (ph->p_memsz > ph->p_filesz && (ph->p_flags&PF_W)) {
- size_t brk = (size_t)base+ph->p_vaddr+ph->p_filesz;
- size_t pgbrk = brk+PAGE_SIZE-1 & -PAGE_SIZE;
- memset((void *)brk, 0, pgbrk-brk & PAGE_SIZE-1);
-@@ -1583,8 +1601,9 @@ _Noreturn void __dls3(size_t *sp)
- libc.tls_head = tls_tail = &app.tls;
- app.tls_id = tls_cnt = 1;
- #ifdef TLS_ABOVE_TP
-- app.tls.offset = 0;
-- tls_offset = app.tls.size
-+ app.tls.offset = GAP_ABOVE_TP;
-+ app.tls.offset += -GAP_ABOVE_TP & (app.tls.align-1);
-+ tls_offset = app.tls.offset + app.tls.size
- + ( -((uintptr_t)app.tls.image + app.tls.size)
- & (app.tls.align-1) );
- #else
-@@ -1683,6 +1702,12 @@ _Noreturn void __dls3(size_t *sp)
- if (ldso_fail) _exit(127);
- if (ldd_mode) _exit(0);
-
-+ /* Determine if malloc was interposed by a replacement implementation
-+ * so that calloc and the memalign family can harden against the
-+ * possibility of incomplete replacement. */
-+ if (find_sym(head, "malloc", 1).dso != &ldso)
-+ __malloc_replaced = 1;
-+
- /* Switch to runtime mode: any further failures in the dynamic
- * linker are a reportable failure rather than a fatal startup
- * error. */
-@@ -1861,8 +1886,17 @@ static void *addr2dso(size_t a)
- return p;
- }
- } else {
-+ Phdr *ph = p->phdr;
-+ size_t phcnt = p->phnum;
-+ size_t entsz = p->phentsize;
-+ size_t base = (size_t)p->base;
-+ for (; phcnt--; ph=(void *)((char *)ph+entsz)) {
-+ if (ph->p_type != PT_LOAD) continue;
-+ if (a-base-ph->p_vaddr < ph->p_memsz)
-+ return p;
-+ }
- if (a-(size_t)p->map < p->map_len)
-- return p;
-+ return 0;
- }
- }
- return 0;
-@@ -1926,16 +1960,18 @@ failed:
- return 0;
- }
-
--int dladdr(const void *addr, Dl_info *info)
-+int dladdr(const void *addr_arg, Dl_info *info)
- {
-+ size_t addr = (size_t)addr_arg;
- struct dso *p;
- Sym *sym, *bestsym;
- uint32_t nsym;
- char *strings;
-- void *best = 0;
-+ size_t best = 0;
-+ size_t besterr = -1;
-
- pthread_rwlock_rdlock(&lock);
-- p = addr2dso((size_t)addr);
-+ p = addr2dso(addr);
- pthread_rwlock_unlock(&lock);
-
- if (!p) return 0;
-@@ -1945,11 +1981,12 @@ int dladdr(const void *addr, Dl_info *info)
- nsym = count_syms(p);
-
- if (DL_FDPIC) {
-- size_t idx = ((size_t)addr-(size_t)p->funcdescs)
-+ size_t idx = (addr-(size_t)p->funcdescs)
- / sizeof(*p->funcdescs);
- if (idx < nsym && (sym[idx].st_info&0xf) == STT_FUNC) {
-- best = p->funcdescs + idx;
-+ best = (size_t)(p->funcdescs + idx);
- bestsym = sym + idx;
-+ besterr = 0;
- }
- }
-
-@@ -1957,25 +1994,35 @@ int dladdr(const void *addr, Dl_info *info)
- if (sym->st_value
- && (1<<(sym->st_info&0xf) & OK_TYPES)
- && (1<<(sym->st_info>>4) & OK_BINDS)) {
-- void *symaddr = laddr(p, sym->st_value);
-- if (symaddr > addr || symaddr < best)
-+ size_t symaddr = (size_t)laddr(p, sym->st_value);
-+ if (symaddr > addr || symaddr <= best)
- continue;
- best = symaddr;
- bestsym = sym;
-+ besterr = addr - symaddr;
- if (addr == symaddr)
- break;
- }
- }
-
-- if (!best) return 0;
--
-- if (DL_FDPIC && (bestsym->st_info&0xf) == STT_FUNC)
-- best = p->funcdescs + (bestsym - p->syms);
-+ if (bestsym && besterr > bestsym->st_size-1) {
-+ best = 0;
-+ bestsym = 0;
-+ }
-
- info->dli_fname = p->name;
- info->dli_fbase = p->map;
-+
-+ if (!best) {
-+ info->dli_sname = 0;
-+ info->dli_saddr = 0;
-+ return 1;
-+ }
-+
-+ if (DL_FDPIC && (bestsym->st_info&0xf) == STT_FUNC)
-+ best = (size_t)(p->funcdescs + (bestsym - p->syms));
- info->dli_sname = strings + bestsym->st_name;
-- info->dli_saddr = best;
-+ info->dli_saddr = (void *)best;
-
- return 1;
- }
-diff --git a/src/complex/casin.c b/src/complex/casin.c
-index dfdda988..01ed6184 100644
---- a/src/complex/casin.c
-+++ b/src/complex/casin.c
-@@ -12,5 +12,6 @@ double complex casin(double complex z)
- x = creal(z);
- y = cimag(z);
- w = CMPLX(1.0 - (x - y)*(x + y), -2.0*x*y);
-- return clog(CMPLX(-y, x) + csqrt(w));
-+ double complex r = clog(CMPLX(-y, x) + csqrt(w));
-+ return CMPLX(cimag(r), -creal(r));
- }
-diff --git a/src/complex/casinf.c b/src/complex/casinf.c
-index 93f0e335..4fcb76fc 100644
---- a/src/complex/casinf.c
-+++ b/src/complex/casinf.c
-@@ -10,5 +10,6 @@ float complex casinf(float complex z)
- x = crealf(z);
- y = cimagf(z);
- w = CMPLXF(1.0 - (x - y)*(x + y), -2.0*x*y);
-- return clogf(CMPLXF(-y, x) + csqrtf(w));
-+ float complex r = clogf(CMPLXF(-y, x) + csqrtf(w));
-+ return CMPLXF(cimagf(r), -crealf(r));
- }
-diff --git a/src/complex/casinl.c b/src/complex/casinl.c
-index 0916c60f..3b7ceba7 100644
---- a/src/complex/casinl.c
-+++ b/src/complex/casinl.c
-@@ -15,6 +15,7 @@ long double complex casinl(long double complex z)
- x = creall(z);
- y = cimagl(z);
- w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y);
-- return clogl(CMPLXL(-y, x) + csqrtl(w));
-+ long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w));
-+ return CMPLXL(cimagl(r), -creall(r));
- }
- #endif
-diff --git a/src/complex/catan.c b/src/complex/catan.c
-index 39ce6cf2..7dc2afeb 100644
---- a/src/complex/catan.c
-+++ b/src/complex/catan.c
-@@ -91,29 +91,17 @@ double complex catan(double complex z)
- x = creal(z);
- y = cimag(z);
-
-- if (x == 0.0 && y > 1.0)
-- goto ovrf;
--
- x2 = x * x;
- a = 1.0 - x2 - (y * y);
-- if (a == 0.0)
-- goto ovrf;
-
- t = 0.5 * atan2(2.0 * x, a);
- w = _redupi(t);
-
- t = y - 1.0;
- a = x2 + (t * t);
-- if (a == 0.0)
-- goto ovrf;
-
- t = y + 1.0;
- a = (x2 + t * t)/a;
-- w = w + (0.25 * log(a)) * I;
-- return w;
--
--ovrf:
-- // FIXME
-- w = MAXNUM + MAXNUM * I;
-+ w = CMPLX(w, 0.25 * log(a));
- return w;
- }
diff --git a/src/conf/confstr.c b/src/conf/confstr.c
index 02cb1aa2..8f870a69 100644
--- a/src/conf/confstr.c
@@ -3524,7 +103,7 @@ index 02cb1aa2..8f870a69 100644
return 0;
}
diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c
-index 8eb037e6..b6a9d63e 100644
+index e6aca5cf..b6a9d63e 100644
--- a/src/conf/fpathconf.c
+++ b/src/conf/fpathconf.c
@@ -4,7 +4,7 @@
@@ -3536,82 +115,21 @@ index 8eb037e6..b6a9d63e 100644
[_PC_LINK_MAX] = _POSIX_LINK_MAX,
[_PC_MAX_CANON] = _POSIX_MAX_CANON,
[_PC_MAX_INPUT] = _POSIX_MAX_INPUT,
-@@ -24,8 +24,9 @@ long fpathconf(int fd, int name)
- [_PC_REC_MIN_XFER_SIZE] = 4096,
+@@ -25,7 +25,8 @@ long fpathconf(int fd, int name)
[_PC_REC_XFER_ALIGN] = 4096,
[_PC_ALLOC_SIZE_MIN] = 4096,
-- [_PC_SYMLINK_MAX] = SYMLINK_MAX,
+ [_PC_SYMLINK_MAX] = -1,
- [_PC_2_SYMLINKS] = 1
-+ [_PC_SYMLINK_MAX] = -1,
+ [_PC_2_SYMLINKS] = 1,
+ [_PC_TIMESTAMP_RESOLUTION] = 100000000,
};
if (name >= sizeof(values)/sizeof(values[0])) {
errno = EINVAL;
diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c
-index 9ce330a5..483e1635 100644
+index 45ef1c16..483e1635 100644
--- a/src/conf/sysconf.c
+++ b/src/conf/sysconf.c
-@@ -18,6 +18,7 @@
- #define JT_PHYS_PAGES JT(8)
- #define JT_AVPHYS_PAGES JT(9)
- #define JT_ZERO JT(10)
-+#define JT_DELAYTIMER_MAX JT(11)
-
- #define RLIM(x) (-32768|(RLIMIT_ ## x))
-
-@@ -33,7 +34,7 @@ long sysconf(int name)
- [_SC_TZNAME_MAX] = TZNAME_MAX,
- [_SC_JOB_CONTROL] = 1,
- [_SC_SAVED_IDS] = 1,
-- [_SC_REALTIME_SIGNALS] = 1,
-+ [_SC_REALTIME_SIGNALS] = VER,
- [_SC_PRIORITY_SCHEDULING] = -1,
- [_SC_TIMERS] = VER,
- [_SC_ASYNCHRONOUS_IO] = VER,
-@@ -50,7 +51,7 @@ long sysconf(int name)
- [_SC_AIO_LISTIO_MAX] = -1,
- [_SC_AIO_MAX] = -1,
- [_SC_AIO_PRIO_DELTA_MAX] = JT_ZERO, /* ?? */
-- [_SC_DELAYTIMER_MAX] = _POSIX_DELAYTIMER_MAX,
-+ [_SC_DELAYTIMER_MAX] = JT_DELAYTIMER_MAX,
- [_SC_MQ_OPEN_MAX] = -1,
- [_SC_MQ_PRIO_MAX] = JT_MQ_PRIO_MAX,
- [_SC_VERSION] = VER,
-@@ -111,8 +112,8 @@ long sysconf(int name)
- [_SC_XOPEN_XPG4] = -1,
- [_SC_NZERO] = NZERO,
- [_SC_XBS5_ILP32_OFF32] = -1,
-- [_SC_XBS5_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO,
-- [_SC_XBS5_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO,
-+ [_SC_XBS5_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
-+ [_SC_XBS5_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
- [_SC_XBS5_LPBIG_OFFBIG] = -1,
- [_SC_XOPEN_LEGACY] = -1,
- [_SC_XOPEN_REALTIME] = -1,
-@@ -141,8 +142,8 @@ long sysconf(int name)
- [_SC_STREAMS] = JT_ZERO,
- [_SC_2_PBS_CHECKPOINT] = -1,
- [_SC_V6_ILP32_OFF32] = -1,
-- [_SC_V6_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO,
-- [_SC_V6_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO,
-+ [_SC_V6_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
-+ [_SC_V6_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
- [_SC_V6_LPBIG_OFFBIG] = -1,
- [_SC_HOST_NAME_MAX] = HOST_NAME_MAX,
- [_SC_TRACE] = -1,
-@@ -153,8 +154,8 @@ long sysconf(int name)
- [_SC_IPV6] = VER,
- [_SC_RAW_SOCKETS] = VER,
- [_SC_V7_ILP32_OFF32] = -1,
-- [_SC_V7_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : JT_ZERO,
-- [_SC_V7_LP64_OFF64] = sizeof(long)==8 ? 1 : JT_ZERO,
-+ [_SC_V7_ILP32_OFFBIG] = sizeof(long)==4 ? 1 : -1,
-+ [_SC_V7_LP64_OFF64] = sizeof(long)==8 ? 1 : -1,
- [_SC_V7_LPBIG_OFFBIG] = -1,
- [_SC_SS_REPL_MAX] = -1,
- [_SC_TRACE_EVENT_NAME_MAX] = -1,
-@@ -164,6 +165,7 @@ long sysconf(int name)
+@@ -165,6 +165,7 @@ long sysconf(int name)
[_SC_XOPEN_STREAMS] = JT_ZERO,
[_SC_THREAD_ROBUST_PRIO_INHERIT] = -1,
[_SC_THREAD_ROBUST_PRIO_PROTECT] = -1,
@@ -3619,789 +137,6 @@ index 9ce330a5..483e1635 100644
};
if (name >= sizeof(values)/sizeof(values[0]) || !values[name]) {
-@@ -190,6 +192,8 @@ long sysconf(int name)
- return PAGE_SIZE;
- case JT_SEM_VALUE_MAX & 255:
- return SEM_VALUE_MAX;
-+ case JT_DELAYTIMER_MAX & 255:
-+ return DELAYTIMER_MAX;
- case JT_NPROCESSORS_CONF & 255:
- case JT_NPROCESSORS_ONLN & 255: ;
- unsigned char set[128] = {1};
-diff --git a/src/dirent/__dirent.h b/src/dirent/__dirent.h
-index 101b0368..828a5f17 100644
---- a/src/dirent/__dirent.h
-+++ b/src/dirent/__dirent.h
-@@ -1,9 +1,11 @@
- struct __dirstream
- {
-- int fd;
- off_t tell;
-+ int fd;
- int buf_pos;
- int buf_end;
- volatile int lock[1];
-+ /* Any changes to this struct must preserve the property:
-+ * offsetof(struct __dirent, buf) % sizeof(off_t) == 0 */
- char buf[2048];
- };
-diff --git a/src/dirent/readdir.c b/src/dirent/readdir.c
-index 2cf0632c..eef92f79 100644
---- a/src/dirent/readdir.c
-+++ b/src/dirent/readdir.c
-@@ -1,10 +1,12 @@
- #include <dirent.h>
- #include <errno.h>
-+#include <stddef.h>
- #include "__dirent.h"
- #include "syscall.h"
- #include "libc.h"
-
--int __getdents(int, struct dirent *, size_t);
-+typedef char dirstream_buf_alignment_check[1-2*(int)(
-+ offsetof(struct __dirstream, buf) % sizeof(off_t))];
-
- struct dirent *readdir(DIR *dir)
- {
-diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c
-index b125eb1f..31d324a8 100644
---- a/src/env/__init_tls.c
-+++ b/src/env/__init_tls.c
-@@ -15,7 +15,8 @@ int __init_tp(void *p)
- int r = __set_thread_area(TP_ADJ(p));
- if (r < 0) return -1;
- if (!r) libc.can_do_threads = 1;
-- td->tid = __syscall(SYS_set_tid_address, &td->tid);
-+ td->detach_state = DT_JOINABLE;
-+ td->tid = __syscall(SYS_set_tid_address, &td->detach_state);
- td->locale = &libc.global_locale;
- td->robust_list.head = &td->robust_list.head;
- return 0;
-@@ -103,13 +104,19 @@ static void static_init_tls(size_t *aux)
-
- main_tls.size += (-main_tls.size - (uintptr_t)main_tls.image)
- & (main_tls.align-1);
-- if (main_tls.align < MIN_TLS_ALIGN) main_tls.align = MIN_TLS_ALIGN;
--#ifndef TLS_ABOVE_TP
-+#ifdef TLS_ABOVE_TP
-+ main_tls.offset = GAP_ABOVE_TP;
-+ main_tls.offset += -GAP_ABOVE_TP & (main_tls.align-1);
-+#else
- main_tls.offset = main_tls.size;
- #endif
-+ if (main_tls.align < MIN_TLS_ALIGN) main_tls.align = MIN_TLS_ALIGN;
-
- libc.tls_align = main_tls.align;
- libc.tls_size = 2*sizeof(void *) + sizeof(struct pthread)
-+#ifdef TLS_ABOVE_TP
-+ + main_tls.offset
-+#endif
- + main_tls.size + main_tls.align
- + MIN_TLS_ALIGN-1 & -MIN_TLS_ALIGN;
-
-diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c
-index 2d758af7..0583f686 100644
---- a/src/env/__libc_start_main.c
-+++ b/src/env/__libc_start_main.c
-@@ -42,11 +42,13 @@ void __init_libc(char **envp, char *pn)
- && !aux[AT_SECURE]) return;
-
- struct pollfd pfd[3] = { {.fd=0}, {.fd=1}, {.fd=2} };
-+ int r =
- #ifdef SYS_poll
- __syscall(SYS_poll, pfd, 3, 0);
- #else
- __syscall(SYS_ppoll, pfd, 3, &(struct timespec){0}, 0, _NSIG/8);
- #endif
-+ if (r<0) a_crash();
- for (i=0; i<3; i++) if (pfd[i].revents&POLLNVAL)
- if (__sys_open("/dev/null", O_RDWR)<0)
- a_crash();
-diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c
-index 7172a1be..ad9f9241 100644
---- a/src/errno/__errno_location.c
-+++ b/src/errno/__errno_location.c
-@@ -1,3 +1,4 @@
-+#include <errno.h>
- #include "pthread_impl.h"
-
- int *__errno_location(void)
-diff --git a/src/errno/__strerror.h b/src/errno/__strerror.h
-index 915044b5..2f04d400 100644
---- a/src/errno/__strerror.h
-+++ b/src/errno/__strerror.h
-@@ -100,5 +100,6 @@ E(EREMOTEIO, "Remote I/O error")
- E(EDQUOT, "Quota exceeded")
- E(ENOMEDIUM, "No medium found")
- E(EMEDIUMTYPE, "Wrong medium type")
-+E(EMULTIHOP, "Multihop attempted")
-
- E(0, "No error information")
-diff --git a/src/exit/abort.c b/src/exit/abort.c
-index ecc0f735..5e5a87c3 100644
---- a/src/exit/abort.c
-+++ b/src/exit/abort.c
-@@ -1,13 +1,31 @@
- #include <stdlib.h>
- #include <signal.h>
-+#include <string.h>
- #include "syscall.h"
- #include "pthread_impl.h"
- #include "atomic.h"
-
- _Noreturn void abort(void)
- {
-+ struct sigaction abrtaction;
-+ sigset_t abrtset;
-+
- raise(SIGABRT);
- __block_all_sigs(0);
-+
-+ /* Unblock just SIGABRT, and set default handler */
-+ sigemptyset(&abrtset);
-+ sigaddset(&abrtset, SIGABRT);
-+ sigprocmask(SIG_UNBLOCK, &abrtset, 0);
-+
-+ memset(&abrtaction, 0, sizeof(struct sigaction));
-+ abrtaction.sa_handler = SIG_DFL;
-+
-+ sigaction(SIGABRT, &abrtaction, NULL);
-+
-+ raise(SIGABRT);
-+
-+ /* Ok, give up. */
- a_crash();
- raise(SIGKILL);
- _Exit(127);
-diff --git a/src/fenv/m68k/fenv.c b/src/fenv/m68k/fenv.c
-new file mode 100644
-index 00000000..e60949d1
---- /dev/null
-+++ b/src/fenv/m68k/fenv.c
-@@ -0,0 +1,84 @@
-+#include <fenv.h>
-+
-+#if __HAVE_68881__ || __mcffpu__
-+
-+static unsigned getsr()
-+{
-+ unsigned v;
-+ __asm__ __volatile__ ("fmove.l %%fpsr,%0" : "=dm"(v));
-+ return v;
-+}
-+
-+static void setsr(unsigned v)
-+{
-+ __asm__ __volatile__ ("fmove.l %0,%%fpsr" : : "dm"(v));
-+}
-+
-+static unsigned getcr()
-+{
-+ unsigned v;
-+ __asm__ __volatile__ ("fmove.l %%fpcr,%0" : "=dm"(v));
-+ return v;
-+}
-+
-+static void setcr(unsigned v)
-+{
-+ __asm__ __volatile__ ("fmove.l %0,%%fpcr" : : "dm"(v));
-+}
-+
-+int feclearexcept(int mask)
-+{
-+ if (mask & ~FE_ALL_EXCEPT) return -1;
-+ setsr(getsr() & ~mask);
-+ return 0;
-+}
-+
-+int feraiseexcept(int mask)
-+{
-+ if (mask & ~FE_ALL_EXCEPT) return -1;
-+ setsr(getsr() | mask);
-+ return 0;
-+}
-+
-+int fetestexcept(int mask)
-+{
-+ return getsr() & mask;
-+}
-+
-+int fegetround(void)
-+{
-+ return getcr() & FE_UPWARD;
-+}
-+
-+int __fesetround(int r)
-+{
-+ setcr((getcr() & ~FE_UPWARD) | r);
-+ return 0;
-+}
-+
-+int fegetenv(fenv_t *envp)
-+{
-+ envp->__control_register = getcr();
-+ envp->__status_register = getsr();
-+ __asm__ __volatile__ ("fmove.l %%fpiar,%0"
-+ : "=dm"(envp->__instruction_address));
-+ return 0;
-+}
-+
-+int fesetenv(const fenv_t *envp)
-+{
-+ static const fenv_t default_env = { 0 };
-+ if (envp == FE_DFL_ENV)
-+ envp = &default_env;
-+ setcr(envp->__control_register);
-+ setsr(envp->__status_register);
-+ __asm__ __volatile__ ("fmove.l %0,%%fpiar"
-+ : : "dm"(envp->__instruction_address));
-+ return 0;
-+}
-+
-+#else
-+
-+#include "../fenv.c"
-+
-+#endif
-diff --git a/src/internal/atomic.h b/src/internal/atomic.h
-index ab473dd7..f938879b 100644
---- a/src/internal/atomic.h
-+++ b/src/internal/atomic.h
-@@ -251,6 +251,22 @@ static inline void a_crash()
- }
- #endif
-
-+#ifndef a_ctz_32
-+#define a_ctz_32 a_ctz_32
-+static inline int a_ctz_32(uint32_t x)
-+{
-+#ifdef a_clz_32
-+ return 31-a_clz_32(x&-x);
-+#else
-+ static const char debruijn32[32] = {
-+ 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
-+ 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
-+ };
-+ return debruijn32[(x&-x)*0x076be629 >> 27];
-+#endif
-+}
-+#endif
-+
- #ifndef a_ctz_64
- #define a_ctz_64 a_ctz_64
- static inline int a_ctz_64(uint64_t x)
-@@ -261,22 +277,23 @@ static inline int a_ctz_64(uint64_t x)
- 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10,
- 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12
- };
-- static const char debruijn32[32] = {
-- 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
-- 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
-- };
- if (sizeof(long) < 8) {
- uint32_t y = x;
- if (!y) {
- y = x>>32;
-- return 32 + debruijn32[(y&-y)*0x076be629 >> 27];
-+ return 32 + a_ctz_32(y);
- }
-- return debruijn32[(y&-y)*0x076be629 >> 27];
-+ return a_ctz_32(y);
- }
- return debruijn64[(x&-x)*0x022fdd63cc95386dull >> 58];
- }
- #endif
-
-+static inline int a_ctz_l(unsigned long x)
-+{
-+ return (sizeof(long) < 8) ? a_ctz_32(x) : a_ctz_64(x);
-+}
-+
- #ifndef a_clz_64
- #define a_clz_64 a_clz_64
- static inline int a_clz_64(uint64_t x)
-@@ -298,17 +315,4 @@ static inline int a_clz_64(uint64_t x)
- }
- #endif
-
--#ifndef a_ctz_l
--#define a_ctz_l a_ctz_l
--static inline int a_ctz_l(unsigned long x)
--{
-- static const char debruijn32[32] = {
-- 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13,
-- 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14
-- };
-- if (sizeof(long) == 8) return a_ctz_64(x);
-- return debruijn32[(x&-x)*0x076be629 >> 27];
--}
--#endif
--
- #endif
-diff --git a/src/internal/libm.h b/src/internal/libm.h
-index df864111..a2505f7e 100644
---- a/src/internal/libm.h
-+++ b/src/internal/libm.h
-@@ -28,6 +28,17 @@ union ldshape {
- uint16_t se;
- } i;
- };
-+#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __BIG_ENDIAN
-+/* This is the m68k variant of 80-bit long double, and this definition only works
-+ * on archs where the alignment requirement of uint64_t is <= 4. */
-+union ldshape {
-+ long double f;
-+ struct {
-+ uint16_t se;
-+ uint16_t pad;
-+ uint64_t m;
-+ } i;
-+};
- #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN
- union ldshape {
- long double f;
-diff --git a/src/internal/m68k/syscall.s b/src/internal/m68k/syscall.s
-new file mode 100644
-index 00000000..9972a34d
---- /dev/null
-+++ b/src/internal/m68k/syscall.s
-@@ -0,0 +1,9 @@
-+.global __syscall
-+.hidden __syscall
-+.type __syscall,%function
-+__syscall:
-+ movem.l %d2-%d5,-(%sp)
-+ movem.l 20(%sp),%d0-%d5/%a0
-+ trap #0
-+ movem.l (%sp)+,%d2-%d5
-+ rts
-diff --git a/src/internal/malloc_impl.h b/src/internal/malloc_impl.h
-new file mode 100644
-index 00000000..5d025b06
---- /dev/null
-+++ b/src/internal/malloc_impl.h
-@@ -0,0 +1,45 @@
-+#ifndef MALLOC_IMPL_H
-+#define MALLOC_IMPL_H
-+
-+void *__mmap(void *, size_t, int, int, int, off_t);
-+int __munmap(void *, size_t);
-+void *__mremap(void *, size_t, size_t, int, ...);
-+int __madvise(void *, size_t, int);
-+
-+struct chunk {
-+ size_t psize, csize;
-+ struct chunk *next, *prev;
-+};
-+
-+struct bin {
-+ volatile int lock[2];
-+ struct chunk *head;
-+ struct chunk *tail;
-+};
-+
-+#define SIZE_ALIGN (4*sizeof(size_t))
-+#define SIZE_MASK (-SIZE_ALIGN)
-+#define OVERHEAD (2*sizeof(size_t))
-+#define MMAP_THRESHOLD (0x1c00*SIZE_ALIGN)
-+#define DONTCARE 16
-+#define RECLAIM 163840
-+
-+#define CHUNK_SIZE(c) ((c)->csize & -2)
-+#define CHUNK_PSIZE(c) ((c)->psize & -2)
-+#define PREV_CHUNK(c) ((struct chunk *)((char *)(c) - CHUNK_PSIZE(c)))
-+#define NEXT_CHUNK(c) ((struct chunk *)((char *)(c) + CHUNK_SIZE(c)))
-+#define MEM_TO_CHUNK(p) (struct chunk *)((char *)(p) - OVERHEAD)
-+#define CHUNK_TO_MEM(c) (void *)((char *)(c) + OVERHEAD)
-+#define BIN_TO_CHUNK(i) (MEM_TO_CHUNK(&mal.bins[i].head))
-+
-+#define C_INUSE ((size_t)1)
-+
-+#define IS_MMAPPED(c) !((c)->csize & (C_INUSE))
-+
-+__attribute__((__visibility__("hidden")))
-+void __bin_chunk(struct chunk *);
-+
-+__attribute__((__visibility__("hidden")))
-+extern int __malloc_replaced;
-+
-+#endif
-diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
-index f6a4f2c2..3826bd8e 100644
---- a/src/internal/pthread_impl.h
-+++ b/src/internal/pthread_impl.h
-@@ -19,38 +19,36 @@ struct pthread {
- void **dtv, *unused1, *unused2;
- uintptr_t sysinfo;
- uintptr_t canary, canary2;
-- pid_t tid, pid;
-
- /* Part 2 -- implementation details, non-ABI. */
-- int tsd_used, errno_val;
-- volatile int cancel, canceldisable, cancelasync;
-- int detached;
-+ int tid;
-+ int errno_val;
-+ volatile int detach_state;
-+ volatile int cancel;
-+ volatile unsigned char canceldisable, cancelasync;
-+ unsigned char tsd_used:1;
-+ unsigned char unblock_cancel:1;
-+ unsigned char dlerror_flag:1;
- unsigned char *map_base;
- size_t map_size;
- void *stack;
- size_t stack_size;
-+ size_t guard_size;
- void *start_arg;
- void *(*start)(void *);
- void *result;
- struct __ptcb *cancelbuf;
- void **tsd;
-- volatile int dead;
- struct {
- volatile void *volatile head;
- long off;
- volatile void *volatile pending;
- } robust_list;
-- int unblock_cancel;
- volatile int timer_id;
- locale_t locale;
- volatile int killlock[1];
-- volatile int exitlock[1];
-- volatile int startlock[2];
-- unsigned long sigmask[_NSIG/8/sizeof(long)];
- char *dlerror_buf;
-- int dlerror_flag;
- void *stdio_locks;
-- size_t guard_size;
-
- /* Part 3 -- the positions of these fields relative to
- * the end of the structure is external and internal ABI. */
-@@ -58,6 +56,22 @@ struct pthread {
- void **dtv_copy;
- };
-
-+struct start_sched_args {
-+ void *start_arg;
-+ void *(*start_fn)(void *);
-+ sigset_t mask;
-+ pthread_attr_t *attr;
-+ volatile int futex;
-+};
-+
-+enum {
-+ DT_EXITED = 0,
-+ DT_EXITING,
-+ DT_JOINABLE,
-+ DT_DETACHED,
-+ DT_DYNAMIC,
-+};
-+
- struct __timer {
- int timerid;
- pthread_t thread;
-@@ -147,8 +161,8 @@ static inline void __wake(volatile void *addr, int cnt, int priv)
- static inline void __futexwait(volatile void *addr, int val, int priv)
- {
- if (priv) priv = FUTEX_PRIVATE;
-- __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val) != -ENOSYS ||
-- __syscall(SYS_futex, addr, FUTEX_WAIT, val);
-+ __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0) != -ENOSYS ||
-+ __syscall(SYS_futex, addr, FUTEX_WAIT, val, 0);
- }
-
- void __acquire_ptc(void);
-diff --git a/src/internal/stdio_impl.h b/src/internal/stdio_impl.h
-index 7cdf729d..1127a492 100644
---- a/src/internal/stdio_impl.h
-+++ b/src/internal/stdio_impl.h
-@@ -9,7 +9,7 @@
-
- #define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0)
- #define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
--#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
-+#define FUNLOCK(f) do { if (__need_unlock) __unlockfile((f)); } while (0)
-
- #define F_PERM 1
- #define F_NORD 4
-diff --git a/src/ipc/msgctl.c b/src/ipc/msgctl.c
-index 4372c719..ea9b2337 100644
---- a/src/ipc/msgctl.c
-+++ b/src/ipc/msgctl.c
-@@ -1,12 +1,34 @@
- #include <sys/msg.h>
-+#include <endian.h>
- #include "syscall.h"
- #include "ipc.h"
-
-+#if __BYTE_ORDER != __BIG_ENDIAN
-+#undef SYSCALL_IPC_BROKEN_MODE
-+#endif
-+
- int msgctl(int q, int cmd, struct msqid_ds *buf)
- {
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ struct msqid_ds tmp;
-+ if (cmd == IPC_SET) {
-+ tmp = *buf;
-+ tmp.msg_perm.mode *= 0x10000U;
-+ buf = &tmp;
-+ }
-+#endif
- #ifdef SYS_msgctl
-- return syscall(SYS_msgctl, q, cmd | IPC_64, buf);
-+ int r = __syscall(SYS_msgctl, q, cmd | IPC_64, buf);
- #else
-- return syscall(SYS_ipc, IPCOP_msgctl, q, cmd | IPC_64, 0, buf, 0);
-+ int r = __syscall(SYS_ipc, IPCOP_msgctl, q, cmd | IPC_64, 0, buf, 0);
-+#endif
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ if (r >= 0) switch (cmd) {
-+ case IPC_STAT:
-+ case MSG_STAT:
-+ case MSG_STAT_ANY:
-+ buf->msg_perm.mode >>= 16;
-+ }
- #endif
-+ return __syscall_ret(r);
- }
-diff --git a/src/ipc/semctl.c b/src/ipc/semctl.c
-index 673a9a8c..941e2813 100644
---- a/src/ipc/semctl.c
-+++ b/src/ipc/semctl.c
-@@ -1,8 +1,13 @@
- #include <sys/sem.h>
- #include <stdarg.h>
-+#include <endian.h>
- #include "syscall.h"
- #include "ipc.h"
-
-+#if __BYTE_ORDER != __BIG_ENDIAN
-+#undef SYSCALL_IPC_BROKEN_MODE
-+#endif
-+
- union semun {
- int val;
- struct semid_ds *buf;
-@@ -20,9 +25,26 @@ int semctl(int id, int num, int cmd, ...)
- arg = va_arg(ap, union semun);
- va_end(ap);
- }
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ struct semid_ds tmp;
-+ if (cmd == IPC_SET) {
-+ tmp = *arg.buf;
-+ tmp.sem_perm.mode *= 0x10000U;
-+ arg.buf = &tmp;
-+ }
-+#endif
- #ifdef SYS_semctl
-- return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
-+ int r = __syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
- #else
-- return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
-+ int r = __syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
-+#endif
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ if (r >= 0) switch (cmd) {
-+ case IPC_STAT:
-+ case SEM_STAT:
-+ case SEM_STAT_ANY:
-+ arg.buf->sem_perm.mode >>= 16;
-+ }
- #endif
-+ return __syscall_ret(r);
- }
-diff --git a/src/ipc/shmctl.c b/src/ipc/shmctl.c
-index e2879f20..c951a581 100644
---- a/src/ipc/shmctl.c
-+++ b/src/ipc/shmctl.c
-@@ -1,12 +1,34 @@
- #include <sys/shm.h>
-+#include <endian.h>
- #include "syscall.h"
- #include "ipc.h"
-
-+#if __BYTE_ORDER != __BIG_ENDIAN
-+#undef SYSCALL_IPC_BROKEN_MODE
-+#endif
-+
- int shmctl(int id, int cmd, struct shmid_ds *buf)
- {
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ struct shmid_ds tmp;
-+ if (cmd == IPC_SET) {
-+ tmp = *buf;
-+ tmp.shm_perm.mode *= 0x10000U;
-+ buf = &tmp;
-+ }
-+#endif
- #ifdef SYS_shmctl
-- return syscall(SYS_shmctl, id, cmd | IPC_64, buf);
-+ int r = __syscall(SYS_shmctl, id, cmd | IPC_64, buf);
- #else
-- return syscall(SYS_ipc, IPCOP_shmctl, id, cmd | IPC_64, 0, buf, 0);
-+ int r = __syscall(SYS_ipc, IPCOP_shmctl, id, cmd | IPC_64, 0, buf, 0);
-+#endif
-+#ifdef SYSCALL_IPC_BROKEN_MODE
-+ if (r >= 0) switch (cmd) {
-+ case IPC_STAT:
-+ case SHM_STAT:
-+ case SHM_STAT_ANY:
-+ buf->shm_perm.mode >>= 16;
-+ }
- #endif
-+ return __syscall_ret(r);
- }
-diff --git a/src/ldso/aarch64/tlsdesc.s b/src/ldso/aarch64/tlsdesc.s
-index 8ed5c267..8e4004d7 100644
---- a/src/ldso/aarch64/tlsdesc.s
-+++ b/src/ldso/aarch64/tlsdesc.s
-@@ -14,7 +14,7 @@ __tlsdesc_static:
- // size_t __tlsdesc_dynamic(size_t *a)
- // {
- // struct {size_t modidx,off;} *p = (void*)a[1];
--// size_t *dtv = *(size_t**)(tp + 16 - 8);
-+// size_t *dtv = *(size_t**)(tp - 8);
- // if (p->modidx <= dtv[0])
- // return dtv[p->modidx] + p->off - tp;
- // return __tls_get_new(p) - tp;
-@@ -28,8 +28,7 @@ __tlsdesc_dynamic:
- mrs x1,tpidr_el0 // tp
- ldr x0,[x0,#8] // p
- ldr x2,[x0] // p->modidx
-- add x3,x1,#8
-- ldr x3,[x3] // dtv
-+ ldr x3,[x1,#-8] // dtv
- ldr x4,[x3] // dtv[0]
- cmp x2,x4
- b.hi 1f
-diff --git a/src/ldso/m68k/dlsym.s b/src/ldso/m68k/dlsym.s
-new file mode 100644
-index 00000000..5209ae1b
---- /dev/null
-+++ b/src/ldso/m68k/dlsym.s
-@@ -0,0 +1,12 @@
-+.text
-+.global dlsym
-+.hidden __dlsym
-+.type dlsym,@function
-+dlsym:
-+ move.l (%sp),-(%sp)
-+ move.l 12(%sp),-(%sp)
-+ move.l 12(%sp),-(%sp)
-+ lea __dlsym-.-8,%a1
-+ jsr (%pc,%a1)
-+ add.l #12,%sp
-+ rts
-diff --git a/src/linux/getrandom.c b/src/linux/getrandom.c
-new file mode 100644
-index 00000000..6cc6f6b0
---- /dev/null
-+++ b/src/linux/getrandom.c
-@@ -0,0 +1,7 @@
-+#include <sys/random.h>
-+#include "syscall.h"
-+
-+ssize_t getrandom(void *buf, size_t buflen, unsigned flags)
-+{
-+ return syscall_cp(SYS_getrandom, buf, buflen, flags);
-+}
-diff --git a/src/linux/memfd_create.c b/src/linux/memfd_create.c
-new file mode 100644
-index 00000000..1649fe55
---- /dev/null
-+++ b/src/linux/memfd_create.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE 1
-+#include <sys/mman.h>
-+#include "syscall.h"
-+
-+int memfd_create(const char *name, unsigned flags)
-+{
-+ return syscall(SYS_memfd_create, name, flags);
-+}
-diff --git a/src/linux/mlock2.c b/src/linux/mlock2.c
-new file mode 100644
-index 00000000..10132742
---- /dev/null
-+++ b/src/linux/mlock2.c
-@@ -0,0 +1,10 @@
-+#define _GNU_SOURCE 1
-+#include <sys/mman.h>
-+#include "syscall.h"
-+
-+int mlock2(const void *addr, size_t len, unsigned flags)
-+{
-+ if (flags == 0)
-+ return mlock(addr, len);
-+ return syscall(SYS_mlock2, addr, len, flags);
-+}
-diff --git a/src/locale/iconv.c b/src/locale/iconv.c
-index d469856c..3047c27b 100644
---- a/src/locale/iconv.c
-+++ b/src/locale/iconv.c
-@@ -458,16 +458,24 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
- * range in the hkscs table then hard-coded
- * here. Ugly, yes. */
- if (c/256 == 0xdc) {
-- if (totype-0300U > 8) k = 2;
-- else k = "\10\4\4\10\4\4\10\2\4"[totype-0300];
-- if (k > *outb) goto toobig;
-- x += iconv(combine_to_from(to, 0),
-+ union {
-+ char c[8];
-+ wchar_t wc[2];
-+ } tmp;
-+ char *ptmp = tmp.c;
-+ size_t tmpx = iconv(combine_to_from(to, find_charmap("utf8")),
- &(char *){"\303\212\314\204"
- "\303\212\314\214"
- "\303\252\314\204"
- "\303\252\314\214"
- +c%256}, &(size_t){4},
-- out, outb);
-+ &ptmp, &(size_t){sizeof tmp});
-+ size_t tmplen = ptmp - tmp.c;
-+ if (tmplen > *outb) goto toobig;
-+ if (tmpx) x++;
-+ memcpy(*out, &tmp, tmplen);
-+ *out += tmplen;
-+ *outb -= tmplen;
- continue;
- }
- if (!c) goto ilseq;
-@@ -539,6 +547,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
- if (*outb < 1) goto toobig;
- if (c<256 && c==legacy_map(tomap, c)) {
- revout:
-+ if (*outb < 1) goto toobig;
- *(*out)++ = c;
- *outb -= 1;
- break;
-@@ -645,6 +654,8 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
- *out += 4;
- *outb -= 4;
- break;
-+ case UTF_32:
-+ totype = UTF_32BE;
- case UTF_32BE:
- case UTF_32LE:
- if (*outb < 4) goto toobig;
-diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c
-index b16caf44..83be6433 100644
---- a/src/locale/langinfo.c
-+++ b/src/locale/langinfo.c
-@@ -33,7 +33,7 @@ char *__nl_langinfo_l(nl_item item, locale_t loc)
- int idx = item & 65535;
- const char *str;
-
-- if (item == CODESET) return MB_CUR_MAX==1 ? "ASCII" : "UTF-8";
-+ if (item == CODESET) return loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII";
-
- /* _NL_LOCALE_NAME extension */
- if (idx == 65535 && cat < LC_ALL)
diff --git a/src/locale/setlocale.c b/src/locale/setlocale.c
index 40bc7ece..4d51cdfe 100644
--- a/src/locale/setlocale.c
@@ -4415,675 +150,6 @@ index 40bc7ece..4d51cdfe 100644
LOCK(lock);
/* For LC_ALL, setlocale is required to return a string which
-diff --git a/src/malloc/__brk.c b/src/malloc/__brk.c
-deleted file mode 100644
-index 4c9119b4..00000000
---- a/src/malloc/__brk.c
-+++ /dev/null
-@@ -1,7 +0,0 @@
--#include <stdint.h>
--#include "syscall.h"
--
--uintptr_t __brk(uintptr_t newbrk)
--{
-- return __syscall(SYS_brk, newbrk);
--}
-diff --git a/src/malloc/calloc.c b/src/malloc/calloc.c
-deleted file mode 100644
-index 436c0b03..00000000
---- a/src/malloc/calloc.c
-+++ /dev/null
-@@ -1,13 +0,0 @@
--#include <stdlib.h>
--#include <errno.h>
--
--void *__malloc0(size_t);
--
--void *calloc(size_t m, size_t n)
--{
-- if (n && m > (size_t)-1/n) {
-- errno = ENOMEM;
-- return 0;
-- }
-- return __malloc0(n * m);
--}
-diff --git a/src/malloc/lite_malloc.c b/src/malloc/lite_malloc.c
-index 701f60b4..96c4feac 100644
---- a/src/malloc/lite_malloc.c
-+++ b/src/malloc/lite_malloc.c
-@@ -47,4 +47,14 @@ static void *__simple_malloc(size_t n)
- }
-
- weak_alias(__simple_malloc, malloc);
--weak_alias(__simple_malloc, __malloc0);
-+
-+static void *__simple_calloc(size_t m, size_t n)
-+{
-+ if (n && m > (size_t)-1/n) {
-+ errno = ENOMEM;
-+ return 0;
-+ }
-+ return __simple_malloc(n * m);
-+}
-+
-+weak_alias(__simple_calloc, calloc);
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 9e05e1d6..d72883e1 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -8,53 +8,19 @@
- #include "libc.h"
- #include "atomic.h"
- #include "pthread_impl.h"
-+#include "malloc_impl.h"
-
- #if defined(__GNUC__) && defined(__PIC__)
- #define inline inline __attribute__((always_inline))
- #endif
-
--void *__mmap(void *, size_t, int, int, int, off_t);
--int __munmap(void *, size_t);
--void *__mremap(void *, size_t, size_t, int, ...);
--int __madvise(void *, size_t, int);
--
--struct chunk {
-- size_t psize, csize;
-- struct chunk *next, *prev;
--};
--
--struct bin {
-- volatile int lock[2];
-- struct chunk *head;
-- struct chunk *tail;
--};
--
- static struct {
- volatile uint64_t binmap;
- struct bin bins[64];
- volatile int free_lock[2];
- } mal;
-
--
--#define SIZE_ALIGN (4*sizeof(size_t))
--#define SIZE_MASK (-SIZE_ALIGN)
--#define OVERHEAD (2*sizeof(size_t))
--#define MMAP_THRESHOLD (0x1c00*SIZE_ALIGN)
--#define DONTCARE 16
--#define RECLAIM 163840
--
--#define CHUNK_SIZE(c) ((c)->csize & -2)
--#define CHUNK_PSIZE(c) ((c)->psize & -2)
--#define PREV_CHUNK(c) ((struct chunk *)((char *)(c) - CHUNK_PSIZE(c)))
--#define NEXT_CHUNK(c) ((struct chunk *)((char *)(c) + CHUNK_SIZE(c)))
--#define MEM_TO_CHUNK(p) (struct chunk *)((char *)(p) - OVERHEAD)
--#define CHUNK_TO_MEM(c) (void *)((char *)(c) + OVERHEAD)
--#define BIN_TO_CHUNK(i) (MEM_TO_CHUNK(&mal.bins[i].head))
--
--#define C_INUSE ((size_t)1)
--
--#define IS_MMAPPED(c) !((c)->csize & (C_INUSE))
--
-+int __malloc_replaced;
-
- /* Synchronization tools */
-
-@@ -314,7 +280,7 @@ static void trim(struct chunk *self, size_t n)
- next->psize = n1-n | C_INUSE;
- self->csize = n | C_INUSE;
-
-- free(CHUNK_TO_MEM(split));
-+ __bin_chunk(split);
- }
-
- void *malloc(size_t n)
-@@ -366,15 +332,40 @@ void *malloc(size_t n)
- return CHUNK_TO_MEM(c);
- }
-
--void *__malloc0(size_t n)
-+static size_t mal0_clear(char *p, size_t pagesz, size_t n)
- {
-+#ifdef __GNUC__
-+ typedef uint64_t __attribute__((__may_alias__)) T;
-+#else
-+ typedef unsigned char T;
-+#endif
-+ char *pp = p + n;
-+ size_t i = (uintptr_t)pp & (pagesz - 1);
-+ for (;;) {
-+ pp = memset(pp - i, 0, i);
-+ if (pp - p < pagesz) return pp - p;
-+ for (i = pagesz; i; i -= 2*sizeof(T), pp -= 2*sizeof(T))
-+ if (((T *)pp)[-1] | ((T *)pp)[-2])
-+ break;
-+ }
-+}
-+
-+void *calloc(size_t m, size_t n)
-+{
-+ if (n && m > (size_t)-1/n) {
-+ errno = ENOMEM;
-+ return 0;
-+ }
-+ n *= m;
- void *p = malloc(n);
-- if (p && !IS_MMAPPED(MEM_TO_CHUNK(p))) {
-- size_t *z;
-- n = (n + sizeof *z - 1)/sizeof *z;
-- for (z=p; n; n--, z++) if (*z) *z=0;
-+ if (!p) return p;
-+ if (!__malloc_replaced) {
-+ if (IS_MMAPPED(MEM_TO_CHUNK(p)))
-+ return p;
-+ if (n >= PAGE_SIZE)
-+ n = mal0_clear(p, PAGE_SIZE, n);
- }
-- return p;
-+ return memset(p, 0, n);
- }
-
- void *realloc(void *p, size_t n)
-@@ -397,10 +388,9 @@ void *realloc(void *p, size_t n)
- size_t newlen = n + extra;
- /* Crash on realloc of freed chunk */
- if (extra & 1) a_crash();
-- if (newlen < PAGE_SIZE && (new = malloc(n))) {
-- memcpy(new, p, n-OVERHEAD);
-- free(p);
-- return new;
-+ if (newlen < PAGE_SIZE && (new = malloc(n-OVERHEAD))) {
-+ n0 = n;
-+ goto copy_free_ret;
- }
- newlen = (newlen + PAGE_SIZE-1) & -PAGE_SIZE;
- if (oldlen == newlen) return p;
-@@ -443,34 +433,20 @@ copy_realloc:
- /* As a last resort, allocate a new chunk and copy to it. */
- new = malloc(n-OVERHEAD);
- if (!new) return 0;
-+copy_free_ret:
- memcpy(new, p, n0-OVERHEAD);
- free(CHUNK_TO_MEM(self));
- return new;
- }
-
--void free(void *p)
-+void __bin_chunk(struct chunk *self)
- {
-- struct chunk *self, *next;
-+ struct chunk *next = NEXT_CHUNK(self);
- size_t final_size, new_size, size;
- int reclaim=0;
- int i;
-
-- if (!p) return;
--
-- self = MEM_TO_CHUNK(p);
--
-- if (IS_MMAPPED(self)) {
-- size_t extra = self->psize;
-- char *base = (char *)self - extra;
-- size_t len = CHUNK_SIZE(self) + extra;
-- /* Crash on double free */
-- if (extra & 1) a_crash();
-- __munmap(base, len);
-- return;
-- }
--
- final_size = new_size = CHUNK_SIZE(self);
-- next = NEXT_CHUNK(self);
-
- /* Crash on corrupted footer (likely from buffer overflow) */
- if (next->psize != self->csize) a_crash();
-@@ -531,3 +507,44 @@ void free(void *p)
-
- unlock_bin(i);
- }
-+
-+static void unmap_chunk(struct chunk *self)
-+{
-+ size_t extra = self->psize;
-+ char *base = (char *)self - extra;
-+ size_t len = CHUNK_SIZE(self) + extra;
-+ /* Crash on double free */
-+ if (extra & 1) a_crash();
-+ __munmap(base, len);
-+}
-+
-+void free(void *p)
-+{
-+ if (!p) return;
-+
-+ struct chunk *self = MEM_TO_CHUNK(p);
-+
-+ if (IS_MMAPPED(self))
-+ unmap_chunk(self);
-+ else
-+ __bin_chunk(self);
-+}
-+
-+void __malloc_donate(char *start, char *end)
-+{
-+ size_t align_start_up = (SIZE_ALIGN-1) & (-(uintptr_t)start - OVERHEAD);
-+ size_t align_end_down = (SIZE_ALIGN-1) & (uintptr_t)end;
-+
-+ /* Getting past this condition ensures that the padding for alignment
-+ * and header overhead will not overflow and will leave a nonzero
-+ * multiple of SIZE_ALIGN bytes between start and end. */
-+ if (end - start <= OVERHEAD + align_start_up + align_end_down)
-+ return;
-+ start += align_start_up + OVERHEAD;
-+ end -= align_end_down;
-+
-+ struct chunk *c = MEM_TO_CHUNK(start), *n = MEM_TO_CHUNK(end);
-+ c->psize = n->csize = C_INUSE;
-+ c->csize = n->psize = C_INUSE | (end-start);
-+ __bin_chunk(c);
-+}
-diff --git a/src/malloc/memalign.c b/src/malloc/memalign.c
-index 006bd21c..8a6152f4 100644
---- a/src/malloc/memalign.c
-+++ b/src/malloc/memalign.c
-@@ -2,55 +2,53 @@
- #include <stdint.h>
- #include <errno.h>
- #include "libc.h"
--
--/* This function should work with most dlmalloc-like chunk bookkeeping
-- * systems, but it's only guaranteed to work with the native implementation
-- * used in this library. */
-+#include "malloc_impl.h"
-
- void *__memalign(size_t align, size_t len)
- {
-- unsigned char *mem, *new, *end;
-- size_t header, footer;
-+ unsigned char *mem, *new;
-
- if ((align & -align) != align) {
- errno = EINVAL;
-- return NULL;
-+ return 0;
- }
-
-- if (len > SIZE_MAX - align) {
-+ if (len > SIZE_MAX - align || __malloc_replaced) {
- errno = ENOMEM;
-- return NULL;
-+ return 0;
- }
-
-- if (align <= 4*sizeof(size_t)) {
-- if (!(mem = malloc(len)))
-- return NULL;
-- return mem;
-- }
-+ if (align <= SIZE_ALIGN)
-+ return malloc(len);
-
- if (!(mem = malloc(len + align-1)))
-- return NULL;
-+ return 0;
-
- new = (void *)((uintptr_t)mem + align-1 & -align);
- if (new == mem) return mem;
-
-- header = ((size_t *)mem)[-1];
-+ struct chunk *c = MEM_TO_CHUNK(mem);
-+ struct chunk *n = MEM_TO_CHUNK(new);
-
-- if (!(header & 7)) {
-- ((size_t *)new)[-2] = ((size_t *)mem)[-2] + (new-mem);
-- ((size_t *)new)[-1] = ((size_t *)mem)[-1] - (new-mem);
-+ if (IS_MMAPPED(c)) {
-+ /* Apply difference between aligned and original
-+ * address to the "extra" field of mmapped chunk. */
-+ n->psize = c->psize + (new-mem);
-+ n->csize = c->csize - (new-mem);
- return new;
- }
-
-- end = mem + (header & -8);
-- footer = ((size_t *)end)[-2];
-+ struct chunk *t = NEXT_CHUNK(c);
-
-- ((size_t *)mem)[-1] = header&7 | new-mem;
-- ((size_t *)new)[-2] = footer&7 | new-mem;
-- ((size_t *)new)[-1] = header&7 | end-new;
-- ((size_t *)end)[-2] = footer&7 | end-new;
-+ /* Split the allocated chunk into two chunks. The aligned part
-+ * that will be used has the size in its footer reduced by the
-+ * difference between the aligned and original addresses, and
-+ * the resulting size copied to its header. A new header and
-+ * footer are written for the split-off part to be freed. */
-+ n->psize = c->csize = C_INUSE | (new-mem);
-+ n->csize = t->psize -= new-mem;
-
-- free(mem);
-+ __bin_chunk(c);
- return new;
- }
-
-diff --git a/src/math/__fpclassifyl.c b/src/math/__fpclassifyl.c
-index 481c0b94..e41781b6 100644
---- a/src/math/__fpclassifyl.c
-+++ b/src/math/__fpclassifyl.c
-@@ -13,10 +13,18 @@ int __fpclassifyl(long double x)
- int msb = u.i.m>>63;
- if (!e && !msb)
- return u.i.m ? FP_SUBNORMAL : FP_ZERO;
-+ if (e == 0x7fff) {
-+ /* The x86 variant of 80-bit extended precision only admits
-+ * one representation of each infinity, with the mantissa msb
-+ * necessarily set. The version with it clear is invalid/nan.
-+ * The m68k variant, however, allows either, and tooling uses
-+ * the version with it clear. */
-+ if (__BYTE_ORDER == __LITTLE_ENDIAN && !msb)
-+ return FP_NAN;
-+ return u.i.m << 1 ? FP_NAN : FP_INFINITE;
-+ }
- if (!msb)
- return FP_NAN;
-- if (e == 0x7fff)
-- return u.i.m << 1 ? FP_NAN : FP_INFINITE;
- return FP_NORMAL;
- }
- #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
-diff --git a/src/math/fmaf.c b/src/math/fmaf.c
-index aa57feb6..80f5cd8a 100644
---- a/src/math/fmaf.c
-+++ b/src/math/fmaf.c
-@@ -50,7 +50,7 @@ float fmaf(float x, float y, float z)
- /* Common case: The double precision result is fine. */
- if ((u.i & 0x1fffffff) != 0x10000000 || /* not a halfway case */
- e == 0x7ff || /* NaN */
-- result - xy == z || /* exact */
-+ (result - xy == z && result - z == xy) || /* exact */
- fegetround() != FE_TONEAREST) /* not round-to-nearest */
- {
- /*
-diff --git a/src/misc/getentropy.c b/src/misc/getentropy.c
-new file mode 100644
-index 00000000..4c61ae26
---- /dev/null
-+++ b/src/misc/getentropy.c
-@@ -0,0 +1,31 @@
-+#include <sys/random.h>
-+#include <pthread.h>
-+#include <errno.h>
-+
-+int getentropy(void *buffer, size_t len)
-+{
-+ int cs, ret;
-+ char *pos = buffer;
-+
-+ if (len > 256) {
-+ errno = EIO;
-+ return -1;
-+ }
-+
-+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
-+
-+ while (len) {
-+ ret = getrandom(pos, len, 0);
-+ if (ret < 0) {
-+ if (errno == EINTR) continue;
-+ else break;
-+ }
-+ pos += ret;
-+ len -= ret;
-+ ret = 0;
-+ }
-+
-+ pthread_setcancelstate(cs, 0);
-+
-+ return ret;
-+}
-diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
-index ea65611a..25bb35db 100644
---- a/src/misc/gethostid.c
-+++ b/src/misc/gethostid.c
-@@ -1,3 +1,5 @@
-+#include <unistd.h>
-+
- long gethostid()
- {
- return 0;
-diff --git a/src/misc/getopt.c b/src/misc/getopt.c
-index e9bab41c..cd1f292f 100644
---- a/src/misc/getopt.c
-+++ b/src/misc/getopt.c
-@@ -77,15 +77,19 @@ int getopt(int argc, char * const argv[], const char *optstring)
- if (l>0) i+=l; else i++;
- } while (l && d != c);
-
-- if (d != c) {
-+ if (d != c || c == ':') {
- optopt = c;
- if (optstring[0] != ':' && opterr)
- __getopt_msg(argv[0], ": unrecognized option: ", optchar, k);
- return '?';
- }
- if (optstring[i] == ':') {
-- if (optstring[i+1] == ':') optarg = 0;
-- else if (optind >= argc) {
-+ optarg = 0;
-+ if (optstring[i+1] != ':' || optpos) {
-+ optarg = argv[optind++] + optpos;
-+ optpos = 0;
-+ }
-+ if (optind > argc) {
- optopt = c;
- if (optstring[0] == ':') return ':';
- if (opterr) __getopt_msg(argv[0],
-@@ -93,10 +97,6 @@ int getopt(int argc, char * const argv[], const char *optstring)
- optchar, k);
- return '?';
- }
-- if (optstring[i+1] != ':' || optpos) {
-- optarg = argv[optind++] + optpos;
-- optpos = 0;
-- }
- }
- return c;
- }
-diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c
-index 008b747c..ddcef949 100644
---- a/src/misc/getopt_long.c
-+++ b/src/misc/getopt_long.c
-@@ -1,5 +1,7 @@
- #define _GNU_SOURCE
- #include <stddef.h>
-+#include <stdlib.h>
-+#include <limits.h>
- #include <getopt.h>
- #include <stdio.h>
- #include <string.h>
-@@ -58,10 +60,10 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring
- {
- int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':';
- int i, cnt, match;
-- char *arg, *opt;
-+ char *arg, *opt, *start = argv[optind]+1;
- for (cnt=i=0; longopts[i].name; i++) {
- const char *name = longopts[i].name;
-- opt = argv[optind]+1;
-+ opt = start;
- if (*opt == '-') opt++;
- while (*opt && *opt != '=' && *opt == *name)
- name++, opt++;
-@@ -74,6 +76,17 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring
- }
- cnt++;
- }
-+ if (cnt==1 && longonly && arg-start == mblen(start, MB_LEN_MAX)) {
-+ int l = arg-start;
-+ for (i=0; optstring[i]; i++) {
-+ int j;
-+ for (j=0; j<l && start[j]==optstring[i+j]; j++);
-+ if (j==l) {
-+ cnt++;
-+ break;
-+ }
-+ }
-+ }
- if (cnt==1) {
- i = match;
- opt = arg;
-diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c
-index b9439f77..ba26847a 100644
---- a/src/network/getaddrinfo.c
-+++ b/src/network/getaddrinfo.c
-@@ -3,6 +3,10 @@
- #include <netinet/in.h>
- #include <netdb.h>
- #include <string.h>
-+#include <pthread.h>
-+#include <unistd.h>
-+#include <endian.h>
-+#include <errno.h>
- #include "lookup.h"
-
- int getaddrinfo(const char *restrict host, const char *restrict serv, const struct addrinfo *restrict hint, struct addrinfo **restrict res)
-@@ -43,6 +47,41 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru
- }
- }
-
-+ if (flags & AI_ADDRCONFIG) {
-+ /* Define the "an address is configured" condition for address
-+ * families via ability to create a socket for the family plus
-+ * routability of the loopback address for the family. */
-+ static const struct sockaddr_in lo4 = {
-+ .sin_family = AF_INET, .sin_port = 65535,
-+ .sin_addr.s_addr = __BYTE_ORDER == __BIG_ENDIAN
-+ ? 0x7f000001 : 0x0100007f
-+ };
-+ static const struct sockaddr_in6 lo6 = {
-+ .sin6_family = AF_INET6, .sin6_port = 65535,
-+ .sin6_addr = IN6ADDR_LOOPBACK_INIT
-+ };
-+ int tf[2] = { AF_INET, AF_INET6 };
-+ const void *ta[2] = { &lo4, &lo6 };
-+ socklen_t tl[2] = { sizeof lo4, sizeof lo6 };
-+ for (i=0; i<2; i++) {
-+ if (family==tf[1-i]) continue;
-+ int s = socket(tf[i], SOCK_CLOEXEC|SOCK_DGRAM,
-+ IPPROTO_UDP);
-+ if (s>=0) {
-+ int cs;
-+ pthread_setcancelstate(
-+ PTHREAD_CANCEL_DISABLE, &cs);
-+ int r = connect(s, ta[i], tl[i]);
-+ pthread_setcancelstate(cs, 0);
-+ close(s);
-+ if (!r) continue;
-+ }
-+ if (errno != EAFNOSUPPORT) return EAI_SYSTEM;
-+ if (family == tf[i]) return EAI_NONAME;
-+ family = tf[1-i];
-+ }
-+ }
-+
- nservs = __lookup_serv(ports, serv, proto, socktype, flags);
- if (nservs < 0) return nservs;
-
-diff --git a/src/network/inet_ntop.c b/src/network/inet_ntop.c
-index 14f9f4c4..4bfef2c5 100644
---- a/src/network/inet_ntop.c
-+++ b/src/network/inet_ntop.c
-@@ -36,7 +36,7 @@ const char *inet_ntop(int af, const void *restrict a0, char *restrict s, socklen
- j = strspn(buf+i, ":0");
- if (j>max) best=i, max=j;
- }
-- if (max>2) {
-+ if (max>3) {
- buf[best] = buf[best+1] = ':';
- memmove(buf+best+2, buf+best+max, i-best-max+1);
- }
-diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c
-index 209c20f0..0e6db9ef 100644
---- a/src/network/lookup_name.c
-+++ b/src/network/lookup_name.c
-@@ -184,6 +184,10 @@ static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[
- for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++;
- if (dots >= conf.ndots || name[l-1]=='.') *search = 0;
-
-+ /* Strip final dot for canon, fail if multiple trailing dots. */
-+ if (name[l-1]=='.') l--;
-+ if (!l || name[l-1]=='.') return EAI_NONAME;
-+
- /* This can never happen; the caller already checked length. */
- if (l >= 256) return EAI_NONAME;
-
-@@ -351,36 +355,53 @@ int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], c
- * excessive runtime and code size cost and dubious benefit.
- * So far the label/precedence table cannot be customized. */
- for (i=0; i<cnt; i++) {
-+ int family = buf[i].family;
- int key = 0;
-- struct sockaddr_in6 sa, da = {
-+ struct sockaddr_in6 sa6 = { 0 }, da6 = {
- .sin6_family = AF_INET6,
- .sin6_scope_id = buf[i].scopeid,
- .sin6_port = 65535
- };
-- if (buf[i].family == AF_INET6) {
-- memcpy(da.sin6_addr.s6_addr, buf[i].addr, 16);
-+ struct sockaddr_in sa4 = { 0 }, da4 = {
-+ .sin_family = AF_INET,
-+ .sin_port = 65535
-+ };
-+ void *sa, *da;
-+ socklen_t salen, dalen;
-+ if (family == AF_INET6) {
-+ memcpy(da6.sin6_addr.s6_addr, buf[i].addr, 16);
-+ da = &da6; dalen = sizeof da6;
-+ sa = &sa6; salen = sizeof sa6;
- } else {
-- memcpy(da.sin6_addr.s6_addr,
-+ memcpy(sa6.sin6_addr.s6_addr,
-+ "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
-+ memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
-+ memcpy(da6.sin6_addr.s6_addr,
- "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
-- memcpy(da.sin6_addr.s6_addr+12, buf[i].addr, 4);
-+ memcpy(da6.sin6_addr.s6_addr+12, buf[i].addr, 4);
-+ memcpy(&da4.sin_addr, buf[i].addr, 4);
-+ da = &da4; dalen = sizeof da4;
-+ sa = &sa4; salen = sizeof sa4;
- }
-- const struct policy *dpolicy = policyof(&da.sin6_addr);
-- int dscope = scopeof(&da.sin6_addr);
-+ const struct policy *dpolicy = policyof(&da6.sin6_addr);
-+ int dscope = scopeof(&da6.sin6_addr);
- int dlabel = dpolicy->label;
- int dprec = dpolicy->prec;
- int prefixlen = 0;
-- int fd = socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
-+ int fd = socket(family, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP);
- if (fd >= 0) {
-- if (!connect(fd, (void *)&da, sizeof da)) {
-+ if (!connect(fd, da, dalen)) {
- key |= DAS_USABLE;
-- if (!getsockname(fd, (void *)&sa,
-- &(socklen_t){sizeof sa})) {
-- if (dscope == scopeof(&sa.sin6_addr))
-+ if (!getsockname(fd, sa, &salen)) {
-+ if (family == AF_INET) memcpy(
-+ &sa6.sin6_addr.s6_addr+12,
-+ &sa4.sin_addr, 4);
-+ if (dscope == scopeof(&sa6.sin6_addr))
- key |= DAS_MATCHINGSCOPE;
-- if (dlabel == labelof(&sa.sin6_addr))
-+ if (dlabel == labelof(&sa6.sin6_addr))
- key |= DAS_MATCHINGLABEL;
-- prefixlen = prefixmatch(&sa.sin6_addr,
-- &da.sin6_addr);
-+ prefixlen = prefixmatch(&sa6.sin6_addr,
-+ &da6.sin6_addr);
- }
- }
- close(fd);
diff --git a/src/process/execlp.c b/src/process/execlp.c
index 5eed886e..f6da398b 100644
--- a/src/process/execlp.c
@@ -5162,16 +228,10 @@ index 2dddeddb..fdd0ca48 100644
weak_alias(__execvpe, execvpe);
diff --git a/src/process/system.c b/src/process/system.c
-index 8cbdda06..aa01e13b 100644
+index 9135b815..aa01e13b 100644
--- a/src/process/system.c
+++ b/src/process/system.c
-@@ -14,12 +14,14 @@ int system(const char *cmd)
- pid_t pid;
- sigset_t old, reset;
- struct sigaction sa = { .sa_handler = SIG_IGN }, oldint, oldquit;
-- int status = 0x7f00, ret;
-+ int status = -1, ret;
- posix_spawnattr_t attr;
+@@ -19,7 +19,9 @@ int system(const char *cmd)
pthread_testcancel();
@@ -5182,1098 +242,11 @@ index 8cbdda06..aa01e13b 100644
sigaction(SIGINT, &sa, &oldint);
sigaction(SIGQUIT, &sa, &oldquit);
-diff --git a/src/setjmp/m68k/longjmp.s b/src/setjmp/m68k/longjmp.s
-new file mode 100644
-index 00000000..cdb05fb5
---- /dev/null
-+++ b/src/setjmp/m68k/longjmp.s
-@@ -0,0 +1,14 @@
-+.global _longjmp
-+.global longjmp
-+.type _longjmp,@function
-+.type longjmp,@function
-+_longjmp:
-+longjmp:
-+ movea.l 4(%sp),%a0
-+ move.l 8(%sp),%d0
-+ bne 1f
-+ move.l #1,%d0
-+1: movem.l (%a0),%d2-%d7/%a2-%a7
-+ fmovem.x 52(%a0),%fp2-%fp7
-+ move.l 48(%a0),(%sp)
-+ rts
-diff --git a/src/setjmp/m68k/setjmp.s b/src/setjmp/m68k/setjmp.s
-new file mode 100644
-index 00000000..15e549b0
---- /dev/null
-+++ b/src/setjmp/m68k/setjmp.s
-@@ -0,0 +1,18 @@
-+.global ___setjmp
-+.hidden ___setjmp
-+.global __setjmp
-+.global _setjmp
-+.global setjmp
-+.type __setjmp,@function
-+.type _setjmp,@function
-+.type setjmp,@function
-+___setjmp:
-+__setjmp:
-+_setjmp:
-+setjmp:
-+ movea.l 4(%sp),%a0
-+ movem.l %d2-%d7/%a2-%a7,(%a0)
-+ move.l (%sp),48(%a0)
-+ fmovem.x %fp2-%fp7,52(%a0)
-+ clr.l %d0
-+ rts
-diff --git a/src/signal/m68k/sigsetjmp.s b/src/signal/m68k/sigsetjmp.s
-new file mode 100644
-index 00000000..09bfa646
---- /dev/null
-+++ b/src/signal/m68k/sigsetjmp.s
-@@ -0,0 +1,29 @@
-+.global sigsetjmp
-+.global __sigsetjmp
-+.type sigsetjmp,@function
-+.type __sigsetjmp,@function
-+sigsetjmp:
-+__sigsetjmp:
-+ move.l 8(%sp),%d0
-+ beq 1f
-+
-+ movea.l 4(%sp),%a1
-+ move.l (%sp)+,156(%a1)
-+ move.l %a2,156+4+8(%a1)
-+ movea.l %a1,%a2
-+
-+.hidden ___setjmp
-+ lea ___setjmp-.-8,%a1
-+ jsr (%pc,%a1)
-+
-+ move.l 156(%a2),-(%sp)
-+ move.l %a2,4(%sp)
-+ move.l %d0,8(%sp)
-+ movea.l 156+4+8(%a2),%a2
-+
-+.hidden __sigsetjmp_tail
-+ lea __sigsetjmp_tail-.-8,%a1
-+ jmp (%pc,%a1)
-+
-+1: lea ___setjmp-.-8,%a1
-+ jmp (%pc,%a1)
-diff --git a/src/signal/psiginfo.c b/src/signal/psiginfo.c
-index 57be34cd..2b15982b 100644
---- a/src/signal/psiginfo.c
-+++ b/src/signal/psiginfo.c
-@@ -1,10 +1,6 @@
--#include <stdio.h>
--#include <string.h>
- #include <signal.h>
-
- void psiginfo(const siginfo_t *si, const char *msg)
- {
-- char *s = strsignal(si->si_signo);
-- if (msg) fprintf(stderr, "%s: %s\n", msg, s);
-- else fprintf(stderr, "%s\n", s);
-+ psignal(si->si_signo, msg);
- }
-diff --git a/src/signal/psignal.c b/src/signal/psignal.c
-index 02f1c760..138dbe00 100644
---- a/src/signal/psignal.c
-+++ b/src/signal/psignal.c
-@@ -1,10 +1,27 @@
--#include <stdio.h>
-+#include "stdio_impl.h"
- #include <string.h>
- #include <signal.h>
-+#include <errno.h>
-
- void psignal(int sig, const char *msg)
- {
-+ FILE *f = stderr;
- char *s = strsignal(sig);
-- if (msg) fprintf(stderr, "%s: %s\n", msg, s);
-- else fprintf(stderr, "%s\n", s);
-+
-+ FLOCK(f);
-+
-+ /* Save stderr's orientation and encoding rule, since psignal is not
-+ * permitted to change them. Save errno and restore it if there is no
-+ * error since fprintf might change it even on success but psignal is
-+ * not permitted to do so. */
-+ void *old_locale = f->locale;
-+ int old_mode = f->mode;
-+ int old_errno = errno;
-+
-+ if (fprintf(f, "%s%s%s\n", msg?msg:"", msg?": ":"", s)>=0)
-+ errno = old_errno;
-+ f->mode = old_mode;
-+ f->locale = old_locale;
-+
-+ FUNLOCK(f);
- }
-diff --git a/src/signal/sigisemptyset.c b/src/signal/sigisemptyset.c
-index 312c66cf..68b86624 100644
---- a/src/signal/sigisemptyset.c
-+++ b/src/signal/sigisemptyset.c
-@@ -4,6 +4,7 @@
-
- int sigisemptyset(const sigset_t *set)
- {
-- static const unsigned long zeroset[_NSIG/8/sizeof(long)];
-- return !memcmp(set, &zeroset, _NSIG/8);
-+ for (size_t i=0; i<_NSIG/8/sizeof *set->__bits; i++)
-+ if (set->__bits[i]) return 0;
-+ return 1;
- }
-diff --git a/src/signal/sigrtmin.c b/src/signal/sigrtmin.c
-index d0e769bb..c5a1fd92 100644
---- a/src/signal/sigrtmin.c
-+++ b/src/signal/sigrtmin.c
-@@ -1,3 +1,5 @@
-+#include <signal.h>
-+
- int __libc_current_sigrtmin()
- {
- return 35;
-diff --git a/src/stdio/__lockfile.c b/src/stdio/__lockfile.c
-index 9d967d6e..2ff75d8a 100644
---- a/src/stdio/__lockfile.c
-+++ b/src/stdio/__lockfile.c
-@@ -1,28 +1,25 @@
- #include "stdio_impl.h"
- #include "pthread_impl.h"
-
-+#define MAYBE_WAITERS 0x40000000
-+
- int __lockfile(FILE *f)
- {
-- int owner, tid = __pthread_self()->tid;
-- if (f->lock == tid)
-+ int owner = f->lock, tid = __pthread_self()->tid;
-+ if ((owner & ~MAYBE_WAITERS) == tid)
- return 0;
-- while ((owner = a_cas(&f->lock, 0, tid)))
-- __wait(&f->lock, &f->waiters, owner, 1);
-+ for (;;) {
-+ owner = a_cas(&f->lock, 0, tid);
-+ if (!owner) return 1;
-+ if (a_cas(&f->lock, owner, owner|MAYBE_WAITERS)==owner) break;
-+ }
-+ while ((owner = a_cas(&f->lock, 0, tid|MAYBE_WAITERS)))
-+ __futexwait(&f->lock, owner, 1);
- return 1;
- }
-
- void __unlockfile(FILE *f)
- {
-- a_store(&f->lock, 0);
--
-- /* The following read is technically invalid under situations
-- * of self-synchronized destruction. Another thread may have
-- * called fclose as soon as the above store has completed.
-- * Nonetheless, since FILE objects always live in memory
-- * obtained by malloc from the heap, it's safe to assume
-- * the dereferences below will not fault. In the worst case,
-- * a spurious syscall will be made. If the implementation of
-- * malloc changes, this assumption needs revisiting. */
--
-- if (f->waiters) __wake(&f->lock, 1, 1);
-+ if (a_swap(&f->lock, 0) & MAYBE_WAITERS)
-+ __wake(&f->lock, 1, 1);
- }
-diff --git a/src/stdio/__stdio_exit.c b/src/stdio/__stdio_exit.c
-index 191b4454..5741070f 100644
---- a/src/stdio/__stdio_exit.c
-+++ b/src/stdio/__stdio_exit.c
-@@ -19,6 +19,7 @@ void __stdio_exit(void)
- for (f=*__ofl_lock(); f; f=f->next) close_file(f);
- close_file(__stdin_used);
- close_file(__stdout_used);
-+ close_file(__stderr_used);
- }
-
- weak_alias(__stdio_exit, __stdio_exit_needed);
-diff --git a/src/stdio/__stdio_read.c b/src/stdio/__stdio_read.c
-index f8fa6d3b..ea675da3 100644
---- a/src/stdio/__stdio_read.c
-+++ b/src/stdio/__stdio_read.c
-@@ -9,10 +9,11 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len)
- };
- ssize_t cnt;
-
-- cnt = syscall(SYS_readv, f->fd, iov, 2);
-+ cnt = iov[0].iov_len ? syscall(SYS_readv, f->fd, iov, 2)
-+ : syscall(SYS_read, f->fd, iov[1].iov_base, iov[1].iov_len);
- if (cnt <= 0) {
-- f->flags |= F_EOF ^ ((F_ERR^F_EOF) & cnt);
-- return cnt;
-+ f->flags |= cnt ? F_ERR : F_EOF;
-+ return 0;
- }
- if (cnt <= iov[0].iov_len) return cnt;
- cnt -= iov[0].iov_len;
-diff --git a/src/stdio/__towrite.c b/src/stdio/__towrite.c
-index 0a69d926..b022cbca 100644
---- a/src/stdio/__towrite.c
-+++ b/src/stdio/__towrite.c
-@@ -3,7 +3,7 @@
- int __towrite(FILE *f)
- {
- f->mode |= f->mode-1;
-- if (f->flags & (F_NOWR)) {
-+ if (f->flags & F_NOWR) {
- f->flags |= F_ERR;
- return EOF;
- }
-diff --git a/src/stdio/fclose.c b/src/stdio/fclose.c
-index d687a877..c675413d 100644
---- a/src/stdio/fclose.c
-+++ b/src/stdio/fclose.c
-@@ -24,7 +24,7 @@ int fclose(FILE *f)
- r = fflush(f);
- r |= f->close(f);
-
-- if (f->getln_buf) free(f->getln_buf);
-+ free(f->getln_buf);
- if (!perm) free(f);
- else FUNLOCK(f);
-
-diff --git a/src/stdio/fgetpos.c b/src/stdio/fgetpos.c
-index c3fa0eb0..6eb361e1 100644
---- a/src/stdio/fgetpos.c
-+++ b/src/stdio/fgetpos.c
-@@ -4,7 +4,7 @@ int fgetpos(FILE *restrict f, fpos_t *restrict pos)
- {
- off_t off = __ftello(f);
- if (off < 0) return -1;
-- *(off_t *)pos = off;
-+ *(long long *)pos = off;
- return 0;
- }
-
-diff --git a/src/stdio/fileno.c b/src/stdio/fileno.c
-index ba7f9391..0bd0e988 100644
---- a/src/stdio/fileno.c
-+++ b/src/stdio/fileno.c
-@@ -1,13 +1,16 @@
- #include "stdio_impl.h"
-+#include <errno.h>
-
- int fileno(FILE *f)
- {
-- /* f->fd never changes, but the lock must be obtained and released
-- * anyway since this function cannot return while another thread
-- * holds the lock. */
- FLOCK(f);
-+ int fd = f->fd;
- FUNLOCK(f);
-- return f->fd;
-+ if (fd < 0) {
-+ errno = EBADF;
-+ return -1;
-+ }
-+ return fd;
- }
-
- weak_alias(fileno, fileno_unlocked);
-diff --git a/src/stdio/flockfile.c b/src/stdio/flockfile.c
-index a196c1ef..6806cf8b 100644
---- a/src/stdio/flockfile.c
-+++ b/src/stdio/flockfile.c
-@@ -1,10 +1,11 @@
- #include "stdio_impl.h"
- #include "pthread_impl.h"
-
-+void __register_locked_file(FILE *, pthread_t);
-+
- void flockfile(FILE *f)
- {
-- while (ftrylockfile(f)) {
-- int owner = f->lock;
-- if (owner) __wait(&f->lock, &f->waiters, owner, 1);
-- }
-+ if (!ftrylockfile(f)) return;
-+ __lockfile(f);
-+ __register_locked_file(f, __pthread_self());
- }
-diff --git a/src/stdio/fmemopen.c b/src/stdio/fmemopen.c
-index 2ce43d32..5e0eeb50 100644
---- a/src/stdio/fmemopen.c
-+++ b/src/stdio/fmemopen.c
-@@ -9,6 +9,12 @@ struct cookie {
- int mode;
- };
-
-+struct mem_FILE {
-+ FILE f;
-+ struct cookie c;
-+ unsigned char buf[UNGET+BUFSIZ], buf2[];
-+};
-+
- static off_t mseek(FILE *f, off_t off, int whence)
- {
- ssize_t base;
-@@ -72,8 +78,7 @@ static int mclose(FILE *m)
-
- FILE *fmemopen(void *restrict buf, size_t size, const char *restrict mode)
- {
-- FILE *f;
-- struct cookie *c;
-+ struct mem_FILE *f;
- int plus = !!strchr(mode, '+');
-
- if (!size || !strchr("rwa", *mode)) {
-@@ -86,29 +91,35 @@ FILE *fmemopen(void *restrict buf, size_t size, const char *restrict mode)
- return 0;
- }
-
-- f = calloc(sizeof *f + sizeof *c + UNGET + BUFSIZ + (buf?0:size), 1);
-+ f = malloc(sizeof *f + (buf?0:size));
- if (!f) return 0;
-- f->cookie = c = (void *)(f+1);
-- f->fd = -1;
-- f->lbf = EOF;
-- f->buf = (unsigned char *)(c+1) + UNGET;
-- f->buf_size = BUFSIZ;
-- if (!buf) buf = f->buf + BUFSIZ;
-+ memset(&f->f, 0, sizeof f->f);
-+ f->f.cookie = &f->c;
-+ f->f.fd = -1;
-+ f->f.lbf = EOF;
-+ f->f.buf = f->buf + UNGET;
-+ f->f.buf_size = sizeof f->buf - UNGET;
-+ if (!buf) {
-+ buf = f->buf2;;
-+ memset(buf, 0, size);
-+ }
-
-- c->buf = buf;
-- c->size = size;
-- c->mode = *mode;
-+ memset(&f->c, 0, sizeof f->c);
-+ f->c.buf = buf;
-+ f->c.size = size;
-+ f->c.mode = *mode;
-
-- if (!plus) f->flags = (*mode == 'r') ? F_NOWR : F_NORD;
-- if (*mode == 'r') c->len = size;
-- else if (*mode == 'a') c->len = c->pos = strnlen(buf, size);
-+ if (!plus) f->f.flags = (*mode == 'r') ? F_NOWR : F_NORD;
-+ if (*mode == 'r') f->c.len = size;
-+ else if (*mode == 'a') f->c.len = f->c.pos = strnlen(buf, size);
-+ else if (plus) *f->c.buf = 0;
-
-- f->read = mread;
-- f->write = mwrite;
-- f->seek = mseek;
-- f->close = mclose;
-+ f->f.read = mread;
-+ f->f.write = mwrite;
-+ f->f.seek = mseek;
-+ f->f.close = mclose;
-
-- if (!libc.threaded) f->lock = -1;
-+ if (!libc.threaded) f->f.lock = -1;
-
-- return __ofl_add(f);
-+ return __ofl_add(&f->f);
- }
-diff --git a/src/stdio/fopencookie.c b/src/stdio/fopencookie.c
-index 2f46dd53..da042fe8 100644
---- a/src/stdio/fopencookie.c
-+++ b/src/stdio/fopencookie.c
-@@ -116,15 +116,12 @@ FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t iofuncs)
-
- /* Set up our fcookie */
- f->fc.cookie = cookie;
-- f->fc.iofuncs.read = iofuncs.read;
-- f->fc.iofuncs.write = iofuncs.write;
-- f->fc.iofuncs.seek = iofuncs.seek;
-- f->fc.iofuncs.close = iofuncs.close;
-+ f->fc.iofuncs = iofuncs;
-
- f->f.fd = -1;
- f->f.cookie = &f->fc;
- f->f.buf = f->buf + UNGET;
-- f->f.buf_size = BUFSIZ;
-+ f->f.buf_size = sizeof f->buf - UNGET;
- f->f.lbf = EOF;
-
- /* Initialize op ptrs. No problem if some are unneeded. */
-diff --git a/src/stdio/fread.c b/src/stdio/fread.c
-index aef75f73..733d3716 100644
---- a/src/stdio/fread.c
-+++ b/src/stdio/fread.c
-@@ -25,7 +25,7 @@ size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f)
- /* Read the remainder directly */
- for (; l; l-=k, dest+=k) {
- k = __toread(f) ? 0 : f->read(f, dest, l);
-- if (k+1<=1) {
-+ if (!k) {
- FUNLOCK(f);
- return (len-l)/size;
- }
-diff --git a/src/stdio/fsetpos.c b/src/stdio/fsetpos.c
-index 5d76c8cd..6310424e 100644
---- a/src/stdio/fsetpos.c
-+++ b/src/stdio/fsetpos.c
-@@ -2,7 +2,7 @@
-
- int fsetpos(FILE *f, const fpos_t *pos)
- {
-- return __fseeko(f, *(const off_t *)pos, SEEK_SET);
-+ return __fseeko(f, *(const long long *)pos, SEEK_SET);
- }
-
- LFS64(fsetpos);
-diff --git a/src/stdio/ftrylockfile.c b/src/stdio/ftrylockfile.c
-index eb13c839..3b97807a 100644
---- a/src/stdio/ftrylockfile.c
-+++ b/src/stdio/ftrylockfile.c
-@@ -2,6 +2,8 @@
- #include "pthread_impl.h"
- #include <limits.h>
-
-+#define MAYBE_WAITERS 0x40000000
-+
- void __do_orphaned_stdio_locks()
- {
- FILE *f;
-@@ -18,23 +20,29 @@ void __unlist_locked_file(FILE *f)
- }
- }
-
-+void __register_locked_file(FILE *f, pthread_t self)
-+{
-+ f->lockcount = 1;
-+ f->prev_locked = 0;
-+ f->next_locked = self->stdio_locks;
-+ if (f->next_locked) f->next_locked->prev_locked = f;
-+ self->stdio_locks = f;
-+}
-+
- int ftrylockfile(FILE *f)
- {
- pthread_t self = __pthread_self();
- int tid = self->tid;
-- if (f->lock == tid) {
-+ int owner = f->lock;
-+ if ((owner & ~MAYBE_WAITERS) == tid) {
- if (f->lockcount == LONG_MAX)
- return -1;
- f->lockcount++;
- return 0;
- }
-- if (f->lock < 0) f->lock = 0;
-- if (f->lock || a_cas(&f->lock, 0, tid))
-+ if (owner < 0) f->lock = owner = 0;
-+ if (owner || a_cas(&f->lock, 0, tid))
- return -1;
-- f->lockcount = 1;
-- f->prev_locked = 0;
-- f->next_locked = self->stdio_locks;
-- if (f->next_locked) f->next_locked->prev_locked = f;
-- self->stdio_locks = f;
-+ __register_locked_file(f, self);
- return 0;
- }
-diff --git a/src/stdio/getdelim.c b/src/stdio/getdelim.c
-index 1ccd8029..d4b23882 100644
---- a/src/stdio/getdelim.c
-+++ b/src/stdio/getdelim.c
-@@ -3,8 +3,6 @@
- #include <inttypes.h>
- #include <errno.h>
-
--#define MIN(a,b) ((a)<(b) ? (a) : (b))
--
- ssize_t getdelim(char **restrict s, size_t *restrict n, int delim, FILE *restrict f)
- {
- char *tmp;
-diff --git a/src/stdio/open_memstream.c b/src/stdio/open_memstream.c
-index eab024da..40f5ad60 100644
---- a/src/stdio/open_memstream.c
-+++ b/src/stdio/open_memstream.c
-@@ -12,6 +12,12 @@ struct cookie {
- size_t space;
- };
-
-+struct ms_FILE {
-+ FILE f;
-+ struct cookie c;
-+ unsigned char buf[BUFSIZ];
-+};
-+
- static off_t ms_seek(FILE *f, off_t off, int whence)
- {
- ssize_t base;
-@@ -57,34 +63,35 @@ static int ms_close(FILE *f)
-
- FILE *open_memstream(char **bufp, size_t *sizep)
- {
-- FILE *f;
-- struct cookie *c;
-+ struct ms_FILE *f;
- char *buf;
-
-- if (!(f=malloc(sizeof *f + sizeof *c + BUFSIZ))) return 0;
-+ if (!(f=malloc(sizeof *f))) return 0;
- if (!(buf=malloc(sizeof *buf))) {
- free(f);
- return 0;
- }
-- memset(f, 0, sizeof *f + sizeof *c);
-- f->cookie = c = (void *)(f+1);
-+ memset(&f->f, 0, sizeof f->f);
-+ memset(&f->c, 0, sizeof f->c);
-+ f->f.cookie = &f->c;
-
-- c->bufp = bufp;
-- c->sizep = sizep;
-- c->pos = c->len = c->space = *sizep = 0;
-- c->buf = *bufp = buf;
-+ f->c.bufp = bufp;
-+ f->c.sizep = sizep;
-+ f->c.pos = f->c.len = f->c.space = *sizep = 0;
-+ f->c.buf = *bufp = buf;
- *buf = 0;
-
-- f->flags = F_NORD;
-- f->fd = -1;
-- f->buf = (void *)(c+1);
-- f->buf_size = BUFSIZ;
-- f->lbf = EOF;
-- f->write = ms_write;
-- f->seek = ms_seek;
-- f->close = ms_close;
-+ f->f.flags = F_NORD;
-+ f->f.fd = -1;
-+ f->f.buf = f->buf;
-+ f->f.buf_size = sizeof f->buf;
-+ f->f.lbf = EOF;
-+ f->f.write = ms_write;
-+ f->f.seek = ms_seek;
-+ f->f.close = ms_close;
-+ f->f.mode = -1;
-
-- if (!libc.threaded) f->lock = -1;
-+ if (!libc.threaded) f->f.lock = -1;
-
-- return __ofl_add(f);
-+ return __ofl_add(&f->f);
- }
-diff --git a/src/stdio/open_wmemstream.c b/src/stdio/open_wmemstream.c
-index 4d90cd97..a7c3a645 100644
---- a/src/stdio/open_wmemstream.c
-+++ b/src/stdio/open_wmemstream.c
-@@ -14,6 +14,12 @@ struct cookie {
- mbstate_t mbs;
- };
-
-+struct wms_FILE {
-+ FILE f;
-+ struct cookie c;
-+ unsigned char buf[1];
-+};
-+
- static off_t wms_seek(FILE *f, off_t off, int whence)
- {
- ssize_t base;
-@@ -59,34 +65,36 @@ static int wms_close(FILE *f)
-
- FILE *open_wmemstream(wchar_t **bufp, size_t *sizep)
- {
-- FILE *f;
-- struct cookie *c;
-+ struct wms_FILE *f;
- wchar_t *buf;
-
-- if (!(f=malloc(sizeof *f + sizeof *c))) return 0;
-+ if (!(f=malloc(sizeof *f))) return 0;
- if (!(buf=malloc(sizeof *buf))) {
- free(f);
- return 0;
- }
-- memset(f, 0, sizeof *f + sizeof *c);
-- f->cookie = c = (void *)(f+1);
-+ memset(&f->f, 0, sizeof f->f);
-+ memset(&f->c, 0, sizeof f->c);
-+ f->f.cookie = &f->c;
-
-- c->bufp = bufp;
-- c->sizep = sizep;
-- c->pos = c->len = c->space = *sizep = 0;
-- c->buf = *bufp = buf;
-+ f->c.bufp = bufp;
-+ f->c.sizep = sizep;
-+ f->c.pos = f->c.len = f->c.space = *sizep = 0;
-+ f->c.buf = *bufp = buf;
- *buf = 0;
-
-- f->flags = F_NORD;
-- f->fd = -1;
-- f->buf = (void *)(c+1);
-- f->buf_size = 0;
-- f->lbf = EOF;
-- f->write = wms_write;
-- f->seek = wms_seek;
-- f->close = wms_close;
-+ f->f.flags = F_NORD;
-+ f->f.fd = -1;
-+ f->f.buf = f->buf;
-+ f->f.buf_size = 0;
-+ f->f.lbf = EOF;
-+ f->f.write = wms_write;
-+ f->f.seek = wms_seek;
-+ f->f.close = wms_close;
-+
-+ if (!libc.threaded) f->f.lock = -1;
-
-- if (!libc.threaded) f->lock = -1;
-+ fwide(&f->f, 1);
-
-- return __ofl_add(f);
-+ return __ofl_add(&f->f);
- }
-diff --git a/src/stdio/perror.c b/src/stdio/perror.c
-index fdcb4d71..d0943f26 100644
---- a/src/stdio/perror.c
-+++ b/src/stdio/perror.c
-@@ -9,6 +9,11 @@ void perror(const char *msg)
- char *errstr = strerror(errno);
-
- FLOCK(f);
-+
-+ /* Save stderr's orientation and encoding rule, since perror is not
-+ * permitted to change them. */
-+ void *old_locale = f->locale;
-+ int old_mode = f->mode;
-
- if (msg && *msg) {
- fwrite(msg, strlen(msg), 1, f);
-@@ -18,5 +23,8 @@ void perror(const char *msg)
- fwrite(errstr, strlen(errstr), 1, f);
- fputc('\n', f);
-
-+ f->mode = old_mode;
-+ f->locale = old_locale;
-+
- FUNLOCK(f);
- }
-diff --git a/src/stdio/setvbuf.c b/src/stdio/setvbuf.c
-index 541a125f..06ea296c 100644
---- a/src/stdio/setvbuf.c
-+++ b/src/stdio/setvbuf.c
-@@ -1,22 +1,25 @@
- #include "stdio_impl.h"
-
--/* This function makes no attempt to protect the user from his/her own
-- * stupidity. If called any time but when then ISO C standard specifically
-- * allows it, all hell can and will break loose, especially with threads!
-- *
-- * This implementation ignores all arguments except the buffering type,
-- * and uses the existing buffer allocated alongside the FILE object.
-- * In the case of stderr where the preexisting buffer is length 1, it
-- * is not possible to set line buffering or full buffering. */
-+/* The behavior of this function is undefined except when it is the first
-+ * operation on the stream, so the presence or absence of locking is not
-+ * observable in a program whose behavior is defined. Thus no locking is
-+ * performed here. No allocation of buffers is performed, but a buffer
-+ * provided by the caller is used as long as it is suitably sized. */
-
- int setvbuf(FILE *restrict f, char *restrict buf, int type, size_t size)
- {
- f->lbf = EOF;
-
-- if (type == _IONBF)
-+ if (type == _IONBF) {
- f->buf_size = 0;
-- else if (type == _IOLBF)
-- f->lbf = '\n';
-+ } else {
-+ if (buf && size >= UNGET) {
-+ f->buf = (void *)(buf + UNGET);
-+ f->buf_size = size - UNGET;
-+ }
-+ if (type == _IOLBF && f->buf_size)
-+ f->lbf = '\n';
-+ }
-
- f->flags |= F_SVB;
-
-diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
-index 50fb55c1..2100eb5e 100644
---- a/src/stdio/vfprintf.c
-+++ b/src/stdio/vfprintf.c
-@@ -220,6 +220,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t)
- else re=LDBL_MANT_DIG/4-1-p;
-
- if (re) {
-+ round *= 1<<(LDBL_MANT_DIG%4);
- while (re--) round*=16;
- if (*prefix=='-') {
- y=-y;
-@@ -673,11 +674,12 @@ int vfprintf(FILE *restrict f, const char *restrict fmt, va_list ap)
- if (f->mode < 1) f->flags &= ~F_ERR;
- if (!f->buf_size) {
- saved_buf = f->buf;
-- f->wpos = f->wbase = f->buf = internal_buf;
-+ f->buf = internal_buf;
- f->buf_size = sizeof internal_buf;
-- f->wend = internal_buf + sizeof internal_buf;
-+ f->wpos = f->wbase = f->wend = 0;
- }
-- ret = printf_core(f, fmt, &ap2, nl_arg, nl_type);
-+ if (!f->wend && __towrite(f)) ret = -1;
-+ else ret = printf_core(f, fmt, &ap2, nl_arg, nl_type);
- if (saved_buf) {
- f->write(f, 0, 0);
- if (!f->wpos) ret = -1;
-diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c
-index e87ad42a..9d774fcc 100644
---- a/src/stdio/vfwprintf.c
-+++ b/src/stdio/vfwprintf.c
-@@ -255,8 +255,11 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
- }
- continue;
- case 'c':
-+ if (w<1) w=1;
-+ if (w>1 && !(fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
- fputwc(btowc(arg.i), f);
-- l = 1;
-+ if (w>1 && (fl&LEFT_ADJ)) fprintf(f, "%*s", w-1, "");
-+ l = w;
- continue;
- case 'C':
- fputwc(arg.i, f);
-diff --git a/src/stdio/vswprintf.c b/src/stdio/vswprintf.c
-index 6eb2f6ac..38efed65 100644
---- a/src/stdio/vswprintf.c
-+++ b/src/stdio/vswprintf.c
-@@ -1,6 +1,5 @@
- #include "stdio_impl.h"
- #include <limits.h>
--#include <string.h>
- #include <errno.h>
- #include <stdint.h>
- #include <wchar.h>
-@@ -37,17 +36,17 @@ static size_t sw_write(FILE *f, const unsigned char *s, size_t l)
- int vswprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict fmt, va_list ap)
- {
- int r;
-- FILE f;
- unsigned char buf[256];
- struct cookie c = { s, n-1 };
-+ FILE f = {
-+ .lbf = EOF,
-+ .write = sw_write,
-+ .lock = -1,
-+ .buf = buf,
-+ .buf_size = sizeof buf,
-+ .cookie = &c,
-+ };
-
-- memset(&f, 0, sizeof(FILE));
-- f.lbf = EOF;
-- f.write = sw_write;
-- f.buf_size = sizeof buf;
-- f.buf = buf;
-- f.lock = -1;
-- f.cookie = &c;
- if (!n) {
- return -1;
- } else if (n > INT_MAX) {
-diff --git a/src/stdlib/abs.c b/src/stdlib/abs.c
-index 4806d629..e721fdc2 100644
---- a/src/stdlib/abs.c
-+++ b/src/stdlib/abs.c
-@@ -1,3 +1,5 @@
-+#include <stdlib.h>
-+
- int abs(int a)
- {
- return a>0 ? a : -a;
-diff --git a/src/stdlib/bsearch.c b/src/stdlib/bsearch.c
-index 61d89367..fe050ea3 100644
---- a/src/stdlib/bsearch.c
-+++ b/src/stdlib/bsearch.c
-@@ -7,13 +7,13 @@ void *bsearch(const void *key, const void *base, size_t nel, size_t width, int (
- while (nel > 0) {
- try = (char *)base + width*(nel/2);
- sign = cmp(key, try);
-- if (!sign) return try;
-- else if (nel == 1) break;
-- else if (sign < 0)
-+ if (sign < 0) {
- nel /= 2;
-- else {
-- base = try;
-- nel -= nel/2;
-+ } else if (sign > 0) {
-+ base = (char *)try + width;
-+ nel -= nel/2+1;
-+ } else {
-+ return try;
- }
- }
- return NULL;
-diff --git a/src/stdlib/labs.c b/src/stdlib/labs.c
-index 675b95b8..83ddb147 100644
---- a/src/stdlib/labs.c
-+++ b/src/stdlib/labs.c
-@@ -1,3 +1,5 @@
-+#include <stdlib.h>
-+
- long labs(long a)
- {
- return a>0 ? a : -a;
-diff --git a/src/stdlib/llabs.c b/src/stdlib/llabs.c
-index bec4a03d..9dfaf5cf 100644
---- a/src/stdlib/llabs.c
-+++ b/src/stdlib/llabs.c
-@@ -1,3 +1,5 @@
-+#include <stdlib.h>
-+
- long long llabs(long long a)
- {
- return a>0 ? a : -a;
-diff --git a/src/string/explicit_bzero.c b/src/string/explicit_bzero.c
-new file mode 100644
-index 00000000..f2e12f23
---- /dev/null
-+++ b/src/string/explicit_bzero.c
-@@ -0,0 +1,8 @@
-+#define _BSD_SOURCE
-+#include <string.h>
-+
-+void explicit_bzero(void *d, size_t n)
-+{
-+ d = memset(d, 0, n);
-+ __asm__ __volatile__ ("" : : "r"(d) : "memory");
-+}
-diff --git a/src/thread/arm/__aeabi_read_tp.s b/src/thread/arm/__aeabi_read_tp.s
-index 9d0cd311..2585620c 100644
---- a/src/thread/arm/__aeabi_read_tp.s
-+++ b/src/thread/arm/__aeabi_read_tp.s
-@@ -2,7 +2,9 @@
- .global __aeabi_read_tp
- .type __aeabi_read_tp,%function
- __aeabi_read_tp:
-- push {r1,r2,r3,lr}
-- bl __aeabi_read_tp_c
-- pop {r1,r2,r3,lr}
-- bx lr
-+ ldr r0,1f
-+ add r0,r0,pc
-+ ldr r0,[r0]
-+2: bx r0
-+ .align 2
-+1: .word __a_gettp_ptr - 2b
-diff --git a/src/thread/arm/__aeabi_read_tp_c.c b/src/thread/arm/__aeabi_read_tp_c.c
-deleted file mode 100644
-index 654bdc57..00000000
---- a/src/thread/arm/__aeabi_read_tp_c.c
-+++ /dev/null
-@@ -1,8 +0,0 @@
--#include "pthread_impl.h"
--#include <stdint.h>
--
--__attribute__((__visibility__("hidden")))
--void *__aeabi_read_tp_c(void)
--{
-- return (void *)((uintptr_t)__pthread_self()-8+sizeof(struct pthread));
--}
-diff --git a/src/thread/default_attr.c b/src/thread/default_attr.c
-new file mode 100644
-index 00000000..46fe98ee
---- /dev/null
-+++ b/src/thread/default_attr.c
-@@ -0,0 +1,4 @@
-+#include "pthread_impl.h"
-+
-+size_t __default_stacksize = DEFAULT_STACK_SIZE;
-+size_t __default_guardsize = DEFAULT_GUARD_SIZE;
-diff --git a/src/thread/m68k/__m68k_read_tp.s b/src/thread/m68k/__m68k_read_tp.s
-new file mode 100644
-index 00000000..86886da8
---- /dev/null
-+++ b/src/thread/m68k/__m68k_read_tp.s
-@@ -0,0 +1,8 @@
-+.text
-+.global __m68k_read_tp
-+.type __m68k_read_tp,@function
-+__m68k_read_tp:
-+ move.l #333,%d0
-+ trap #0
-+ move.l %d0,%a0
-+ rts
-diff --git a/src/thread/m68k/clone.s b/src/thread/m68k/clone.s
-new file mode 100644
-index 00000000..5b61b6fa
---- /dev/null
-+++ b/src/thread/m68k/clone.s
-@@ -0,0 +1,24 @@
-+.text
-+.global __clone
-+.type __clone,@function
-+__clone:
-+ movem.l %d2-%d5,-(%sp)
-+ move.l #120,%d0
-+ move.l 28(%sp),%d1
-+ move.l 24(%sp),%d2
-+ and.l #-16,%d2
-+ move.l 36(%sp),%d3
-+ move.l 44(%sp),%d4
-+ move.l 40(%sp),%d5
-+ move.l 20(%sp),%a0
-+ move.l 32(%sp),%a1
-+ trap #0
-+ tst.l %d0
-+ beq 1f
-+ movem.l (%sp)+,%d2-%d5
-+ rts
-+1: move.l %a1,-(%sp)
-+ jsr (%a0)
-+ move.l #1,%d0
-+ trap #0
-+ clr.b 0
-diff --git a/src/thread/m68k/syscall_cp.s b/src/thread/m68k/syscall_cp.s
-new file mode 100644
-index 00000000..5628a896
---- /dev/null
-+++ b/src/thread/m68k/syscall_cp.s
-@@ -0,0 +1,26 @@
-+.text
-+.global __cp_begin
-+.hidden __cp_begin
-+.global __cp_end
-+.hidden __cp_end
-+.global __cp_cancel
-+.hidden __cp_cancel
-+.hidden __cancel
-+.global __syscall_cp_asm
-+.hidden __syscall_cp_asm
-+.type __syscall_cp_asm,@function
-+__syscall_cp_asm:
-+ movem.l %d2-%d5,-(%sp)
-+ movea.l 20(%sp),%a0
-+__cp_begin:
-+ move.l (%a0),%d0
-+ bne __cp_cancel
-+ movem.l 24(%sp),%d0-%d5/%a0
-+ trap #0
-+__cp_end:
-+ movem.l (%sp)+,%d2-%d5
-+ rts
-+__cp_cancel:
-+ movem.l (%sp)+,%d2-%d5
-+ move.l __cancel-.-8,%a1
-+ jmp (%pc,%a1)
-diff --git a/src/thread/mips/clone.s b/src/thread/mips/clone.s
-index 37dddf57..30a0146b 100644
---- a/src/thread/mips/clone.s
-+++ b/src/thread/mips/clone.s
-@@ -28,5 +28,8 @@ __clone:
- nop
- 1: lw $25, 0($sp)
- lw $4, 4($sp)
-- jr $25
-+ jalr $25
- nop
-+ move $4, $2
-+ li $2, 4001
-+ syscall
-diff --git a/src/thread/mips64/clone.s b/src/thread/mips64/clone.s
-index 229d2677..1b71e07c 100644
---- a/src/thread/mips64/clone.s
-+++ b/src/thread/mips64/clone.s
-@@ -26,5 +26,8 @@ __clone:
- nop
- 1: ld $25, 0($sp) # function pointer
- ld $4, 8($sp) # argument pointer
-- jr $25 # call the user's function
-+ jalr $25 # call the user's function
- nop
-+ move $4, $2
-+ li $2, 5058
-+ syscall
-diff --git a/src/thread/mipsn32/clone.s b/src/thread/mipsn32/clone.s
-index 51035852..ebf5dbea 100644
---- a/src/thread/mipsn32/clone.s
-+++ b/src/thread/mipsn32/clone.s
-@@ -26,5 +26,8 @@ __clone:
- nop
- 1: lw $25, 0($sp) # function pointer
- lw $4, 4($sp) # argument pointer
-- jr $25 # call the user's function
-+ jalr $25 # call the user's function
- nop
-+ move $4, $2
-+ li $2, 6058
-+ syscall
-diff --git a/src/thread/powerpc64/syscall_cp.s b/src/thread/powerpc64/syscall_cp.s
-index d420dbde..ef50ed00 100644
---- a/src/thread/powerpc64/syscall_cp.s
-+++ b/src/thread/powerpc64/syscall_cp.s
-@@ -34,4 +34,11 @@ __cp_end:
- blr
-
- __cp_cancel:
-+ mflr 0
-+ bl 1f
-+ .long .TOC.-.
-+1: mflr 3
-+ lwa 2, 0(3)
-+ add 2, 2, 3
-+ mtlr 0
- b __cancel
-diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c
-index 8f6e3374..a962b460 100644
---- a/src/thread/pthread_attr_init.c
-+++ b/src/thread/pthread_attr_init.c
-@@ -1,9 +1,12 @@
- #include "pthread_impl.h"
-
-+extern size_t __default_stacksize;
-+extern size_t __default_guardsize;
-+
- int pthread_attr_init(pthread_attr_t *a)
- {
- *a = (pthread_attr_t){0};
-- a->_a_stacksize = DEFAULT_STACK_SIZE;
-- a->_a_guardsize = DEFAULT_GUARD_SIZE;
-+ a->_a_stacksize = __default_stacksize;
-+ a->_a_guardsize = __default_guardsize;
- return 0;
- }
diff --git a/src/thread/pthread_attr_setinheritsched.c b/src/thread/pthread_attr_setinheritsched.c
-index c91d8f83..4115e2fe 100644
+index e540e846..4115e2fe 100644
--- a/src/thread/pthread_attr_setinheritsched.c
+++ b/src/thread/pthread_attr_setinheritsched.c
-@@ -1,8 +1,29 @@
- #include "pthread_impl.h"
-+#include "syscall.h"
-+
-+__attribute__((__visibility__("hidden")))
-+void *__start_sched(void *p)
-+{
-+ struct start_sched_args *ssa = p;
-+ void *start_arg = ssa->start_arg;
-+ void *(*start_fn)(void *) = ssa->start_fn;
-+ pthread_t self = __pthread_self();
-+
-+ int ret = -__syscall(SYS_sched_setscheduler, self->tid,
-+ ssa->attr->_a_policy, &ssa->attr->_a_prio);
-+ if (!ret) __restore_sigs(&ssa->mask);
-+ a_store(&ssa->futex, ret);
-+ __wake(&ssa->futex, 1, 1);
-+ if (ret) {
-+ self->detach_state = DT_DYNAMIC;
-+ return 0;
-+ }
-+ return start_fn(start_arg);
-+}
+@@ -23,7 +23,7 @@ void *__start_sched(void *p)
int pthread_attr_setinheritsched(pthread_attr_t *a, int inherit)
{
@@ -6294,375 +267,6 @@ index 46b520c0..933bdb38 100644
+ return ENOTSUP;
}
}
-diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c
-index b391461e..c2d2929d 100644
---- a/src/thread/pthread_barrierattr_setpshared.c
-+++ b/src/thread/pthread_barrierattr_setpshared.c
-@@ -2,6 +2,7 @@
-
- int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared)
- {
-+ if (pshared > 1U) return EINVAL;
- a->__attr = pshared ? INT_MIN : 0;
- return 0;
- }
-diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c
-index 3d229223..5d458af2 100644
---- a/src/thread/pthread_cancel.c
-+++ b/src/thread/pthread_cancel.c
-@@ -61,6 +61,9 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx)
-
- if (self->cancelasync || pc >= (uintptr_t)__cp_begin && pc < (uintptr_t)__cp_end) {
- uc->uc_mcontext.MC_PC = (uintptr_t)__cp_cancel;
-+#ifdef CANCEL_GOT
-+ uc->uc_mcontext.MC_GOT = CANCEL_GOT;
-+#endif
- return;
- }
-
-@@ -92,6 +95,10 @@ int pthread_cancel(pthread_t t)
- init = 1;
- }
- a_store(&t->cancel, 1);
-- if (t == pthread_self() && !t->cancelasync) return 0;
-+ if (t == pthread_self()) {
-+ if (t->canceldisable == PTHREAD_CANCEL_ENABLE && t->cancelasync)
-+ pthread_exit(PTHREAD_CANCELED);
-+ return 0;
-+ }
- return pthread_kill(t, SIGCANCEL);
- }
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 439ee363..27ace2c6 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -19,6 +19,12 @@ weak_alias(dummy_0, __pthread_tsd_run_dtors);
- weak_alias(dummy_0, __do_orphaned_stdio_locks);
- weak_alias(dummy_0, __dl_thread_cleanup);
-
-+static void *dummy_1(void *p)
-+{
-+ return 0;
-+}
-+weak_alias(dummy_1, __start_sched);
-+
- _Noreturn void __pthread_exit(void *result)
- {
- pthread_t self = __pthread_self();
-@@ -37,11 +43,11 @@ _Noreturn void __pthread_exit(void *result)
-
- __pthread_tsd_run_dtors();
-
-- LOCK(self->exitlock);
--
-- /* Mark this thread dead before decrementing count */
-+ /* Access to target the exiting thread with syscalls that use
-+ * its kernel tid is controlled by killlock. For detached threads,
-+ * any use past this point would have undefined behavior, but for
-+ * joinable threads it's a valid usage that must be handled. */
- LOCK(self->killlock);
-- self->dead = 1;
-
- /* Block all signals before decrementing the live thread count.
- * This is important to ensure that dynamically allocated TLS
-@@ -49,20 +55,14 @@ _Noreturn void __pthread_exit(void *result)
- * reasons as well. */
- __block_all_sigs(&set);
-
-- /* Wait to unlock the kill lock, which governs functions like
-- * pthread_kill which target a thread id, until signals have
-- * been blocked. This precludes observation of the thread id
-- * as a live thread (with application code running in it) after
-- * the thread was reported dead by ESRCH being returned. */
-- UNLOCK(self->killlock);
--
- /* It's impossible to determine whether this is "the last thread"
- * until performing the atomic decrement, since multiple threads
- * could exit at the same time. For the last thread, revert the
-- * decrement and unblock signals to give the atexit handlers and
-- * stdio cleanup code a consistent state. */
-+ * decrement, restore the tid, and unblock signals to give the
-+ * atexit handlers and stdio cleanup code a consistent state. */
- if (a_fetch_add(&libc.threads_minus_1, -1)==0) {
- libc.threads_minus_1 = 0;
-+ UNLOCK(self->killlock);
- __restore_sigs(&set);
- exit(0);
- }
-@@ -89,15 +89,19 @@ _Noreturn void __pthread_exit(void *result)
- __do_orphaned_stdio_locks();
- __dl_thread_cleanup();
-
-- if (self->detached && self->map_base) {
-+ /* This atomic potentially competes with a concurrent pthread_detach
-+ * call; the loser is responsible for freeing thread resources. */
-+ int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
-+
-+ if (state>=DT_DETACHED && self->map_base) {
- /* Detached threads must avoid the kernel clear_child_tid
- * feature, since the virtual address will have been
- * unmapped and possibly already reused by a new mapping
- * at the time the kernel would perform the write. In
- * the case of threads that started out detached, the
- * initial clone flags are correct, but if the thread was
-- * detached later (== 2), we need to clear it here. */
-- if (self->detached == 2) __syscall(SYS_set_tid_address, 0);
-+ * detached later, we need to clear it here. */
-+ if (state == DT_DYNAMIC) __syscall(SYS_set_tid_address, 0);
-
- /* Robust list will no longer be valid, and was already
- * processed above, so unregister it with the kernel. */
-@@ -113,6 +117,12 @@ _Noreturn void __pthread_exit(void *result)
- __unmapself(self->map_base, self->map_size);
- }
-
-+ /* After the kernel thread exits, its tid may be reused. Clear it
-+ * to prevent inadvertent use and inform functions that would use
-+ * it that it's no longer available. */
-+ self->tid = 0;
-+ UNLOCK(self->killlock);
-+
- for (;;) __syscall(SYS_exit, 0);
- }
-
-@@ -131,19 +141,6 @@ void __do_cleanup_pop(struct __ptcb *cb)
- static int start(void *p)
- {
- pthread_t self = p;
-- /* States for startlock:
-- * 0 = no need for start sync
-- * 1 = waiting for parent to do work
-- * 2 = failure in parent, child must abort
-- * 3 = success in parent, child must restore sigmask */
-- if (self->startlock[0]) {
-- __wait(self->startlock, 0, 1, 1);
-- if (self->startlock[0] == 2) {
-- self->detached = 2;
-- pthread_exit(0);
-- }
-- __restore_sigs(self->sigmask);
-- }
- if (self->unblock_cancel)
- __syscall(SYS_rt_sigprocmask, SIG_UNBLOCK,
- SIGPT_SET, 0, _NSIG/8);
-@@ -168,8 +165,8 @@ static void *dummy_tsd[1] = { 0 };
- weak_alias(dummy_tsd, __pthread_tsd_main);
-
- volatile int __block_new_threads = 0;
--size_t __default_stacksize = DEFAULT_STACK_SIZE;
--size_t __default_guardsize = DEFAULT_GUARD_SIZE;
-+extern size_t __default_stacksize;
-+extern size_t __default_guardsize;
-
- static FILE *volatile dummy_file = 0;
- weak_alias(dummy_file, __stdin_used);
-@@ -194,6 +191,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | CLONE_DETACHED;
- int do_sched = 0;
- pthread_attr_t attr = { 0 };
-+ struct start_sched_args ssa;
-
- if (!libc.can_do_threads) return ENOSYS;
- self = __pthread_self();
-@@ -272,24 +270,32 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- new->tsd = (void *)tsd;
- new->locale = &libc.global_locale;
- if (attr._a_detach) {
-- new->detached = 1;
-+ new->detach_state = DT_DETACHED;
- flags -= CLONE_CHILD_CLEARTID;
-+ } else {
-+ new->detach_state = DT_JOINABLE;
- }
- if (attr._a_sched) {
-- do_sched = new->startlock[0] = 1;
-- __block_app_sigs(new->sigmask);
-+ do_sched = 1;
-+ ssa.futex = -1;
-+ ssa.start_fn = new->start;
-+ ssa.start_arg = new->start_arg;
-+ ssa.attr = &attr;
-+ new->start = __start_sched;
-+ new->start_arg = &ssa;
-+ __block_app_sigs(&ssa.mask);
- }
- new->robust_list.head = &new->robust_list.head;
- new->unblock_cancel = self->cancel;
- new->CANARY = self->CANARY;
-
- a_inc(&libc.threads_minus_1);
-- ret = __clone((c11 ? start_c11 : start), stack, flags, new, &new->tid, TP_ADJ(new), &new->tid);
-+ ret = __clone((c11 ? start_c11 : start), stack, flags, new, &new->tid, TP_ADJ(new), &new->detach_state);
-
- __release_ptc();
-
- if (do_sched) {
-- __restore_sigs(new->sigmask);
-+ __restore_sigs(&ssa.mask);
- }
-
- if (ret < 0) {
-@@ -299,11 +305,9 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- }
-
- if (do_sched) {
-- ret = __syscall(SYS_sched_setscheduler, new->tid,
-- attr._a_policy, &attr._a_prio);
-- a_store(new->startlock, ret<0 ? 2 : 3);
-- __wake(new->startlock, 1, 1);
-- if (ret < 0) return -ret;
-+ __futexwait(&ssa.futex, -1, 1);
-+ ret = ssa.futex;
-+ if (ret) return ret;
- }
-
- *res = new;
-diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c
-index 692bbaf9..9cee7a89 100644
---- a/src/thread/pthread_detach.c
-+++ b/src/thread/pthread_detach.c
-@@ -5,11 +5,10 @@ int __pthread_join(pthread_t, void **);
-
- static int __pthread_detach(pthread_t t)
- {
-- /* Cannot detach a thread that's already exiting */
-- if (a_cas(t->exitlock, 0, INT_MIN + 1))
-+ /* If the cas fails, detach state is either already-detached
-+ * or exiting/exited, and pthread_join will trap or cleanup. */
-+ if (a_cas(&t->detach_state, DT_JOINABLE, DT_DYNAMIC) != DT_JOINABLE)
- return __pthread_join(t, 0);
-- t->detached = 2;
-- UNLOCK(t->exitlock);
- return 0;
- }
-
-diff --git a/src/thread/pthread_getattr_np.c b/src/thread/pthread_getattr_np.c
-index 29a209bd..2881831f 100644
---- a/src/thread/pthread_getattr_np.c
-+++ b/src/thread/pthread_getattr_np.c
-@@ -6,7 +6,7 @@
- int pthread_getattr_np(pthread_t t, pthread_attr_t *a)
- {
- *a = (pthread_attr_t){0};
-- a->_a_detach = !!t->detached;
-+ a->_a_detach = t->detach_state>=DT_DETACHED;
- a->_a_guardsize = t->guard_size;
- if (t->stack) {
- a->_a_stackaddr = (uintptr_t)t->stack;
-diff --git a/src/thread/pthread_getschedparam.c b/src/thread/pthread_getschedparam.c
-index a994b637..05be4242 100644
---- a/src/thread/pthread_getschedparam.c
-+++ b/src/thread/pthread_getschedparam.c
-@@ -4,7 +4,7 @@ int pthread_getschedparam(pthread_t t, int *restrict policy, struct sched_param
- {
- int r;
- LOCK(t->killlock);
-- if (t->dead) {
-+ if (!t->tid) {
- r = ESRCH;
- } else {
- r = -__syscall(SYS_sched_getparam, t->tid, param);
-diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c
-index b7175c09..18264da6 100644
---- a/src/thread/pthread_join.c
-+++ b/src/thread/pthread_join.c
-@@ -7,13 +7,14 @@ int __pthread_setcancelstate(int, int *);
-
- int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec *at)
- {
-- int tmp, cs, r = 0;
-+ int state, cs, r = 0;
- __pthread_testcancel();
- __pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
- if (cs == PTHREAD_CANCEL_ENABLE) __pthread_setcancelstate(cs, 0);
-- if (t->detached) a_crash();
-- while ((tmp = t->tid) && r != ETIMEDOUT && r != EINVAL)
-- r = __timedwait_cp(&t->tid, tmp, CLOCK_REALTIME, at, 0);
-+ while ((state = t->detach_state) && r != ETIMEDOUT && r != EINVAL) {
-+ if (state >= DT_DETACHED) a_crash();
-+ r = __timedwait_cp(&t->detach_state, state, CLOCK_REALTIME, at, 0);
-+ }
- __pthread_setcancelstate(cs, 0);
- if (r == ETIMEDOUT || r == EINVAL) return r;
- a_barrier();
-@@ -29,7 +30,7 @@ int __pthread_join(pthread_t t, void **res)
-
- int __pthread_tryjoin_np(pthread_t t, void **res)
- {
-- return t->tid ? EBUSY : __pthread_join(t, res);
-+ return t->detach_state==DT_JOINABLE ? EBUSY : __pthread_join(t, res);
- }
-
- weak_alias(__pthread_tryjoin_np, pthread_tryjoin_np);
-diff --git a/src/thread/pthread_kill.c b/src/thread/pthread_kill.c
-index f0903420..6d70e626 100644
---- a/src/thread/pthread_kill.c
-+++ b/src/thread/pthread_kill.c
-@@ -4,7 +4,8 @@ int pthread_kill(pthread_t t, int sig)
- {
- int r;
- LOCK(t->killlock);
-- r = t->dead ? ESRCH : -__syscall(SYS_tkill, t->tid, sig);
-+ r = t->tid ? -__syscall(SYS_tkill, t->tid, sig)
-+ : (sig+0U >= _NSIG ? EINVAL : 0);
- UNLOCK(t->killlock);
- return r;
- }
-diff --git a/src/thread/pthread_setschedparam.c b/src/thread/pthread_setschedparam.c
-index 9e2fa456..ab45f2ff 100644
---- a/src/thread/pthread_setschedparam.c
-+++ b/src/thread/pthread_setschedparam.c
-@@ -4,7 +4,7 @@ int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *par
- {
- int r;
- LOCK(t->killlock);
-- r = t->dead ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param);
-+ r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param);
- UNLOCK(t->killlock);
- return r;
- }
-diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c
-index dc745b42..c353f6b5 100644
---- a/src/thread/pthread_setschedprio.c
-+++ b/src/thread/pthread_setschedprio.c
-@@ -4,7 +4,7 @@ int pthread_setschedprio(pthread_t t, int prio)
- {
- int r;
- LOCK(t->killlock);
-- r = t->dead ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio);
-+ r = !t->tid ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio);
- UNLOCK(t->killlock);
- return r;
- }
-diff --git a/src/time/__tz.c b/src/time/__tz.c
-index 1dbb0b8f..814edcdf 100644
---- a/src/time/__tz.c
-+++ b/src/time/__tz.c
-@@ -230,7 +230,7 @@ static void do_tzset()
- dst_off = __timezone - 3600;
- } else {
- __daylight = 0;
-- dst_off = 0;
-+ dst_off = __timezone;
- }
-
- if (*s == ',') s++, getrule(&s, r0);
-diff --git a/src/time/strftime.c b/src/time/strftime.c
-index 708875ee..d3f2add9 100644
---- a/src/time/strftime.c
-+++ b/src/time/strftime.c
-@@ -181,9 +181,8 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
- *l = 0;
- return "";
- }
-- *l = snprintf(*s, sizeof *s, "%+.2d%.2d",
-- (tm->__tm_gmtoff)/3600,
-- abs(tm->__tm_gmtoff%3600)/60);
-+ *l = snprintf(*s, sizeof *s, "%+.4ld",
-+ tm->__tm_gmtoff/3600*100 + tm->__tm_gmtoff%3600/60);
- return *s;
- case 'Z':
- if (tm->tm_isdst < 0) {
diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c
index 03c5a77b..c423b825 100644
--- a/src/time/timespec_get.c
@@ -6676,115 +280,3 @@ index 03c5a77b..c423b825 100644
int ret = __clock_gettime(CLOCK_REALTIME, ts);
return ret < 0 ? 0 : base;
}
-diff --git a/src/time/wcsftime.c b/src/time/wcsftime.c
-index 638e64f6..23500cc8 100644
---- a/src/time/wcsftime.c
-+++ b/src/time/wcsftime.c
-@@ -4,7 +4,7 @@
- #include "locale_impl.h"
- #include "libc.h"
-
--const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc);
-+const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc, int pad);
-
- size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc)
- {
-@@ -14,7 +14,7 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co
- wchar_t *p;
- const char *t_mb;
- const wchar_t *t;
-- int plus;
-+ int pad, plus;
- unsigned long width;
- for (l=0; l<n; f++) {
- if (!*f) {
-@@ -26,6 +26,8 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co
- continue;
- }
- f++;
-+ pad = 0;
-+ if (*f == '-' || *f == '_' || *f == '0') pad = *f++;
- if ((plus = (*f == '+'))) f++;
- width = wcstoul(f, &p, 10);
- if (*p == 'C' || *p == 'F' || *p == 'G' || *p == 'Y') {
-@@ -35,7 +37,7 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co
- }
- f = p;
- if (*f == 'E' || *f == 'O') f++;
-- t_mb = __strftime_fmt_1(&buf, &k, *f, tm, loc);
-+ t_mb = __strftime_fmt_1(&buf, &k, *f, tm, loc, pad);
- if (!t_mb) break;
- k = mbstowcs(wbuf, t_mb, sizeof wbuf / sizeof *wbuf);
- if (k == (size_t)-1) return 0;
-diff --git a/src/unistd/getcwd.c b/src/unistd/getcwd.c
-index 103fbbb5..f407ffe0 100644
---- a/src/unistd/getcwd.c
-+++ b/src/unistd/getcwd.c
-@@ -6,10 +6,10 @@
-
- char *getcwd(char *buf, size_t size)
- {
-- char tmp[PATH_MAX];
-+ char tmp[buf ? 1 : PATH_MAX];
- if (!buf) {
- buf = tmp;
-- size = PATH_MAX;
-+ size = sizeof tmp;
- } else if (!size) {
- errno = EINVAL;
- return 0;
-diff --git a/src/unistd/gethostname.c b/src/unistd/gethostname.c
-index f984b7dd..633ef571 100644
---- a/src/unistd/gethostname.c
-+++ b/src/unistd/gethostname.c
-@@ -8,6 +8,6 @@ int gethostname(char *name, size_t len)
- if (uname(&uts)) return -1;
- if (len > sizeof uts.nodename) len = sizeof uts.nodename;
- for (i=0; i<len && (name[i] = uts.nodename[i]); i++);
-- if (i==len) name[i-1] = 0;
-+ if (i && i==len) name[i-1] = 0;
- return 0;
- }
-diff --git a/src/unistd/nice.c b/src/unistd/nice.c
-index da569967..6c25c8c3 100644
---- a/src/unistd/nice.c
-+++ b/src/unistd/nice.c
-@@ -1,12 +1,16 @@
- #include <unistd.h>
- #include <sys/resource.h>
-+#include <limits.h>
- #include "syscall.h"
-
- int nice(int inc)
- {
--#ifdef SYS_nice
-- return syscall(SYS_nice, inc);
--#else
-- return setpriority(PRIO_PROCESS, 0, getpriority(PRIO_PROCESS, 0)+inc);
--#endif
-+ int prio = inc;
-+ // Only query old priority if it can affect the result.
-+ // This also avoids issues with integer overflow.
-+ if (inc > -2*NZERO && inc < 2*NZERO)
-+ prio += getpriority(PRIO_PROCESS, 0);
-+ if (prio > NZERO-1) prio = NZERO-1;
-+ if (prio < -NZERO) prio = -NZERO;
-+ return setpriority(PRIO_PROCESS, 0, prio) ? -1 : prio;
- }
-diff --git a/tools/musl-gcc.specs.sh b/tools/musl-gcc.specs.sh
-index 294e24f7..30492574 100644
---- a/tools/musl-gcc.specs.sh
-+++ b/tools/musl-gcc.specs.sh
-@@ -17,10 +17,10 @@ cat <<EOF
- libgcc.a%s %:if-exists(libgcc_eh.a%s)
-
- *startfile:
--%{!shared: $libdir/%{pie:S}crt1.o} $libdir/crti.o %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}
-+%{!shared: $libdir/Scrt1.o} $libdir/crti.o crtbeginS.o%s
-
- *endfile:
--%{shared|pie:crtendS.o%s;:crtend.o%s} $libdir/crtn.o
-+crtendS.o%s $libdir/crtn.o
-
- *link:
- -dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}
diff --git a/system/ncurses/APKBUILD b/system/ncurses/APKBUILD
index eaa4508bf..d3905f3fc 100644
--- a/system/ncurses/APKBUILD
+++ b/system/ncurses/APKBUILD
@@ -1,8 +1,8 @@
# Maintainer: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com>
pkgname=ncurses
-pkgver=6.1_p20180609
+pkgver=6.1_p20180901
_ver=${pkgver%_p*}-${pkgver#*_p}
-pkgrel=5
+pkgrel=0
pkgdesc="Console display library"
url="https://invisible-island.net/ncurses/ncurses.html"
arch="all"
@@ -106,4 +106,4 @@ static() {
mv "$pkgdir"/lib/*.a "$subpkgdir"/lib/
}
-sha512sums="616975a1ef61ca6efb68c9411fb4d310f5472f4f58c277afaecacc42e2186358dbda1831f8d2f9fe5ef98ecabd8c3ea0e618762450e9cf99b92230277bca480c ncurses-6.1-20180609.tgz"
+sha512sums="3c7983a80aba1cc69ad9ac2f43cd60bfe714c8e83b8eb6755ca6c5cf14d26d1e98c7407de34af74e58d52ca1d9446e04f2a76fd31a37377782aa4e515b35ba7e ncurses-6.1-20180901.tgz"
diff --git a/system/nspr/APKBUILD b/system/nspr/APKBUILD
index 46284cae3..a6da52de1 100644
--- a/system/nspr/APKBUILD
+++ b/system/nspr/APKBUILD
@@ -1,13 +1,13 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=nspr
-pkgver=4.19
+pkgver=4.20
pkgrel=0
pkgdesc="Netscape Portable Runtime"
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR"
arch="all"
options="!check" # No test suite.
license="MPL-1.1 AND GPL-2.0-only AND LGPL-2.1-only"
-depends=
+depends=""
# -dev package does not ship any symlinks so dependency cannot be autodetected
depends_dev="nspr"
makedepends="autoconf automake"
@@ -60,5 +60,5 @@ package() {
"$pkgdir"/usr/include/nspr/md
}
-sha512sums="45a48111d0f89db0649a5e1356719868ff81881f9cf48c22c1d13b0831978b103f19e9840d6a5359fcdc90d763c0a60f0a29f7840d756a5efbd53ce1afd36844 nspr-4.19.tar.gz
+sha512sums="22fdf7627f450b0594ebccaee170098e1a8cd0f429fd44816f1322756002ced3d69cf686c3f69f7cb30b8132d3605a9fce5457ab99d0002e6af11a3408a5c949 nspr-4.20.tar.gz
ee654f609a90b9a95c1901ad1d56cdef7cce8bca9efc092198607944f142f8fec924b13219ca6663facd0f0d59b671b8b3de58ab3449c4c863d42e2937f02184 fix-getproto.patch"
diff --git a/system/nss/APKBUILD b/system/nss/APKBUILD
index b6c1f5992..806441d20 100644
--- a/system/nss/APKBUILD
+++ b/system/nss/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=nss
-pkgver=3.38
+pkgver=3.39
_ver=${pkgver//./_}
pkgrel=0
pkgdesc="Mozilla Network Security Services"
@@ -9,7 +9,7 @@ url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS"
arch="all"
options="!check"
license="MPL-2.0"
-depends=
+depends=""
depends_dev="nspr-dev"
makedepends="nspr-dev sqlite-dev zlib-dev perl bsd-compat-headers"
subpackages="$pkgname-static $pkgname-dev $pkgname-tools"
@@ -147,7 +147,7 @@ tools() {
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
-sha512sums="06804163daa08f1f65cfe0e9546ddf066ec7f773aa615431a5952f6c04956dd62425fec38d11037ff7fb02b709de03e5a7637c6ba13de5b7686db4f9ecda52ab nss-3.38.tar.gz
+sha512sums="16358c2d8660ca301410b1d39b2eae64fe2ebbbfab797872410e5fcc67f802ef48f4e362edeecb0591626c77013537019094a6a5dfc8d24487b6b6e54564da8f nss-3.39.tar.gz
75dbd648a461940647ff373389cc73bc8ec609139cd46c91bcce866af02be6bcbb0524eb3dfb721fbd5b0bc68c20081ed6f7debf6b24317f2a7ba823e8d3c531 nss.pc.in
0f2efa8563b11da68669d281b4459289a56f5a3a906eb60382126f3adcfe47420cdcedc6ab57727a3afeeffa2bbb4c750b43bef8b5f343a75c968411dfa30e09 nss-util.pc.in
09c69d4cc39ec9deebc88696a80d0f15eb2d8c94d9daa234a2adfec941b63805eb4ce7f2e1943857b938bddcaee1beac246a0ec627b71563d9f846e6119a4a15 nss-softokn.pc.in
diff --git a/system/openssl/3001-CVE-2018-0737.patch b/system/openssl/3001-CVE-2018-0737.patch
deleted file mode 100644
index 162dc3d7f..000000000
--- a/system/openssl/3001-CVE-2018-0737.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 349a41da1ad88ad87825414752a8ff5fdd6a6c3f Mon Sep 17 00:00:00 2001
-From: Billy Brumley <bbrumley@gmail.com>
-Date: Wed, 11 Apr 2018 10:10:58 +0300
-Subject: [PATCH] RSA key generation: ensure BN_mod_inverse and BN_mod_exp_mont
- both get called with BN_FLG_CONSTTIME flag set.
-
-CVE-2018-0737
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
-Reviewed-by: Matt Caswell <matt@openssl.org>
-(cherry picked from commit 6939eab03a6e23d2bd2c3f5e34fe1d48e542e787)
----
- crypto/rsa/rsa_gen.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c
-index 9ca5dfefb70..42b89a8dfaa 100644
---- a/crypto/rsa/rsa_gen.c
-+++ b/crypto/rsa/rsa_gen.c
-@@ -156,6 +156,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
- if (BN_copy(rsa->e, e_value) == NULL)
- goto err;
-
-+ BN_set_flags(rsa->p, BN_FLG_CONSTTIME);
-+ BN_set_flags(rsa->q, BN_FLG_CONSTTIME);
- BN_set_flags(r2, BN_FLG_CONSTTIME);
- /* generate p and q */
- for (;;) {
diff --git a/system/openssl/3002-CVE-2018-0732.patch b/system/openssl/3002-CVE-2018-0732.patch
deleted file mode 100644
index 148e7c3bc..000000000
--- a/system/openssl/3002-CVE-2018-0732.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 3984ef0b72831da8b3ece4745cac4f8575b19098 Mon Sep 17 00:00:00 2001
-From: Guido Vranken <guidovranken@gmail.com>
-Date: Mon, 11 Jun 2018 19:38:54 +0200
-Subject: [PATCH] Reject excessively large primes in DH key generation.
-
-CVE-2018-0732
-
-Signed-off-by: Guido Vranken <guidovranken@gmail.com>
-
-(cherry picked from commit 91f7361f47b082ae61ffe1a7b17bb2adf213c7fe)
-
-Reviewed-by: Tim Hudson <tjh@openssl.org>
-Reviewed-by: Matt Caswell <matt@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/6457)
----
- crypto/dh/dh_key.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
-index 387558f1467..f235e0d682b 100644
---- a/crypto/dh/dh_key.c
-+++ b/crypto/dh/dh_key.c
-@@ -130,10 +130,15 @@ static int generate_key(DH *dh)
- int ok = 0;
- int generate_new_key = 0;
- unsigned l;
-- BN_CTX *ctx;
-+ BN_CTX *ctx = NULL;
- BN_MONT_CTX *mont = NULL;
- BIGNUM *pub_key = NULL, *priv_key = NULL;
-
-+ if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) {
-+ DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE);
-+ return 0;
-+ }
-+
- ctx = BN_CTX_new();
- if (ctx == NULL)
- goto err;
diff --git a/system/openssl/APKBUILD b/system/openssl/APKBUILD
index 684f41bf1..7aeb36b7b 100644
--- a/system/openssl/APKBUILD
+++ b/system/openssl/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=openssl
-pkgver=1.0.2o
+pkgver=1.0.2p
pkgrel=0
pkgdesc="Toolkit for SSL v2/v3 and TLS v1"
url="https://www.openssl.org/"
@@ -28,8 +28,6 @@ source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz
1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
1002-backport-changes-from-upstream-padlock-module.patch
1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
- 3001-CVE-2018-0737.patch
- 3002-CVE-2018-0732.patch
"
# secfixes:
@@ -143,7 +141,7 @@ dev() {
default_dev
}
-sha512sums="8a2c93657c85143e76785bb32ee836908c31a6f5f8db993fa9777acba6079e630cdddd03edbad65d1587199fc13a1507789eacf038b56eb99139c2091d9df7fd openssl-1.0.2o.tar.gz
+sha512sums="958c5a7c3324bbdc8f07dfb13e11329d9a1b4452c07cf41fbd2d42b5fe29c95679332a3476d24c2dc2b88be16e4a24744aba675a05a388c0905756c77a8a2f16 openssl-1.0.2p.tar.gz
2244f46cb18e6b98f075051dd2446c47f7590abccd108fbab707f168a20cad8d32220d704635973f09e3b2879f523be5160f1ffbc12ab3900f8a8891dc855c5c 0002-busybox-basename.patch
58e42058a0c8086c49d681b1e226da39a8cf8cb88c51cf739dec2ff12e1bb5d7208ac5033264b186d58e9bdfe992fe9ddb95701d01caf1824396b2cefe30c0a4 0003-use-termios.patch
c67472879a31b5dbdd313892df6d37e7c93e8c0237d406c30d50b1016c2618ead3c13277f5dc723ef1ceed092d36e3c15a9777daa844f59b9fa2b0a4f04fd9ae 0004-fix-default-ca-path-for-apps.patch
@@ -154,6 +152,4 @@ c67472879a31b5dbdd313892df6d37e7c93e8c0237d406c30d50b1016c2618ead3c13277f5dc723e
5febe20948e3f12d981e378e1f4ea538711657aacb6865a1aa91339d4a04277e250f490a1f2abc2c6f290bdc2b1bffdba1d00983b4c09f7ea983eef8163f9420 0010-ssl-env-zlib.patch
8c181760d7a149aa18d246d50f1c0438ffb63c98677b05306dfc00400ad0429b47d31e7c8d85126005c67f743d23e7a8a81174ffe98556f4caf9cf6b04d9ff17 1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch
a3555440b5f544bfd6b9ad97557d8f4c1d673f6a35219f65056a72035d186be5f354717ddf9784899b602464d48657b090ade24379552d43af97609c0f48c389 1002-backport-changes-from-upstream-padlock-module.patch
-6353c7a94016c20db5d683dde37775f6780952ecdb1a5f39f878d04ba37f6ad79ae10fb6d65d181d912505a5d1e22463004cd855d548b364c00b120da2b0fdbc 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
-70be7fb9abad901fd84e8028e328c5b2fb7feff18547cfb749c5f59faf06eceab9052f9979d721670f6f3e099ba59761e8394e986565d349dd25e9718eaa99f0 3001-CVE-2018-0737.patch
-ff91298629f157496a012da00ba7325923f5d087bfa54b60e205bf2dfb06374e958912e0df39dbdf39773555455c1a3afa3dcde1ddfec6e85cf89b0b62cc0eb4 3002-CVE-2018-0732.patch"
+6353c7a94016c20db5d683dde37775f6780952ecdb1a5f39f878d04ba37f6ad79ae10fb6d65d181d912505a5d1e22463004cd855d548b364c00b120da2b0fdbc 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch"
diff --git a/system/perl-authen-sasl/APKBUILD b/system/perl-authen-sasl/APKBUILD
index 611d30fa7..ad6f196ca 100644
--- a/system/perl-authen-sasl/APKBUILD
+++ b/system/perl-authen-sasl/APKBUILD
@@ -4,7 +4,7 @@ _realname=Authen-SASL
pkgver=2.16
pkgrel=2
pkgdesc="SASL authentication framework for Perl"
-url="http://search.cpan.org/dist/Authen-SASL/"
+url="https://metacpan.org/release/Authen-SASL"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-digest-hmac"
diff --git a/system/perl-cpanel-json-xs/APKBUILD b/system/perl-cpanel-json-xs/APKBUILD
index 801c2e226..aed5f54d1 100644
--- a/system/perl-cpanel-json-xs/APKBUILD
+++ b/system/perl-cpanel-json-xs/APKBUILD
@@ -3,10 +3,10 @@
# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
pkgname=perl-cpanel-json-xs
_pkgreal=Cpanel-JSON-XS
-pkgver=4.04
+pkgver=4.06
pkgrel=0
pkgdesc="cPanel's fork of JSON::XS, fast and correct serialising"
-url="http://search.cpan.org/dist/Cpanel-JSON-XS/"
+url="https://metacpan.org/release/Cpanel-JSON-XS"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
@@ -40,4 +40,4 @@ package() {
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}
-sha512sums="6b2479ee89f2b8c79ef979cecbdb6f29c28ee37ab530eabc9070728ba37063be3c5836571bea84d537dc93f8586cca71fd3bdca5e420c1d6a2eabf2547ca1db7 Cpanel-JSON-XS-4.04.tar.gz"
+sha512sums="df765265c23982a6c5eb80d16d9c9e3b3ab9f0b34aa130df8da084936aa2b7e9f4b362466948925df7be9c448892eef93017cf1fa7be7f640b62c83493829cec Cpanel-JSON-XS-4.06.tar.gz"
diff --git a/system/perl-dbd-sqlite/APKBUILD b/system/perl-dbd-sqlite/APKBUILD
index f551079de..e0febf493 100644
--- a/system/perl-dbd-sqlite/APKBUILD
+++ b/system/perl-dbd-sqlite/APKBUILD
@@ -5,7 +5,7 @@ _pkgname=DBD-SQLite
pkgver=1.58
pkgrel=0
pkgdesc="Perl DBI SQLite module"
-url="http://search.cpan.org/dist/$_pkgname"
+url="https://metacpan.org/release/DBD-SQLite"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl-dbi"
diff --git a/system/perl-dbi/APKBUILD b/system/perl-dbi/APKBUILD
index c8d0efda4..007506a47 100644
--- a/system/perl-dbi/APKBUILD
+++ b/system/perl-dbi/APKBUILD
@@ -5,7 +5,7 @@ _realpkgname=DBI
pkgver=1.641
pkgrel=0
pkgdesc="Database independent interface for Perl"
-url="http://search.cpan.org/dist/${_realpkgname}"
+url="https://metacpan.org/release/DBI"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends=
diff --git a/system/perl-digest-hmac/APKBUILD b/system/perl-digest-hmac/APKBUILD
index ccf09a834..3bca43d37 100644
--- a/system/perl-digest-hmac/APKBUILD
+++ b/system/perl-digest-hmac/APKBUILD
@@ -4,7 +4,7 @@ _realname=Digest-HMAC
pkgver=1.03
pkgrel=1
pkgdesc="Keyed-Hashing for Message Authentication Perl module"
-url="http://search.cpan.org/~gaas/Digest-HMAC-1.01/"
+url="https://metacpan.org/release/Digest-HMAC"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-digest-sha1"
diff --git a/system/perl-digest-sha1/APKBUILD b/system/perl-digest-sha1/APKBUILD
index 60205b85b..a9f19e206 100644
--- a/system/perl-digest-sha1/APKBUILD
+++ b/system/perl-digest-sha1/APKBUILD
@@ -5,7 +5,7 @@ _realname=Digest-SHA1
pkgver=2.13
pkgrel=11
pkgdesc="Perl interface to the SHA-1 algorithm"
-url="http://search.cpan.org/dist/Digest-SHA1/"
+url="https://metacpan.org/release/Digest-SHA1"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-encode-locale/APKBUILD b/system/perl-encode-locale/APKBUILD
index 6f79efa94..a4dccf27c 100644
--- a/system/perl-encode-locale/APKBUILD
+++ b/system/perl-encode-locale/APKBUILD
@@ -5,7 +5,7 @@ _realname=Encode-Locale
pkgver=1.05
pkgrel=2
pkgdesc="Perl module - Determine locale encoding"
-url="http://search.cpan.org/~gaas"
+url="https://metacpan.org/release/Encode-Locale"
arch="noarch"
license="GPL-2.0-only Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-error/APKBUILD b/system/perl-error/APKBUILD
index 6c3a1235a..542627640 100644
--- a/system/perl-error/APKBUILD
+++ b/system/perl-error/APKBUILD
@@ -4,7 +4,7 @@ _realname=Error
pkgver=0.17026
pkgrel=0
pkgdesc="Perl module error/exception handling in an OO-ish way"
-url="http://search.cpan.org/dist/Error/"
+url="https://metacpan.org/release/Error"
arch="noarch"
license="GPL-2.0-only AND Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-extutils-config/APKBUILD b/system/perl-extutils-config/APKBUILD
index c4eab6a9f..2c42337c2 100644
--- a/system/perl-extutils-config/APKBUILD
+++ b/system/perl-extutils-config/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=ExtUtils-Config
pkgver=0.008
pkgrel=0
pkgdesc="A wrapper library for Perl configuration"
-url="http://search.cpan.org/dist/ExtUtils-Config/"
+url="https://metacpan.org/release/ExtUtils-Config"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-extutils-helpers/APKBUILD b/system/perl-extutils-helpers/APKBUILD
index d125cdb7f..310875cf2 100644
--- a/system/perl-extutils-helpers/APKBUILD
+++ b/system/perl-extutils-helpers/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=ExtUtils-Helpers
pkgver=0.026
pkgrel=0
pkgdesc="Various portability utilities for Perl module builders"
-url="http://search.cpan.org/dist/ExtUtils-Helpers/"
+url="https://metacpan.org/release/ExtUtils-Helpers"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-extutils-installpaths/APKBUILD b/system/perl-extutils-installpaths/APKBUILD
index 459c61276..57d3ba2e5 100644
--- a/system/perl-extutils-installpaths/APKBUILD
+++ b/system/perl-extutils-installpaths/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=ExtUtils-InstallPaths
pkgver=0.012
pkgrel=0
pkgdesc="Build.PL install path logic made easy"
-url="http://search.cpan.org/dist/ExtUtils-InstallPaths/"
+url="https://metacpan.org/release/ExtUtils-InstallPaths"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-extutils-config"
diff --git a/system/perl-file-listing/APKBUILD b/system/perl-file-listing/APKBUILD
index 4e36cd844..89464b395 100644
--- a/system/perl-file-listing/APKBUILD
+++ b/system/perl-file-listing/APKBUILD
@@ -4,7 +4,7 @@ pkgname=perl-file-listing
pkgver=6.04
pkgrel=2
pkgdesc="File::Listing perl module"
-url="http://search.cpan.org/dist/File-Listing/"
+url="https://metacpan.org/release/File-Listing"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-http-date"
diff --git a/system/perl-file-remove/APKBUILD b/system/perl-file-remove/APKBUILD
index bed356f5e..568b40155 100644
--- a/system/perl-file-remove/APKBUILD
+++ b/system/perl-file-remove/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=File-Remove
pkgver=1.57
pkgrel=1
pkgdesc="Remove files and directories"
-url="http://search.cpan.org/dist/File-Remove/"
+url="https://metacpan.org/release/File-Remove"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-html-parser/APKBUILD b/system/perl-html-parser/APKBUILD
index f810d3748..60aede3a0 100644
--- a/system/perl-html-parser/APKBUILD
+++ b/system/perl-html-parser/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=HTML-Parser
pkgver=3.72
pkgrel=3
pkgdesc="Perl HTML parser"
-url="http://search.cpan.org/dist/HTML-Parser/"
+url="https://metacpan.org/release/HTML-Parser"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-html-tagset"
diff --git a/system/perl-html-tagset/APKBUILD b/system/perl-html-tagset/APKBUILD
index 607b5cc68..0427a8a5e 100644
--- a/system/perl-html-tagset/APKBUILD
+++ b/system/perl-html-tagset/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=HTML-Tagset
pkgver=3.20
pkgrel=2
pkgdesc="Useful data tables for parsing HTML"
-url="http://search.cpan.org/dist/HTML-Tagset/"
+url="https://metacpan.org/release/HTML-Tagset"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-http-cookies/APKBUILD b/system/perl-http-cookies/APKBUILD
index dd2031356..f6b751771 100644
--- a/system/perl-http-cookies/APKBUILD
+++ b/system/perl-http-cookies/APKBUILD
@@ -5,7 +5,7 @@ _pkgreal=HTTP-Cookies
pkgver=6.04
pkgrel=1
pkgdesc="Perl HTTP cookie jars"
-url="http://search.cpan.org/dist/HTTP-Cookies/"
+url="https://metacpan.org/release/HTTP-Cookies"
arch="noarch"
license="GPL-2.0-only or Artistic-1.0-Perl"
depends="perl perl-http-date perl-http-message"
diff --git a/system/perl-http-daemon/APKBUILD b/system/perl-http-daemon/APKBUILD
index f8f330398..b85717256 100644
--- a/system/perl-http-daemon/APKBUILD
+++ b/system/perl-http-daemon/APKBUILD
@@ -4,12 +4,11 @@ pkgname=perl-http-daemon
pkgver=6.01
pkgrel=2
pkgdesc="HTTP::Daemon perl module"
-url="http://search.cpan.org/dist/HTTP-Daemon/"
+url="https://metacpan.org/release/HTTP-Daemon"
arch="noarch"
license="GPL-2.0-only or Artistic-1.0-Perl"
depends="perl perl-http-date perl-http-message"
makedepends="perl-dev"
-install=""
replaces="perl-libwww"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTTP-Daemon-$pkgver.tar.gz"
diff --git a/system/perl-http-date/APKBUILD b/system/perl-http-date/APKBUILD
index 2d4b83da4..b4a3f7829 100644
--- a/system/perl-http-date/APKBUILD
+++ b/system/perl-http-date/APKBUILD
@@ -5,7 +5,7 @@ _realname=HTTP-Date
pkgver=6.02
pkgrel=2
pkgdesc="Perl module date conversion routines"
-url="http://search.cpan.org/~gaas"
+url="https://metacpan.org/release/HTTP-Date"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-http-message/APKBUILD b/system/perl-http-message/APKBUILD
index d5b178f38..26fae9ff0 100644
--- a/system/perl-http-message/APKBUILD
+++ b/system/perl-http-message/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=HTTP-Message
pkgver=6.18
pkgrel=0
pkgdesc="Perl class encapsulating HTTP-style messages"
-url="http://search.cpan.org/dist/HTTP-Message/"
+url="https://metacpan.org/release/HTTP-Message"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-lwp-mediatypes perl-encode-locale perl-http-date perl-uri perl-io-html"
diff --git a/system/perl-http-negotiate/APKBUILD b/system/perl-http-negotiate/APKBUILD
index 1efada759..98ebfb1da 100644
--- a/system/perl-http-negotiate/APKBUILD
+++ b/system/perl-http-negotiate/APKBUILD
@@ -4,7 +4,7 @@ pkgname=perl-http-negotiate
pkgver=6.01
pkgrel=2
pkgdesc="HTTP::Negotiate perl module"
-url="http://search.cpan.org/dist/HTTP-Negotiate/"
+url="https://metacpan.org/release/HTTP-Negotiate"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-http-message"
diff --git a/system/perl-io-html/APKBUILD b/system/perl-io-html/APKBUILD
index c6c49d10f..b5e2c6c6e 100644
--- a/system/perl-io-html/APKBUILD
+++ b/system/perl-io-html/APKBUILD
@@ -5,7 +5,7 @@ _pkgreal=IO-HTML
pkgver=1.001
pkgrel=2
pkgdesc="Open an HTML file with automatic charset detection"
-url="http://search.cpan.org/dist/IO-HTML/"
+url="https://metacpan.org/release/IO-HTML"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-io-socket-ssl/APKBUILD b/system/perl-io-socket-ssl/APKBUILD
index c5c982c33..fabe57860 100644
--- a/system/perl-io-socket-ssl/APKBUILD
+++ b/system/perl-io-socket-ssl/APKBUILD
@@ -2,10 +2,10 @@
# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
pkgname=perl-io-socket-ssl
_pkgreal=IO-Socket-SSL
-pkgver=2.056
+pkgver=2.059
pkgrel=0
pkgdesc="Perl module implementing SSL/TLS with IO::Socket interface"
-url="http://search.cpan.org/dist/IO-Socket-SSL/"
+url="https://metacpan.org/release/IO-Socket-SSL"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="ca-certificates perl-net-libidn perl-net-ssleay"
@@ -37,4 +37,4 @@ package() {
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}
-sha512sums="a3d580f977f8fd99f196a710f6eb5bc649d46e22d17f4e02660b2bab130629b34d1aff037974f320ce52121b13c1d77aa2f504278ec50530667e67413442b70b IO-Socket-SSL-2.056.tar.gz"
+sha512sums="af3800d171036b026bcb502692f70d88c4a9f2546e465181ef9037467b942c94303840cc479403f5f0e6f0ad6b06918cbaf78f0b1447e5416594c819ed94a39b IO-Socket-SSL-2.059.tar.gz"
diff --git a/system/perl-json-maybexs/APKBUILD b/system/perl-json-maybexs/APKBUILD
index 5fe5367f3..cbea4a6d2 100644
--- a/system/perl-json-maybexs/APKBUILD
+++ b/system/perl-json-maybexs/APKBUILD
@@ -5,8 +5,8 @@ pkgname=perl-json-maybexs
_pkgreal=JSON-MaybeXS
pkgver=1.004000
pkgrel=0
-pkgdesc="Use L<Cpanel::JSON::XS> with a fallback to L<JSON::XS> and L<JSON::PP>"
-url="http://search.cpan.org/dist/JSON-MaybeXS/"
+pkgdesc="Use <Cpanel::JSON::XS> with a fallback to <JSON::XS> and <JSON::PP>"
+url="https://metacpan.org/release/JSON-MaybeXS"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-cpanel-json-xs"
diff --git a/system/perl-json/APKBUILD b/system/perl-json/APKBUILD
index 946a515d9..1c6b4fdea 100644
--- a/system/perl-json/APKBUILD
+++ b/system/perl-json/APKBUILD
@@ -4,7 +4,7 @@ _pkgreal=JSON
pkgver=2.97001
pkgrel=0
pkgdesc="Perl module implementing a JSON encoder/decoder"
-url="http://search.cpan.org/dist/JSON/"
+url="https://metacpan.org/release/JSON"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
makedepends="perl-dev"
diff --git a/system/perl-libwww/APKBUILD b/system/perl-libwww/APKBUILD
index ee7012f8a..c31dc6cfe 100644
--- a/system/perl-libwww/APKBUILD
+++ b/system/perl-libwww/APKBUILD
@@ -2,20 +2,20 @@
# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
pkgname=perl-libwww
_realname=libwww-perl
-pkgver=6.31
+pkgver=6.35
pkgrel=0
pkgdesc="Perl module - World Wide Web library"
-url="http://search.cpan.org/~mschilli"
+url="https://metacpan.org/release/libwww-perl"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl-http-date perl-http-cookies perl-net-http perl-http-daemon
perl-html-parser perl-file-listing perl-www-robotrules
- perl-http-negotiate perl-uri perl-http-message
+ perl-http-negotiate perl-uri perl-http-message perl-test-needs
perl-lwp-mediatypes perl-encode-locale perl-try-tiny"
makedepends="perl-dev perl-test-fatal perl-test-requiresinternet"
install=
subpackages="$pkgname-doc"
-source="$pkgname-$pkgver.tar.gz::https://github.com/libwww-perl/libwww-perl/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://cpan.metacpan.org/authors/id/E/ET/ETHER/libwww-perl-6.35.tar.gz"
builddir="$srcdir/$_realname-$pkgver"
build() {
@@ -36,4 +36,4 @@ package() {
find "$pkgdir" -name perllocal.pod -delete
}
-sha512sums="884612d01d0d5dd47f74c7e9fd44ec17f6f08069521710c84912cd11643097a5456e91c9339b888307c629199721aa20c449cf8f7e4ef6fd7be719ab637b3cf2 perl-libwww-6.31.tar.gz"
+sha512sums="db7eea57fc85f80f351c3556f0747cf94100b5cd75a6fdd76006f6ada5c7087143660f724db70f3e5fe45f53cabce2dcbaece985551e74f546f71cd7d6d27e7a perl-libwww-6.35.tar.gz"
diff --git a/system/perl-lwp-mediatypes/APKBUILD b/system/perl-lwp-mediatypes/APKBUILD
index c2fdb7f43..51778d258 100644
--- a/system/perl-lwp-mediatypes/APKBUILD
+++ b/system/perl-lwp-mediatypes/APKBUILD
@@ -5,7 +5,7 @@ _realname=LWP-MediaTypes
pkgver=6.02
pkgrel=2
pkgdesc="Perl module - guess media type for a file or a URL"
-url="http://search.cpan.org/~gaas"
+url="https://metacpan.org/release/LWP-MediaTypes"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-module-build-tiny/APKBUILD b/system/perl-module-build-tiny/APKBUILD
index 646c6be04..05d2e73da 100644
--- a/system/perl-module-build-tiny/APKBUILD
+++ b/system/perl-module-build-tiny/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Module-Build-Tiny
pkgver=0.039
pkgrel=0
pkgdesc="A tiny replacement for Module::Build"
-url="http://search.cpan.org/dist/Module-Build-Tiny/"
+url="https://metacpan.org/release/Module-Build-Tiny"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-extutils-installpaths perl-extutils-config perl-extutils-helpers perl-test-harness"
diff --git a/system/perl-module-build/APKBUILD b/system/perl-module-build/APKBUILD
index 83ba709ca..dffb1853d 100644
--- a/system/perl-module-build/APKBUILD
+++ b/system/perl-module-build/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Module-Build
pkgver=0.4224
pkgrel=0
pkgdesc="Build and install Perl modules"
-url="http://search.cpan.org/dist/Module-Build/"
+url="https://metacpan.org/release/Module-Build"
arch="noarch"
license="GPL-2.0-only AND Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-module-install/APKBUILD b/system/perl-module-install/APKBUILD
index df5e2fc71..38b38df74 100644
--- a/system/perl-module-install/APKBUILD
+++ b/system/perl-module-install/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Module-Install
pkgver=1.19
pkgrel=1
pkgdesc="Standalone, extensible Perl module installer"
-url="http://search.cpan.org/dist/Module-Install/"
+url="https://metacpan.org/release/Module-Install"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpanmakedepends="perl-file-remove perl-module-build perl-module-scandeps perl-yaml-tiny"
diff --git a/system/perl-module-scandeps/APKBUILD b/system/perl-module-scandeps/APKBUILD
index 20d41f61b..e8a1cdc73 100644
--- a/system/perl-module-scandeps/APKBUILD
+++ b/system/perl-module-scandeps/APKBUILD
@@ -3,10 +3,10 @@
# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
pkgname=perl-module-scandeps
_pkgreal=Module-ScanDeps
-pkgver=1.24
+pkgver=1.25
pkgrel=0
pkgdesc="Recursively scan Perl code for dependencies"
-url="http://search.cpan.org/dist/Module-ScanDeps/"
+url="https://metacpan.org/release/Module-ScanDeps"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpanmakedepends="perl-test-requires"
@@ -42,4 +42,4 @@ check() {
make test
}
-sha512sums="7f3d9821aa863d8ebc78fb5fb3c7172ce133169ec54ed91b90e05ba50654b4bd0282b3a760adfc8b6bd553dda4116dbf51972bb2af94b59f6f04daeba996e889 Module-ScanDeps-1.24.tar.gz"
+sha512sums="1d1d10b55147e68238465fc1e5e9248d926151394034f0bde32c0030ff9bbd685ebb1ed0c6c924769a2e38c2dc15621990b454438db5ef5699aeed378f02aec7 Module-ScanDeps-1.25.tar.gz"
diff --git a/system/perl-net-http/APKBUILD b/system/perl-net-http/APKBUILD
index 4197f33f5..879c5f966 100644
--- a/system/perl-net-http/APKBUILD
+++ b/system/perl-net-http/APKBUILD
@@ -4,12 +4,11 @@ pkgname=perl-net-http
pkgver=6.18
pkgrel=0
pkgdesc="Low-level HTTP connection client library for Perl"
-url="http://search.cpan.org/dist/Net-HTTP/"
+url="https://metacpan.org/release/Net-HTTP"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-uri"
makedepends="perl-dev"
-install=""
replaces="perl-libwww"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/O/OA/OALDERS/Net-HTTP-$pkgver.tar.gz"
diff --git a/system/perl-net-libidn/APKBUILD b/system/perl-net-libidn/APKBUILD
index 290e9b600..d8bac5b15 100644
--- a/system/perl-net-libidn/APKBUILD
+++ b/system/perl-net-libidn/APKBUILD
@@ -10,7 +10,6 @@ arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
makedepends="libidn-dev perl-dev"
-install=""
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/T/TH/THOR/$_realname-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"
diff --git a/system/perl-net-smtp-ssl/APKBUILD b/system/perl-net-smtp-ssl/APKBUILD
index 67e08e266..05e7f7a05 100644
--- a/system/perl-net-smtp-ssl/APKBUILD
+++ b/system/perl-net-smtp-ssl/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Net-SMTP-SSL
pkgver=1.04
pkgrel=0
pkgdesc="SSL/TLS support for Net::SMTP"
-url="http://search.cpan.org/dist/Net-SMTP-SSL/"
+url="https://metacpan.org/release/Net-SMTP-SSL"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-io-socket-ssl perl-net-ssleay"
diff --git a/system/perl-net-ssleay/APKBUILD b/system/perl-net-ssleay/APKBUILD
index 6e0256315..f39c464b7 100644
--- a/system/perl-net-ssleay/APKBUILD
+++ b/system/perl-net-ssleay/APKBUILD
@@ -5,7 +5,7 @@ _realname=Net-SSLeay
pkgver=1.85
pkgrel=0
pkgdesc="Perl extension for using OpenSSL"
-url="http://search.cpan.org/dist/Net-SSLeay/"
+url="https://metacpan.org/release/Net-SSLeay"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-sub-uplevel/APKBUILD b/system/perl-sub-uplevel/APKBUILD
index 6eb77aff4..035f67670 100644
--- a/system/perl-sub-uplevel/APKBUILD
+++ b/system/perl-sub-uplevel/APKBUILD
@@ -5,7 +5,7 @@ _realname=Sub-Uplevel
pkgver=0.2800
pkgrel=0
pkgdesc="Perl module to apparently run a function in a higher stack frame"
-url="http://search.cpan.org/~dagolden/$_realname-$pkgver/"
+url="https://metacpan.org/release/Sub-Uplevel"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl"
diff --git a/system/perl-test-exception/APKBUILD b/system/perl-test-exception/APKBUILD
index 25a978be2..4c1acf79c 100644
--- a/system/perl-test-exception/APKBUILD
+++ b/system/perl-test-exception/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-Exception
pkgver=0.43
pkgrel=0
pkgdesc="Perl module for testing exception-based code"
-url="http://search.cpan.org/dist/Test-Exception/"
+url="https://metacpan.org/release/Test-Exception"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-sub-uplevel"
diff --git a/system/perl-test-fatal/APKBUILD b/system/perl-test-fatal/APKBUILD
index 3cb20afdd..f9c0bbfd5 100644
--- a/system/perl-test-fatal/APKBUILD
+++ b/system/perl-test-fatal/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-Fatal
pkgver=0.014
pkgrel=1
pkgdesc="incredibly simple helpers for testing code with exceptions"
-url="http://search.cpan.org/dist/Test-Fatal/"
+url="https://metacpan.org/release/Test-Fatal"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-try-tiny"
diff --git a/system/perl-test-harness/APKBUILD b/system/perl-test-harness/APKBUILD
index bca0490e7..082ee0e68 100644
--- a/system/perl-test-harness/APKBUILD
+++ b/system/perl-test-harness/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-Harness
pkgver=3.42
pkgrel=0
pkgdesc="Run Perl standard test scripts with statistics"
-url="http://search.cpan.org/dist/Test-Harness/"
+url="https://metacpan.org/release/Test-Harness"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-test-leaktrace/APKBUILD b/system/perl-test-leaktrace/APKBUILD
index 6e63eafa7..5ba02bf89 100644
--- a/system/perl-test-leaktrace/APKBUILD
+++ b/system/perl-test-leaktrace/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-LeakTrace
pkgver=0.16
pkgrel=0
pkgdesc="Traces memory leaks"
-url="http://search.cpan.org/dist/Test-LeakTrace/"
+url="https://metacpan.org/release/Test-LeakTrace"
arch="all"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-test-needs/APKBUILD b/system/perl-test-needs/APKBUILD
index c40abbe62..1c2e096c3 100644
--- a/system/perl-test-needs/APKBUILD
+++ b/system/perl-test-needs/APKBUILD
@@ -4,7 +4,7 @@ pkgname=perl-test-needs
pkgver=0.002005
pkgrel=0
pkgdesc="Perl module for skipping tests when modules aren't found"
-url="https://metacpan.org/pod/Test::Needs"
+url="https://metacpan.org/release/Test-Needs"
arch="noarch"
license="Artistic-2.0"
depends="perl"
diff --git a/system/perl-test-nowarnings/APKBUILD b/system/perl-test-nowarnings/APKBUILD
index 42adbdfb4..f8ab7e3d2 100644
--- a/system/perl-test-nowarnings/APKBUILD
+++ b/system/perl-test-nowarnings/APKBUILD
@@ -4,7 +4,7 @@ pkgname=perl-test-nowarnings
pkgver=1.04
pkgrel=2
pkgdesc="Perl module to ensure no warnings occur during testing"
-url="http://search.cpan.org/dist/Test-NoWarnings/"
+url="https://metacpan.org/release/Test-NoWarnings"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-test-simple"
diff --git a/system/perl-test-pod/APKBUILD b/system/perl-test-pod/APKBUILD
index a2ce5e98b..639ccdbd3 100644
--- a/system/perl-test-pod/APKBUILD
+++ b/system/perl-test-pod/APKBUILD
@@ -3,10 +3,10 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=perl-test-pod
_pkgreal=Test-Pod
-pkgver=1.51
-pkgrel=2
+pkgver=1.52
+pkgrel=0
pkgdesc="Check for POD errors in files"
-url="http://search.cpan.org/dist/Test-Pod/"
+url="https://metacpan.org/release/Test-Pod"
arch="noarch"
license="GPL-2.0-only AND Artistic-1.0-Perl"
cpandepends=""
@@ -41,4 +41,4 @@ package() {
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}
-sha512sums="bf4e8b2a71a79a5edec86991c7cbbcc929fa4f2eb403b411cd678fbdf89fe30c198e00a29db80ca9c98fe6655167c0a77e7f166f073a18711db3b1f3e5cd3c15 Test-Pod-1.51.tar.gz"
+sha512sums="9b078488e1da8b907f5f3a46452aa9bfd49db61f1539d076dccebf9a8b476eaf0f539f00badc9c500b1e732a8827331b2286375924986efb990367767eeb8365 Test-Pod-1.52.tar.gz"
diff --git a/system/perl-test-requires/APKBUILD b/system/perl-test-requires/APKBUILD
index cc9459d38..a849fab33 100644
--- a/system/perl-test-requires/APKBUILD
+++ b/system/perl-test-requires/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-Requires
pkgver=0.10
pkgrel=0
pkgdesc="Checks to see if a Perl module can be loaded"
-url="http://search.cpan.org/dist/Test-Requires/"
+url="https://metacpan.org/release/Test-Requires"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-test-requiresinternet/APKBUILD b/system/perl-test-requiresinternet/APKBUILD
index db7b419a5..6a7dea85e 100644
--- a/system/perl-test-requiresinternet/APKBUILD
+++ b/system/perl-test-requiresinternet/APKBUILD
@@ -5,7 +5,7 @@ _pkgreal=Test-RequiresInternet
pkgver=0.05
pkgrel=1
pkgdesc="Easily test network connectivity"
-url="http://search.cpan.org/dist/Test-RequiresInternet/"
+url="https://metacpan.org/release/Test-RequiresInternet"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
makedepends="perl-dev"
diff --git a/system/perl-test-simple/APKBUILD b/system/perl-test-simple/APKBUILD
index f47194d67..078869136 100644
--- a/system/perl-test-simple/APKBUILD
+++ b/system/perl-test-simple/APKBUILD
@@ -3,10 +3,10 @@
# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
pkgname=perl-test-simple
_pkgreal=Test-Simple
-pkgver=1.302136
+pkgver=1.302140
pkgrel=0
pkgdesc="Basic utilities for writing Perl tests"
-url="http://search.cpan.org/dist/Test-Simple/"
+url="https://metacpan.org/release/Test-Simple"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
provides="perl-test-tester"
@@ -47,4 +47,4 @@ doc() {
replaces="perl-doc"
}
-sha512sums="80bc252a7d796ba6f43c61b50ea47ed12f391995d80a254a565627dc3d3728a4d8fa5395ca657c29630e19b3f22518c1c50774ce4e52abc52797c0adfdeac9aa Test-Simple-1.302136.tar.gz"
+sha512sums="fb823470165e321f68bf761cb9fd31d9e2b3efb42a7ac25602f4a33624e3b8287f6210d502c6afe7723b5ad50c4b1fed2a1db166f151f9b9155d2bca4600766f Test-Simple-1.302140.tar.gz"
diff --git a/system/perl-test-warn/APKBUILD b/system/perl-test-warn/APKBUILD
index 0be6991fb..0ae630515 100644
--- a/system/perl-test-warn/APKBUILD
+++ b/system/perl-test-warn/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Test-Warn
pkgver=0.36
pkgrel=0
pkgdesc="Perl extension to test methods for warnings"
-url="http://search.cpan.org/dist/Test-Warn/"
+url="https://metacpan.org/release/Test-Warn"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends="perl-sub-uplevel"
diff --git a/system/perl-test-without-module/APKBUILD b/system/perl-test-without-module/APKBUILD
index 48eb1162f..ce250cbbe 100644
--- a/system/perl-test-without-module/APKBUILD
+++ b/system/perl-test-without-module/APKBUILD
@@ -5,7 +5,7 @@ _pkgreal=Test-Without-Module
pkgver=0.20
pkgrel=0
pkgdesc="Test fallback behaviour in absence of Perl modules"
-url="https://metacpan.org/pod/Test::Without::Module"
+url="https://metacpan.org/release/Test-Without-Module"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
makedepends="perl-dev"
diff --git a/system/perl-try-tiny/APKBUILD b/system/perl-try-tiny/APKBUILD
index fb93a3117..957139162 100644
--- a/system/perl-try-tiny/APKBUILD
+++ b/system/perl-try-tiny/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=Try-Tiny
pkgver=0.30
pkgrel=0
pkgdesc="Minimal Perl try/catch with proper environment preservation"
-url="http://search.cpan.org/dist/Try-Tiny/"
+url="https://metacpan.org/release/Try-Tiny"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/perl-uri/APKBUILD b/system/perl-uri/APKBUILD
index 6624a4621..5909ad364 100644
--- a/system/perl-uri/APKBUILD
+++ b/system/perl-uri/APKBUILD
@@ -4,13 +4,12 @@ pkgname=perl-uri
pkgver=1.74
pkgrel=0
pkgdesc="Perl library for URI manipulation"
-url="https://metacpan.org/pod/URI"
+url="https://metacpan.org/release/URI"
arch="noarch"
license="GPL-1.0+ OR Artistic-1.0-Perl"
depends="perl"
makedepends="$depends"
checkdepends="perl-test-needs"
-install=""
subpackages="$pkgname-doc"
provides="perl-uri-escape"
source="https://cpan.metacpan.org/authors/id/E/ET/ETHER/URI-$pkgver.tar.gz"
diff --git a/system/perl-www-robotrules/APKBUILD b/system/perl-www-robotrules/APKBUILD
index f2add4a41..dba5d1b34 100644
--- a/system/perl-www-robotrules/APKBUILD
+++ b/system/perl-www-robotrules/APKBUILD
@@ -4,12 +4,11 @@ pkgname=perl-www-robotrules
pkgver=6.02
pkgrel=2
pkgdesc="Perl module for parsing /robots.txt files on HTTP servers"
-url="http://search.cpan.org/dist/WWW-RobotRules/"
+url="https://metacpan.org/release/WWW-RobotRules"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
depends="perl perl-uri"
makedepends="perl-dev"
-install=""
replaces="perl-libwww"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/WWW-RobotRules-$pkgver.tar.gz"
diff --git a/system/perl-yaml-syck/APKBUILD b/system/perl-yaml-syck/APKBUILD
index e912ec396..c2eeac2f2 100644
--- a/system/perl-yaml-syck/APKBUILD
+++ b/system/perl-yaml-syck/APKBUILD
@@ -6,15 +6,11 @@ _pkgreal=YAML-Syck
pkgver=1.30
pkgrel=2
pkgdesc="Fast, lightweight YAML loader and dumper"
-url="http://search.cpan.org/dist/YAML-Syck/"
+url="https://metacpan.org/release/YAML-Syck"
arch="all"
license="MIT"
-cpandepends=""
-cpanmakedepends=""
-cpancheckdepends=""
-depends="$cpandepends"
-makedepends="perl-dev $cpanmakedepends"
-checkdepends="$cpancheckdepends"
+depends=""
+makedepends="perl-dev"
subpackages="$pkgname-doc"
source="http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
diff --git a/system/perl-yaml-tiny/APKBUILD b/system/perl-yaml-tiny/APKBUILD
index db3151174..466fcbe98 100644
--- a/system/perl-yaml-tiny/APKBUILD
+++ b/system/perl-yaml-tiny/APKBUILD
@@ -6,7 +6,7 @@ _pkgreal=YAML-Tiny
pkgver=1.73
pkgrel=1
pkgdesc="YAML manipulation library for Perl"
-url="http://search.cpan.org/dist/YAML-Tiny/"
+url="https://metacpan.org/release/YAML-Tiny"
arch="noarch"
license="GPL-2.0-only OR Artistic-1.0-Perl"
cpandepends=""
diff --git a/system/sqlite/APKBUILD b/system/sqlite/APKBUILD
index 54e79ccc4..77eac113e 100644
--- a/system/sqlite/APKBUILD
+++ b/system/sqlite/APKBUILD
@@ -17,7 +17,7 @@ esac
[ $_d -lt 10 ] && _d=0$_d
_ver=${_a}${_b}${_c}${_d}
-pkgrel=1
+pkgrel=2
pkgdesc="C library that implements an SQL database engine"
url="https://sqlite.org/"
arch="all"
@@ -29,6 +29,7 @@ source="http://www.sqlite.org/2018/$pkgname-autoconf-$_ver.tar.gz
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
_amalgamation="-DSQLITE_ENABLE_FTS4 \
+ -DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_COLUMN_METADATA \
diff --git a/system/strace/APKBUILD b/system/strace/APKBUILD
index 7ac11deaf..4c0e5bd0f 100644
--- a/system/strace/APKBUILD
+++ b/system/strace/APKBUILD
@@ -1,6 +1,6 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=strace
-pkgver=4.23
+pkgver=4.24
pkgrel=0
pkgdesc="A useful diagnositic, instructional, and debugging tool"
url="https://strace.io/"
@@ -59,7 +59,7 @@ package() {
make -j1 DESTDIR="$pkgdir" install
}
-sha512sums="f7694c18a32fcdcfee8f54f866ff8102b6b1797c89d97daf91e62d8c8f642b937ffcbb5ee4c027b1eb3163125e2b65ab063e856657aff056c70b0dbfc46f0aea strace-4.23.tar.gz
+sha512sums="14d5bb8722a3aeb9d1173e6ee040fbad6fd8a66182fd417f5ec699afcd3fc2f03a636a45a529ed1400881db5e766acdd37fd0f3d07da6e651a15abbc5c394c28 strace-4.24.tar.gz
273b92ebf0069f19bef7ec26c7860e2af7ef01e782255c70ded1ae5e967f8f6bf031ecba96612c6083bf58f46278ba4ab3ec0fb35b08c8c8d668191f97adee52 disable-fortify.patch
b70cee89dd49a2b5a69dc2a56c3a11169d3306e1a73981155188b574486965c034aa52b4ac1c6edff5ef55c9d52f27750acb242fac095a8a9f69689b51b3fad1 fix-ppc-pt-regs-collision.patch
44b1872cf996caa4970fa6c2875a3a2cffe4a38455e328d968bd7855ef9a05cf41190794dc137bc8667576635f5271057cf0e6cde9a6c7aee66afd1dba9bdba0 nlattr-fix.patch"
diff --git a/system/sudo/APKBUILD b/system/sudo/APKBUILD
index 0d8ac292c..3e3fdc7b5 100644
--- a/system/sudo/APKBUILD
+++ b/system/sudo/APKBUILD
@@ -11,7 +11,7 @@ else
fi
pkgrel=2
pkgdesc="Give certain users the ability to run some commands as root"
-url="http://www.sudo.ws/sudo/"
+url="https://www.sudo.ws/sudo/"
arch="all"
options="suid"
license="ISC AND MIT AND BSD-3-Clause AND BSD-2-Clause AND Zlib"
diff --git a/system/vim/APKBUILD b/system/vim/APKBUILD
index 0bad1ac68..a9b40bf35 100644
--- a/system/vim/APKBUILD
+++ b/system/vim/APKBUILD
@@ -4,8 +4,8 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com>
pkgname=vim
-pkgver=8.1.0204
-pkgrel=2
+pkgver=8.1.0346
+pkgrel=0
pkgdesc="advanced text editor"
url="http://www.vim.org"
arch="all"
@@ -80,5 +80,5 @@ vimdiff() {
mv "$pkgdir"/usr/bin/vimdiff "$subpkgdir"/usr/bin
}
-sha512sums="e2629dc44a9cf6c73b589508c35a7f068fb22ae9f0802dbe7b6efa2b104598e1c1a9c0a8abacc256fee9f72b64a68ab984c443f27c57c8129c2754d49e099587 vim-8.1.0204.tar.gz
+sha512sums="ce27d6d9215e80d84661aec4062f4730e4ed95cfbcedfdd46e73b5a5a1599ea709664c967c5e17ad3515341f79b59fb5c3ddc851cc84cd5717c0e68c6c82961c vim-8.1.0346.tar.gz
3a6c9bc187a6f45fd78e91dcc44d4d661c1ae1f2655e3a66bb36245ad1dc41e8d0e6061ec3aee6d323f96058b4a5501a87e3327e539cfd026f68cf81d455d721 vimrc"
diff --git a/system/yaml/APKBUILD b/system/yaml/APKBUILD
index 5499c5e51..323ac3b40 100644
--- a/system/yaml/APKBUILD
+++ b/system/yaml/APKBUILD
@@ -1,10 +1,10 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=yaml
-pkgver=0.1.7
+pkgver=0.2.1
pkgrel=0
pkgdesc="YAML 1.1 parser and emitter written in C"
-url="http://pyyaml.org/wiki/LibYAML"
+url="https://pyyaml.org/wiki/LibYAML"
arch="all"
license="MIT"
depends=""
@@ -35,4 +35,4 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="1ee5007dd10db137b5ee80f8117f07390ec04af98d087a5f5475dd2b38d87c699b79ab1676e6c7bfa263323fcdf8edd69fada2b0b7f9c57bef4e46cd65f1e975 yaml-0.1.7.tar.gz"
+sha512sums="97ebeea2a2c877b24de2e1ffbf175d07d97d5c8b90e06d21fd057e1114d10b96c04fd92c2ed4e956db751b7ac1686b3fd5778927912ca5bb0d096908a1351235 yaml-0.2.1.tar.gz"