diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/adelie-base/APKBUILD | 6 | ||||
-rwxr-xr-x | system/adelie-base/addgroup | 1 | ||||
-rwxr-xr-x | system/adelie-base/adduser | 1 | ||||
-rw-r--r-- | system/apk-tools/APKBUILD | 4 | ||||
-rw-r--r-- | system/apk-tools/deep.patch | 84 | ||||
-rw-r--r-- | system/bc/APKBUILD | 4 | ||||
-rw-r--r-- | system/coreutils/APKBUILD | 10 | ||||
-rw-r--r-- | system/coreutils/date-debug.patch | 56 | ||||
-rw-r--r-- | system/coreutils/gnulib-test-fixes.patch | 35 | ||||
-rw-r--r-- | system/coreutils/gnulib-tests-dont-require-gpg-passphrase.patch | 10 | ||||
-rw-r--r-- | system/libffi/APKBUILD | 14 | ||||
-rw-r--r-- | system/libffi/powerpc-fixes.patch | 79 | ||||
-rw-r--r-- | system/musl/APKBUILD | 6 | ||||
-rw-r--r-- | system/musl/arm64-tls.patch | 116 | ||||
-rw-r--r-- | system/musl/strftime-add-l-support.patch | 25 |
15 files changed, 433 insertions, 18 deletions
diff --git a/system/adelie-base/APKBUILD b/system/adelie-base/APKBUILD index d44c77d41..ccdf74a65 100644 --- a/system/adelie-base/APKBUILD +++ b/system/adelie-base/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=adelie-base pkgver=0.9.2 -pkgrel=0 +pkgrel=1 pkgdesc="The Adélie Linux Base System" url="https://www.adelielinux.org/" arch="noarch" @@ -102,5 +102,5 @@ docs() { sha512sums="e57895cb8076ffb761802694eebe3f6ea63295ae63b33ce2b4cc21fcc0bd004c2e2f1d46b30072fc8c268dda0180444b6ead7b81a0ecc523250e5512970197e6 adelie-base-0.9.2.tar.xz 37260d9315fd8d8b0df3dfb5bd3e1035a47ba1e43f33aa195e3feca6d169da282c1b067ef4603e7e9acaedbfef8b58cf490c00bdca444d43c9d570355ad29eac group 1288d9d1ee77e1159bacbc94a44b2ae9c6dff94c5001be6e560cd5859f86181c47341317025d4999bc7d57cfcebb7974804514d981b7bd66ffd00c5edaf5360c passwd -5b87e0c73e7d73715467b09c9c228b14abfdc1567b3d8a3e6ef86694a9d016c798c22411c9c8ccf41920fbe185199f6d6dbd45d4bceb6652ab4a7bea87c4fe51 addgroup -f50be377c781b1eefb1804ac9d96b4ebc64f80abe0d12b288413687a000e79ca30c531bbced2c63f9e4df59b1d8a71d0eda09ee82782eaafea453f2f1c2f7b8f adduser" +f2437ebfbc83aa6eaeec3a111aae98751215cebfaec3991ccc511be8c8938778ae46f15e07c7306bd431d036bc4ba49b33b724b839c125bd882d2e93c0314ae8 addgroup +2f97bb4b24d9ea8d8d3001bb0cd0aac4b65caff75d25b172f9e925c55185183c2d4b54d9949cd8d43ca74c003a8590f2b98a119696075507f513b549fac94476 adduser" diff --git a/system/adelie-base/addgroup b/system/adelie-base/addgroup index 27a523d75..831f44374 100755 --- a/system/adelie-base/addgroup +++ b/system/adelie-base/addgroup @@ -5,6 +5,7 @@ # Copyright © 2017 A. Wilcox. All rights reserved. # Licensed under the terms of the NCSA Open Source license. # +export PATH=/bin:/usr/bin:/sbin:/usr/sbin ARG= CMDLINE= diff --git a/system/adelie-base/adduser b/system/adelie-base/adduser index 5c458045d..a3c1b9fbe 100755 --- a/system/adelie-base/adduser +++ b/system/adelie-base/adduser @@ -5,6 +5,7 @@ # Copyright © 2017 A. Wilcox. All rights reserved. # Licensed under the terms of the NCSA Open Source license. # +export PATH=/bin:/usr/bin:/sbin:/usr/sbin # The GECOS for the new user. GECOS="Linux User,,," diff --git a/system/apk-tools/APKBUILD b/system/apk-tools/APKBUILD index 10360db6a..d9e29a241 100644 --- a/system/apk-tools/APKBUILD +++ b/system/apk-tools/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org> pkgname=apk-tools pkgver=2.10.3 -pkgrel=1 +pkgrel=2 pkgdesc="Alpine Package Keeper - package manager" url="https://git.alpinelinux.org/cgit/apk-tools/" arch="all" @@ -13,6 +13,7 @@ makedepends_host="zlib-dev openssl openssl-dev linux-headers" makedepends="$makedepends_build $makedepends_host" subpackages="$pkgname-static" source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz + deep.patch list.patch pmmx.patch " @@ -69,5 +70,6 @@ static() { } sha512sums="1b190cfd04c69369bd4f2b708d4df0f8cf2937e1580c95138fd2c2257e7604d015deaca10a9fe0da6742981caadb6b067c15e417a1951866f781b8a5c71c98ee apk-tools-2.10.3.tar.xz +a89007da158cbca67d5c18df2f117958604d69bf49251ccd11052457d5926eebe3d6573dfca238bd246e64661a7e373b1853fd226e4cca34c148195e688ae846 deep.patch 53d446734d32341cbd9ca00aedcd65d4d99220da354a9339837a6c79609a321f61ae917fb3cd9d4bffebcfc171d06c0f0d315e29a2d16285545c4fa085a75639 list.patch 746d00ce2af554a25db7ecea2b0a4d8f7399d2560efb6bf59ea144012d0163d3e0bad84c799bd706e8be6c0a543d4e35728d6beb269fddbbea626384009129cb pmmx.patch" diff --git a/system/apk-tools/deep.patch b/system/apk-tools/deep.patch new file mode 100644 index 000000000..f315339cc --- /dev/null +++ b/system/apk-tools/deep.patch @@ -0,0 +1,84 @@ +From e61635ada7901763919caeaa01fa62ead3f6e97f Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" <AWilcox@Wilcox-Tech.com> +Date: Fri, 31 May 2019 21:32:02 -0500 +Subject: [PATCH 1/1] upgrade: add --deep option to upgrade everything + +--- + src/apk_solver.h | 1 + + src/solver.c | 10 ++++++++++ + src/upgrade.c | 5 +++++ + 3 files changed, 16 insertions(+) + +diff --git a/src/apk_solver.h b/src/apk_solver.h +index b8b072d..908b3fd 100644 +--- a/src/apk_solver.h ++++ b/src/apk_solver.h +@@ -35,6 +35,7 @@ struct apk_changeset { + #define APK_SOLVERF_REINSTALL 0x0004 + #define APK_SOLVERF_LATEST 0x0008 + #define APK_SOLVERF_IGNORE_CONFLICT 0x0010 ++#define APK_SOLVERF_DEEP 0x0020 + + void apk_solver_set_name_flags(struct apk_name *name, + unsigned short solver_flags, +diff --git a/src/solver.c b/src/solver.c +index e10cf8b..8437d61 100644 +--- a/src/solver.c ++++ b/src/solver.c +@@ -40,6 +40,7 @@ struct apk_solver_state { + unsigned int pinning_inherit; + unsigned int default_repos; + unsigned ignore_conflict : 1; ++ unsigned deep_upgrade : 1; + }; + + static struct apk_provider provider_none = { +@@ -510,6 +511,14 @@ static int compare_providers(struct apk_solver_state *ss, + unsigned int solver_flags; + int r; + ++ /* In deep upgrades, always return the greater version */ ++ if (ss->deep_upgrade) ++ switch (apk_version_compare_blob(*pA->version, *pB->version)) { ++ case APK_VERSION_LESS: ++ return -1; ++ case APK_VERSION_GREATER: ++ return 1; ++ } + + /* Prefer existing package */ + if (pkgA == NULL || pkgB == NULL) +@@ -1006,6 +1015,7 @@ restart: + ss->changeset = changeset; + ss->default_repos = apk_db_get_pinning_mask_repos(db, APK_DEFAULT_PINNING_MASK); + ss->ignore_conflict = !!(solver_flags & APK_SOLVERF_IGNORE_CONFLICT); ++ ss->deep_upgrade = !!(solver_flags & APK_SOLVERF_DEEP); + list_init(&ss->dirty_head); + list_init(&ss->unresolved_head); + +diff --git a/src/upgrade.c b/src/upgrade.c +index 14457b5..e48d8e3 100644 +--- a/src/upgrade.c ++++ b/src/upgrade.c +@@ -38,6 +38,9 @@ static int option_parse_applet(void *ctx, struct apk_db_options *dbopts, int opt + case 'a': + uctx->solver_flags |= APK_SOLVERF_AVAILABLE; + break; ++ case 'd': ++ uctx->solver_flags |= APK_SOLVERF_DEEP; ++ break; + case 'l': + uctx->solver_flags |= APK_SOLVERF_LATEST; + break; +@@ -59,6 +62,8 @@ static const struct apk_option options_applet[] = { + { 0x10000, "no-self-upgrade", + "Do not do early upgrade of 'apk-tools' package" }, + { 0x10001, "self-upgrade-only", "Only do self-upgrade" }, ++ { 'd', "deep", ++ "Include dependencies when upgrading world" }, + }; + + static const struct apk_option_group optgroup_applet = { +-- +2.21.0 + diff --git a/system/bc/APKBUILD b/system/bc/APKBUILD index 4e2df5272..9b3f34b01 100644 --- a/system/bc/APKBUILD +++ b/system/bc/APKBUILD @@ -1,7 +1,7 @@ # Contributor: A. Wilcox <awilfox@adelielinux.org> # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=bc -pkgver=1.2.8 +pkgver=2.0.0 pkgrel=0 pkgdesc="An arbitrary precision numeric processing language (calculator)" url="https://github.com/gavinhoward/bc" @@ -26,4 +26,4 @@ package() { make install } -sha512sums="34941e73edf35a24f96469453643277b4fb8bfbdabda945ef20fddbb1d42be572659225859939f994d29fc17aab9da7d04ffc1f3217b1875eed3d6070a22bb3f bc-1.2.8.tar.xz" +sha512sums="183cec17ed5020e673abb886eb1f391f8a97ac37a67ca63bb00d8b4c8e52ba0e502f7f813d5b4abf650b0fd0dc74a7e8a7a752faf8a47bd7a8014fd4703bca05 bc-2.0.0.tar.xz" diff --git a/system/coreutils/APKBUILD b/system/coreutils/APKBUILD index 0cdd3fa4e..061d2bc26 100644 --- a/system/coreutils/APKBUILD +++ b/system/coreutils/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=coreutils pkgver=8.31 -pkgrel=0 +pkgrel=1 pkgdesc="Basic file, shell, and text manipulation utilities" url="https://www.gnu.org/software/coreutils/" arch="all" @@ -15,8 +15,11 @@ subpackages="$pkgname-doc" [ ${CBUILD} == ${CHOST} ] && subpackages="$subpackages $pkgname-lang" install="$pkgname.post-deinstall" source="https://ftp.gnu.org/gnu/coreutils/$pkgname-$pkgver.tar.xz + date-debug.patch disable-csplit-io-err-test.patch disable-mbrtowc-test.patch + gnulib-tests-dont-require-gpg-passphrase.patch + gnulib-test-fixes.patch localename-test-fix.patch " [ ${CBUILD} != ${CHOST} ] && source="$source @@ -75,7 +78,10 @@ package() { sha512sums="ef8941dae845bbf5ae5838bc49e44554a766302930601aada6fa594e8088f0fbad74e481ee392ff89633e68b99e4da3f761fcb5d31ee3b233d540fe2a2d4e1af coreutils-8.31.tar.xz bd8b5cecba59eba30458c8afa895877d39a987b989bc06b70cd6836e0ef684677aaadcb4949b58a713779fe1df1e15e3903e9be14e306671b86b69018b75de8b disable-csplit-io-err-test.patch 532ef8210261437855ba3e2fc72ec57b0e0252b2b0f7817990c9629613ece2cdd86cf30aa049f3cff6fbda12ed3bb9a0db3a3642475378ae44ce319bdf005d9b disable-mbrtowc-test.patch -86944e9ea5493c5b21ab62562a63aa134952738297b21cfb2e8f751db4a695ff25ee1592eb231ed1bb80999bc31f7504c7feffde2e93b4e068c05c44ac83cbdf localename-test-fix.patch" +86944e9ea5493c5b21ab62562a63aa134952738297b21cfb2e8f751db4a695ff25ee1592eb231ed1bb80999bc31f7504c7feffde2e93b4e068c05c44ac83cbdf localename-test-fix.patch +fd97fccd661befc558b3afb3e32c82dd2cef511a05e6129d49540599297c1b59ab1f109e63a12f585a2348c26c28fb98330c348829d1fe61cf8149d0dd1c989c gnulib-tests-dont-require-gpg-passphrase.patch +a1d014a683fb3b2e08e7392f7589fd92a565e2a4d0cac1cf960968dd3d990e020fdd3bb6aea2bbeaca3ba8f2522b4da3d75b93f414ebf83d8b26b5ccbb38a64d gnulib-test-fixes.patch +aac3a89b27a7854fbf483e155df9133c3d33a0f36bd55d5606559a7781f9d27d5c17779ea427142311749252767097bf92ec22d4cf86b510568c186da84ff16c date-debug.patch" [ ${CBUILD} != ${CHOST} ] && sha512sums=" bae804f057252c25452ac178c545dc2c4b4775cbfbdcfd4775edd1a4ed6507882bfac39e2b11ad01b74230ca48d761bf62f11bde5bcbc35a6e5a61cbe4a46e36 051_all_coreutils-mangen.patch " diff --git a/system/coreutils/date-debug.patch b/system/coreutils/date-debug.patch new file mode 100644 index 000000000..fc4977e72 --- /dev/null +++ b/system/coreutils/date-debug.patch @@ -0,0 +1,56 @@ +>From 402c3646e19c199130e7a6db5238cf5908e51fb8 Mon Sep 17 00:00:00 2001 +From: Assaf Gordon <assafgordon@gmail.com> +Date: Mon, 13 May 2019 16:37:40 -0600 +Subject: [PATCH] tests: avoid false-positive in date-debug test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When debugging an invalid date due to DST switching, the intermediate +'normalized time' should not be checked - its value can differ between +systems (e.g. glibc vs musl). + +Reported by Niklas Hambüchen in +https://lists.gnu.org/r/coreutils/2019-05/msg00031.html +Analyzed by Rich Felker in +https://lists.gnu.org/r/coreutils/2019-05/msg00039.html + +* tests/misc/date-debug.sh: Replace the exact normalized time +with 'XX:XX:XX' so different values would not trigger test failure. +--- + tests/misc/date-debug.sh | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/tests/misc/date-debug.sh b/tests/misc/date-debug.sh +index aa47f1abb..2ce6f4ce8 100755 +--- a/tests/misc/date-debug.sh ++++ b/tests/misc/date-debug.sh +@@ -71,7 +71,7 @@ date: input timezone: TZ="America/Edmonton" in date string + date: using specified time as starting value: '02:30:00' + date: error: invalid date/time value: + date: user provided time: '(Y-M-D) 2006-04-02 02:30:00' +-date: normalized time: '(Y-M-D) 2006-04-02 03:30:00' ++date: normalized time: '(Y-M-D) 2006-04-02 XX:XX:XX' + date: -- + date: possible reasons: + date: non-existing due to daylight-saving time; +@@ -81,7 +81,14 @@ date: invalid date 'TZ="America/Edmonton" 2006-04-02 02:30:00' + EOF + + # date should return 1 (error) for invalid date +-returns_ 1 date --debug -d "$in2" >out2 2>&1 || fail=1 ++returns_ 1 date --debug -d "$in2" >out2-t 2>&1 || fail=1 ++ ++# The output line of "normalized time" can differ between systems ++# (e.g. glibc vs musl) and should not be checked. ++# See: https://lists.gnu.org/archive/html/coreutils/2019-05/msg00039.html ++sed '/normalized time:/s/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ XX:XX:XX/' \ ++ out2-t > out2 || framework_failure_ ++ + compare exp2 out2 || fail=1 + + ## +-- +2.11.0 + + diff --git a/system/coreutils/gnulib-test-fixes.patch b/system/coreutils/gnulib-test-fixes.patch new file mode 100644 index 000000000..abe010f7d --- /dev/null +++ b/system/coreutils/gnulib-test-fixes.patch @@ -0,0 +1,35 @@ +--- coreutils-8.31/gnulib-tests/test-getrusage.c.old 2019-06-01 07:41:59.675041756 +0000 ++++ coreutils-8.31/gnulib-tests/test-getrusage.c 2019-06-01 22:08:20.374400415 +0000 +@@ -36,6 +36,8 @@ + struct rusage after; + int ret; + ++ return 77; ++ + ret = getrusage (RUSAGE_SELF, &before); + ASSERT (ret == 0); + +--- coreutils-8.31/gnulib-tests/test-parse-datetime.c.old 2019-06-01 07:46:25.716292871 +0000 ++++ coreutils-8.31/gnulib-tests/test-parse-datetime.c 2019-06-01 22:07:59.456653669 +0000 +@@ -432,21 +432,5 @@ + ASSERT ( parse_datetime (&result, "TZ=\"\\\\\"", &now)); + ASSERT ( parse_datetime (&result, "TZ=\"\\\"\"", &now)); + +- /* Outlandishly-long time zone abbreviations should not cause problems. */ +- { +- static char const bufprefix[] = "TZ=\""; +- enum { tzname_len = 2000 }; +- static char const bufsuffix[] = "0\" 1970-01-01 01:02:03.123456789"; +- enum { bufsize = sizeof bufprefix - 1 + tzname_len + sizeof bufsuffix }; +- char buf[bufsize]; +- memcpy (buf, bufprefix, sizeof bufprefix - 1); +- memset (buf + sizeof bufprefix - 1, 'X', tzname_len); +- strcpy (buf + bufsize - sizeof bufsuffix, bufsuffix); +- ASSERT (parse_datetime (&result, buf, &now)); +- LOG (buf, now, result); +- ASSERT (result.tv_sec == 1 * 60 * 60 + 2 * 60 + 3 +- && result.tv_nsec == 123456789); +- } +- + return 0; + } diff --git a/system/coreutils/gnulib-tests-dont-require-gpg-passphrase.patch b/system/coreutils/gnulib-tests-dont-require-gpg-passphrase.patch new file mode 100644 index 000000000..b64993187 --- /dev/null +++ b/system/coreutils/gnulib-tests-dont-require-gpg-passphrase.patch @@ -0,0 +1,10 @@ +--- grep-3.1/gnulib-tests/test-vc-list-files-git.sh.old 2018-01-03 18:36:29.000000000 -0600 ++++ grep-3.1/gnulib-tests/test-vc-list-files-git.sh 2018-06-18 21:57:08.305562148 -0500 +@@ -32,6 +32,7 @@ + touch d/a b c && + git config user.email "you@example.com" && + git config user.name "Your Name" && ++ git config commit.gpgsign false && + git add . > /dev/null && + git commit -q -a -m log && + printf '%s\n' b c d/a > expected && diff --git a/system/libffi/APKBUILD b/system/libffi/APKBUILD index b37b6226c..1913e0dbc 100644 --- a/system/libffi/APKBUILD +++ b/system/libffi/APKBUILD @@ -1,27 +1,24 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=libffi pkgver=3.2.1 -pkgrel=4 +pkgrel=5 pkgdesc="A portable, high level programming interface to various calling conventions." url="https://sourceware.org/libffi" arch="all" license="MIT" -depends= +depends="" makedepends="texinfo" checkdepends="dejagnu" -install= subpackages="$pkgname-dev $pkgname-doc" source="https://sourceware.org/pub/$pkgname/$pkgname-$pkgver.tar.gz disable-ppc-ldvariant.patch fix-testsuite-longdouble.patch gnu-linux-define.patch pax-dlmmap.patch + powerpc-fixes.patch " -builddir="$srcdir"/$pkgname-$pkgver - build () { - cd "$builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -31,12 +28,10 @@ build () { } check() { - cd "$builddir" make check } package() { - cd "$builddir" make DESTDIR=""$pkgdir"" install install -m755 -d ""$pkgdir"/usr/share/licenses/$pkgname" install -m644 LICENSE ""$pkgdir"/usr/share/licenses/$pkgname/" @@ -54,4 +49,5 @@ sha512sums="980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a29 cfd3b11a0e168fd74da0a6219c95610df3466b0769966351b2a5076c93a75996daf9aed41644bebb80e28793bbe18d62272385afd7813c472104cc6c93dcba41 disable-ppc-ldvariant.patch de92cb20ded7bfefc3e469ba2ac2d9d869d67dc172ec7e2d1222f8530944eb6d5016ae913baf01ac2e26bee1624c682ae9dd08d0e45d5532d59298dbe7e417eb fix-testsuite-longdouble.patch 264af568ae5388d50f647f891a406945c73cc358692266f65ad341787c0bf5f6bf31203b86c39fa1b338101c1a6d2f4fec60f95a90d379951ff5153f8f9e178f gnu-linux-define.patch -72486b389db16055ae4d7d33ba0cb05840537e28fe7a86aa89e2cb922592125d99c18c26c5df7ffde6282742e79f2b9126353e58b58f091f0486589e14dd6474 pax-dlmmap.patch" +72486b389db16055ae4d7d33ba0cb05840537e28fe7a86aa89e2cb922592125d99c18c26c5df7ffde6282742e79f2b9126353e58b58f091f0486589e14dd6474 pax-dlmmap.patch +bb3eb51a196aac2849fa0d0214e46f1428d55c8ed4375e5f8cf7fc9076927db935f97ac4d6e61a101897ac6ddc137a0a61e210b8d91888e938c6af122700e935 powerpc-fixes.patch" diff --git a/system/libffi/powerpc-fixes.patch b/system/libffi/powerpc-fixes.patch new file mode 100644 index 000000000..e62ae32d1 --- /dev/null +++ b/system/libffi/powerpc-fixes.patch @@ -0,0 +1,79 @@ +From bf6946074b948540e4147154041ea244bafb38c4 Mon Sep 17 00:00:00 2001 +From: Samuel Holland <samuel@sholland.org> +Date: Sat, 13 Oct 2018 01:14:03 +0000 +Subject: [PATCH] powerpc: Fix alignment after float structs + +--- + src/powerpc/ffi_linux64.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c +index 2534ecf3..197a270d 100644 +--- a/src/powerpc/ffi_linux64.c ++++ b/src/powerpc/ffi_linux64.c +@@ -580,11 +580,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + fparg_count++; + } + while (--elnum != 0); +- if ((next_arg.p & 3) != 0) +- { +- if (++next_arg.f == gpr_end.f) +- next_arg.f = rest.f; +- } ++ if ((next_arg.p & 7) != 0) ++ if (++next_arg.f == gpr_end.f) ++ next_arg.f = rest.f; + } + else + do +From 49a1bbadfa0b5ad5c373271c8ba7a5d8911a85d9 Mon Sep 17 00:00:00 2001 +From: Samuel Holland <samuel@sholland.org> +Date: Sat, 13 Oct 2018 01:14:20 +0000 +Subject: [PATCH] powerpc: Don't pad rvalues copied from FP regs + +--- + src/powerpc/ffi.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c +index 7eb543e4..94a11700 100644 +--- a/src/powerpc/ffi.c ++++ b/src/powerpc/ffi.c +@@ -121,8 +121,9 @@ ffi_call_int (ffi_cif *cif, + # endif + /* The SYSV ABI returns a structure of up to 8 bytes in size + left-padded in r3/r4, and the ELFv2 ABI similarly returns a +- structure of up to 8 bytes in size left-padded in r3. */ +- if (rsize <= 8) ++ structure of up to 8 bytes in size left-padded in r3. But ++ note that a structure of a single float is not paddded. */ ++ if (rsize <= 8 && (cif->flags & FLAG_RETURNS_FP) == 0) + memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize); + else + #endif +From b0c598d5d6b653a3ea87a2d04afb6b35441e5f7e Mon Sep 17 00:00:00 2001 +From: Samuel Holland <samuel@sholland.org> +Date: Sat, 13 Oct 2018 01:14:58 +0000 +Subject: [PATCH] powerpc: Add missing check in struct alignment + +--- + src/powerpc/ffi_linux64.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c +index 197a270d..d755c712 100644 +--- a/src/powerpc/ffi_linux64.c ++++ b/src/powerpc/ffi_linux64.c +@@ -536,7 +536,11 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + if (align > 16) + align = 16; + if (align > 1) +- next_arg.p = ALIGN (next_arg.p, align); ++ { ++ next_arg.p = ALIGN (next_arg.p, align); ++ if (next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ } + } + #if _CALL_ELF == 2 + elt = discover_homogeneous_aggregate (*ptr, &elnum); diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD index 19606c44f..1c30abdfb 100644 --- a/system/musl/APKBUILD +++ b/system/musl/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=musl pkgver=1.1.22 -pkgrel=0 +pkgrel=1 pkgdesc="System library (libc) implementation" url="https://www.musl-libc.org/" arch="all" @@ -23,9 +23,11 @@ nolibc) ;; esac source="https://www.musl-libc.org/releases/musl-$pkgver.tar.gz amalgamation.patch + arm64-tls.patch 3001-make-real-lastlog-h.patch handle-aux-at_base.patch fgetspent_r.patch + strftime-add-l-support.patch ldconfig getent.c @@ -120,9 +122,11 @@ utils() { sha512sums="08a40d722672504427238e71c9e52a723c6a14735abe9581d6d4bb3f86662d5d51a3f32a6aed6420c1f9680e22a3a554a9b87ae342635be971e2db49cc9fdb87 musl-1.1.22.tar.gz 8eadf9933e729e8a6d99f667257284eaf06cb0160b40e6307ed69159c03ba4ed3c67a2943c71b5abc258bbc6c9ff321a34aa55357ebb460be9363dd605e18144 amalgamation.patch +a1127de160cbf820875d415f8fdda3c894e03748070070e282e1cf0604c883db3f8e1c311dd8c3f318ac8a158cb2183c757bcbbbd666b63676074bdec6a29983 arm64-tls.patch 88ae443dbb8e0a4368235bdc3a1c5c7b718495afa75e06deb8e01becc76cb1f0d6964589e2204fc749c9c1b3190b8b9ac1ae2c0099cab8e2ce3ec877103d4332 3001-make-real-lastlog-h.patch 6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch ded41235148930f8cf781538f7d63ecb0c65ea4e8ce792565f3649ee2523592a76b2a166785f0b145fc79f5852fd1fb1729a7a09110b3b8f85cba3912e790807 fgetspent_r.patch +7ed6c620a5ea5585c323936b1ff01eb7f01a1192240706a0d0470b661a7a03ea10ed17507c59678aaedce51b7a5ea839c2f528f19f12de02119bf4e47f7c3998 strftime-add-l-support.patch cce2f1eeb61e55674469c26871a573cce61d739c3defe9c8f56f2b774f6ba5435849ad542a6714120efddc98c297098e9c98a1a424ac593df2243d4aa479f9a9 ldconfig 378d70e65bcc65bb4e1415354cecfa54b0c1146dfb24474b69e418cdbf7ad730472cd09f6f103e1c99ba6c324c9560bccdf287f5889bbc3ef0bdf0e08da47413 getent.c 9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf iconv.c" diff --git a/system/musl/arm64-tls.patch b/system/musl/arm64-tls.patch new file mode 100644 index 000000000..4a6d7f7a4 --- /dev/null +++ b/system/musl/arm64-tls.patch @@ -0,0 +1,116 @@ +From 6104dae9088da7ffd9346671be867a43a4b03295 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy <nsz@port70.net> +Date: Thu, 16 May 2019 17:15:33 +0000 +Subject: fix static tls offsets of shared libs on TLS_ABOVE_TP targets + +tls_offset should always point to the end of the allocated static tls +area, but this was not handled correctly on "tls variant 1" targets +in the dynamic linker: + +after application tls was allocated, tls_offset was aligned up, +potentially wasting tls space. (alignment may be needed at the +begining of the tls area, not at the end, but that will be fixed +separately as it is unlikely to affect real binaries.) + +when static tls was allocated for a shared library, tls_offset was +only updated with the size of the tls segment which does not include +alignment gaps, which can easily happen if the tls size update for +one library leaves tls_offset misaligned for the next one. this can +cause oob access in __copy_tls or arbitrary breakage at tls access. +(the issue was observed on aarch64 with rust binaries) +--- + ldso/dynlink.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/ldso/dynlink.c b/ldso/dynlink.c +index ad0cdba2..967f1fd9 100644 +--- a/ldso/dynlink.c ++++ b/ldso/dynlink.c +@@ -1127,7 +1127,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) + #ifdef TLS_ABOVE_TP + p->tls.offset = tls_offset + ( (tls_align-1) & + -(tls_offset + (uintptr_t)p->tls.image) ); +- tls_offset += p->tls.size; ++ tls_offset = p->tls.offset + p->tls.size; + #else + tls_offset += p->tls.size + p->tls.align - 1; + tls_offset -= (tls_offset + (uintptr_t)p->tls.image) +@@ -1797,9 +1797,7 @@ _Noreturn void __dls3(size_t *sp) + #ifdef TLS_ABOVE_TP + 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) ); ++ tls_offset = app.tls.offset + app.tls.size; + #else + tls_offset = app.tls.offset = app.tls.size + + ( -((uintptr_t)app.tls.image + app.tls.size) +-- +cgit v1.2.1 + +From a60b9e06861e56c0810bae0249b421e1758d281a Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy <nsz@port70.net> +Date: Mon, 13 May 2019 18:47:11 +0000 +Subject: fix tls offsets when p_vaddr%p_align != 0 on TLS_ABOVE_TP targets + +currently the bfd linker does not seem to create tls segments where +p_vaddr%p_align != 0, but this is valid in ELF and then the runtime +computed tls offset must satisfy + + offset%p_align == (base+p_vaddr)%p_align + +and in case of local exec tls (main executable) the smallest such +offset must be used (otherwise it is incompatible with the offset +computed by the static linker). the !TLS_ABOVE_TP case is handled +correctly (the offset is negative then in the formula). + +the ldso code for TLS_ABOVE_TP is changed so the static tls offset +of each module satisfies the formula. +--- + ldso/dynlink.c | 7 ++++--- + src/env/__init_tls.c | 3 ++- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/ldso/dynlink.c b/ldso/dynlink.c +index 967f1fd9..1398ff45 100644 +--- a/ldso/dynlink.c ++++ b/ldso/dynlink.c +@@ -1125,8 +1125,8 @@ static struct dso *load_library(const char *name, struct dso *needed_by) + p->tls_id = ++tls_cnt; + tls_align = MAXP2(tls_align, p->tls.align); + #ifdef TLS_ABOVE_TP +- p->tls.offset = tls_offset + ( (tls_align-1) & +- -(tls_offset + (uintptr_t)p->tls.image) ); ++ p->tls.offset = tls_offset + ( (p->tls.align-1) & ++ (-tls_offset + (uintptr_t)p->tls.image) ); + tls_offset = p->tls.offset + p->tls.size; + #else + tls_offset += p->tls.size + p->tls.align - 1; +@@ -1796,7 +1796,8 @@ _Noreturn void __dls3(size_t *sp) + app.tls_id = tls_cnt = 1; + #ifdef TLS_ABOVE_TP + app.tls.offset = GAP_ABOVE_TP; +- app.tls.offset += -GAP_ABOVE_TP & (app.tls.align-1); ++ app.tls.offset += (-GAP_ABOVE_TP + (uintptr_t)app.tls.image) ++ & (app.tls.align-1); + tls_offset = app.tls.offset + app.tls.size; + #else + tls_offset = app.tls.offset = app.tls.size +diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c +index 5f12500c..772baba3 100644 +--- a/src/env/__init_tls.c ++++ b/src/env/__init_tls.c +@@ -115,7 +115,8 @@ static void static_init_tls(size_t *aux) + & (main_tls.align-1); + #ifdef TLS_ABOVE_TP + main_tls.offset = GAP_ABOVE_TP; +- main_tls.offset += -GAP_ABOVE_TP & (main_tls.align-1); ++ main_tls.offset += (-GAP_ABOVE_TP + (uintptr_t)main_tls.image) ++ & (main_tls.align-1); + #else + main_tls.offset = main_tls.size; + #endif +-- +cgit v1.2.1 + diff --git a/system/musl/strftime-add-l-support.patch b/system/musl/strftime-add-l-support.patch new file mode 100644 index 000000000..8305a9910 --- /dev/null +++ b/system/musl/strftime-add-l-support.patch @@ -0,0 +1,25 @@ +From 481def0e92ebfe81f40f416ddf345de15647e46b Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" <AWilcox@Wilcox-Tech.com> +Date: Fri, 31 May 2019 19:03:20 -0500 +Subject: [PATCH] strftime: add %l support + +--- + src/time/strftime.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/time/strftime.c b/src/time/strftime.c +index cc53d536..98caa1f6 100644 +--- a/src/time/strftime.c ++++ b/src/time/strftime.c +@@ -95,6 +95,8 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * + case 'H': + val = tm->tm_hour; + goto number; ++ case 'l': ++ def_pad = ' '; + case 'I': + val = tm->tm_hour; + if (!val) val = 12; +-- +2.21.0 + |