diff options
Diffstat (limited to 'system')
148 files changed, 8365 insertions, 2142 deletions
diff --git a/system/adelie-base/APKBUILD b/system/adelie-base/APKBUILD index 7d4440684..cc7d48397 100644 --- a/system/adelie-base/APKBUILD +++ b/system/adelie-base/APKBUILD @@ -1,8 +1,8 @@ # Contributor: A. Wilcox <awilfox@adelielinux.org> # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=adelie-base -pkgver=0.9.5 -pkgrel=1 +pkgver=0.9.7 +pkgrel=0 pkgdesc="The Adélie Linux Base System" url="https://www.adelielinux.org/" arch="noarch" @@ -13,8 +13,8 @@ _core_depends="apk-tools adelie-keys musl-utils shadow coreutils diffutils findutils util-linux net-tools nvi sed psmisc less tzdata" -depends="adelie-core binutils debianutils file gettys-openrc - kbd libarchive-tools mandoc patch sed sharutils sysklogd zsh" +depends="adelie-core binutils curl debianutils file gettys-openrc + kbd libarchive-tools mandoc patch sysklogd utmps zsh" makedepends="" makedepends_host="$depends" subpackages="adelie-core:core $pkgname-doc $pkgname-posix $pkgname-lsb dev @@ -47,22 +47,20 @@ package() { echo '' > "$pkgdir"/etc/shells # stupid inflatable stupid busybox - local i - for i in adduser addgroup; do - install -m755 "$srcdir"/$i "$pkgdir"/usr/sbin/$i + for _cmd in adduser addgroup; do + install -m755 "$srcdir"/$_cmd "$pkgdir"/usr/sbin/$_cmd done } core() { - core="The Adélie Linux minimal runtime environment" depends=$_core_depends + pkgdesc="The Adélie Linux minimal runtime environment" replaces="adelie-base" mkdir -p "$subpkgdir" mv -i "$pkgdir"/* "$subpkgdir"/ } doc() { - local _doc DOCS DOCS="CONTRIBUTING.rst LICENSE README.rst" for _doc in $DOCS; do install -Dm644 "$srcdir"/$pkgname-$pkgver/$_doc \ @@ -73,15 +71,15 @@ doc() { posix() { # We pull in vim for /usr/bin/ex, until apk has an alternatives system depends="adelie-base at bc cflow cxref ed fcron heirloom-devtools - heirloom-pax mailx mawk uucp utmps vim" + heirloom-pax mailx mawk sharutils uucp vim" pkgdesc="$pkgdesc - Additional POSIX tools" mkdir -p "$subpkgdir" return 0 } lsb() { - depends="adelie-base gettext-tiny gzip libarchive-tools linux-pam make - mawk ncurses nspr nss" + depends="adelie-base-posix gettext-tiny gzip libarchive-tools linux-pam + make ncurses nspr nss" pkgdesc="$pkgdesc - Additional LSB tools" mkdir -p "$subpkgdir" return 0 @@ -115,7 +113,7 @@ symbols() { return 0 } -sha512sums="0fbf49174e0740bbbcb8ff29b560a65987305ab17ea70b1ecb7f0fddd8c9963d23272950d7e729afd3afc45426faa40896aa1c9e8703f7b79532b2cd7039a0c5 adelie-base-0.9.5.tar.xz +sha512sums="897a4733c49bbb460ac815a95d812bc22f6d603ffebb4a5f4405be404cd526637191116e614d51377a1c2b322b44ac95c865cb1cfff6ec9d88c76eb6b5601888 adelie-base-0.9.7.tar.xz 37260d9315fd8d8b0df3dfb5bd3e1035a47ba1e43f33aa195e3feca6d169da282c1b067ef4603e7e9acaedbfef8b58cf490c00bdca444d43c9d570355ad29eac group 33aca5423feadd02cce1ac5598ab26ce4f10f2e0d955d953c5ec12b61e605d92b25c2449aec224923bf8affb4fa918458ab67e4292a29c357ad15b74ebc68183 passwd f2437ebfbc83aa6eaeec3a111aae98751215cebfaec3991ccc511be8c8938778ae46f15e07c7306bd431d036bc4ba49b33b724b839c125bd882d2e93c0314ae8 addgroup diff --git a/system/apk-tools/APKBUILD b/system/apk-tools/APKBUILD index d664340e0..8bda1131c 100644 --- a/system/apk-tools/APKBUILD +++ b/system/apk-tools/APKBUILD @@ -1,23 +1,23 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org> pkgname=apk-tools -pkgver=2.12.0 +pkgver=2.14.0 pkgrel=0 pkgdesc="Alpine Package Keeper - package manager" url="https://git.adelielinux.org/adelie/apk-tools" arch="all" license="GPL-2.0-only" depends="ca-certificates" -makedepends_build="" +makedepends_build="scdoc" makedepends_host="zlib-dev openssl openssl-dev linux-headers" makedepends="$makedepends_build $makedepends_host" subpackages="$pkgname-dev $pkgname-static $pkgname-doc" -source="https://dev.sick.bike/dist/$pkgname-v$pkgver+adelie.tar.gz - https://dev.sick.bike/dist/$pkgname-help-v$pkgver.tar.gz +source="https://git.adelielinux.org/adelie/apk-tools/-/archive/v${pkgver}+adelie1/${pkgname}-v${pkgver}+adelie1.tar.bz2 + https://git.adelielinux.org/adelie/apk-tools/uploads/58cb5e01b6ac8218ba738df0e0bedc7c/apk-tools-docs-v2.14.0.tar.xz apk.zsh-completion s6-linux-init.patch " -builddir="$srcdir/$pkgname-v$pkgver" +builddir="$srcdir/$pkgname-v$pkgver+adelie1" prepare() { default_prepare @@ -27,6 +27,7 @@ prepare() { LUA=no export LUA EOF + rm "$builddir"/doc/apk-add.8 } build() { @@ -71,7 +72,7 @@ static() { "$subpkgdir"/sbin/apk.static } -sha512sums="739cbf487a9184aba56c87448d18acebf357b6eddb4852033cc0cd331fc910d425a5d01f7b0bf109f5cd62f78f10cca96ebcbdb4fa00d197edb90726998e1523 apk-tools-v2.12.0+adelie.tar.gz -b8e6e6e9efe2fc3a900e5fea54ed2f047bbf8917c8c3e470e001865c2169167ce6a273869ba577aceb1a1580b7dd684de115a4d92250786958fa13b9e8abf28b apk-tools-help-v2.12.0.tar.gz +sha512sums="e71fd14655cd5907ea7046d64a877cf5128d062a7e7ca82dd5d1c254bf3ca59443c5643571734c9f558301fe0ffd16956bb89b680c5101b653eaaf64259d2959 apk-tools-v2.14.0+adelie1.tar.bz2 +c59bdd7fe77bd2cf565a1c050100bebd90da80b9d46b706237c6e5d2a3f5bf3f5a23a69940074b842c8e9f49e788d3c27492b952e52ef881bd1c22e1046a0743 apk-tools-docs-v2.14.0.tar.xz cedda9bf11e0a516c9bf0fd1a239ffa345cdd236419cbd8b10273410610ae7d0f0f61fd36e1e9ccc3bbf32f895508cdca4fb57a0e04f78dd88469b33bf64a32a apk.zsh-completion f92e2e0c062b71e1e5cf95f0d4997166ccc7f7a5e45af8d1650f5951a1d552d89217c8c60d24f31fa626e8e0675c5e882e6b36ef1af8f7624e54627b22801381 s6-linux-init.patch" diff --git a/system/argon2/APKBUILD b/system/argon2/APKBUILD index c7a1bd6c2..14427ad12 100644 --- a/system/argon2/APKBUILD +++ b/system/argon2/APKBUILD @@ -4,7 +4,7 @@ pkgname=argon2 _pkgname=phc-winner-argon2 pkgver=20190702 -pkgrel=1 +pkgrel=2 pkgdesc="Password hashing library" url="https://github.com/P-H-C/phc-winner-argon2" arch="all" @@ -18,17 +18,17 @@ builddir="$srcdir/$_pkgname-$pkgver" build() { # musl >= 1.1.20 has explicit_bzero for better security export CFLAGS="$CFLAGS -DHAVE_EXPLICIT_BZERO=1" - make OPTTARGET=none + make OPTTARGET=none ARGON2_VERSION=$pkgver } check() { - make OPTTARGET=none test + make OPTTARGET=none ARGON2_VERSION=$pkgver test } package() { # pkgconfig file has it in /usr/lib... sed -i 's#libdir=${prefix}/lib#libdir=/lib#' "$builddir"/libargon2.pc - make OPTTARGET=none DESTDIR="$pkgdir" LIBRARY_REL=lib install + make OPTTARGET=none ARGON2_VERSION=$pkgver DESTDIR="$pkgdir" LIBRARY_REL=lib install # ...but cryptsetup needs this in /lib for early-boot mkdir "$pkgdir"/lib mv "$pkgdir"/usr/lib/lib* "$pkgdir"/lib diff --git a/system/bash/APKBUILD b/system/bash/APKBUILD index a7df29ff5..dfb3adab8 100644 --- a/system/bash/APKBUILD +++ b/system/bash/APKBUILD @@ -52,6 +52,10 @@ prepare() { done default_prepare + + # `abuild` pc: auto-provider cannot handle "-release" string in .pc + # See also: adelie/packages#1131 + sed -i "s/@PACKAGE_VERSION@/$pkgver/" "$builddir"/support/bash.pc.in } build() { diff --git a/system/binutils/APKBUILD b/system/binutils/APKBUILD index 0ba167363..06f7c4cb6 100644 --- a/system/binutils/APKBUILD +++ b/system/binutils/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org> pkgname=binutils -pkgver=2.41 +pkgver=2.42 pkgrel=0 pkgdesc="Tools necessary to build programs" url="https://www.gnu.org/software/binutils/" @@ -13,6 +13,7 @@ makedepends="$makedepends_build $makedepends_host" checkdepends="dejagnu" subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs" source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz + ar-deterministic-tests.patch binutils-ld-fix-static-linking.patch disable-ifunc-tests.patch disable-mbind2b.patch @@ -20,20 +21,17 @@ source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz disable-preinit-array-tests.patch disable-relr-glibc-tests.patch disable-sframe-tests.patch - disable-textrel-test.patch - fix-pr28158-test.patch + libctf-32bit-test.patch musl-preinit-array.patch musl-versioned-syms.patch - ppc32-pic-required.patch - ppc64-abiv2-addr2line.patch pr25749-test-size.patch remove-pr2404-tests.patch remove-pr19719-test.patch remove-pr19553c-test.patch - skip-thumb-plt-musl.patch - vers-tests-eabi.patch visibility-musl.patch vsb-hammer.patch + x86_64-mark-plt.patch + x86_64-missing-test.patch BTS-170.patch BTS-196.patch fix-deprecated-egrep-usage.patch @@ -144,28 +142,26 @@ libs() { mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ } -sha512sums="5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374 binutils-2.41.tar.xz -ced667e95bfec8909e20802cd3d734b0b179bfc9d995dd68827a471ab9a4fdc38397f3d947dcae1bf2368a73480be3f18d4ec6b757ac7fdb9ee358693cc0670f binutils-ld-fix-static-linking.patch -ae54a3728b6e674febf130979a434f525b77f93103eef9c023647a68eaf5b607dfe264ab553d2132f46e93956959d1adf71bbd176e80a42a33329e62f6f55c3e disable-ifunc-tests.patch -de3f50afe2b0962d1f52f154871285e9c6d7b5599b745365a8f14fd237c7b1d6a066d0d081ce67ad1317b37bae2875f27adfea52f3853d7e30003e74a84075c2 disable-mbind2b.patch -cbbb9d62f53b1f93bb7d5728e0fe7ef0ebb18f388bc228b396e4df8ce5dd1079e0d7ca0afb2928f6f1beba30475e7f68fe345daffab3cb3ef607ca5bdd87915d disable-pr26580-test.patch -4c8098df5c01579d1c53c0344bf5e0f1c3b11bc119da077d83e87f7d103ed958e78083f94e71b12521c5f0cb83b3dda509efadc4124bcc28b436b39245ab4603 disable-preinit-array-tests.patch -b2d5da2705366f5919d3f8310225620493b88406b6e909ddf9bd8c9ef50f13757816ff2947eb33c1832048fd1d42c3a2593c909ee35f2fdc947f8e2df5500c7b disable-relr-glibc-tests.patch +sha512sums="155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6 binutils-2.42.tar.xz +07a9a47c5955a1911cab5387134cfacfff82f5521066bb61f671c7e0d07ce64c31c4162a57234604b470d24f27093cb23202ad05bebc34479957c6fe64dbc8fb ar-deterministic-tests.patch +3736ea519eab417bc05f9851954e644a4d1b44f4641fb5685ff2238bd2da775f20611edfdcd3a72eb1f2a31ba2a98e3fd97fe9d57714b7d9846553eb881a3435 binutils-ld-fix-static-linking.patch +5eef9c29066f906fc133736efdfb9c94a897f08650bb741dc0ea8b5614563166d2afa9018c045569c853ae7cabe08ef5ec3539eb7b53df55b39b8c659a8c8b72 disable-ifunc-tests.patch +b9f5c09aec2e6423f31fae48a26b8138f65569e63f28dc2190cb73abc2493832cc33362443ec0f24e7833bf2eb0f14ce78045d82fd8ebb4097eafd1f1a34a3fe disable-mbind2b.patch +086f97e52c536e68b082716d054d32be50b0947cab9c62d87b1959efbf8f99423b6dc52f79da4a6dedc588a577132cb062a071928cd2b85449a107b89c3771de disable-pr26580-test.patch +6568983766b0b9e947c21fc12f29d41b79a2a0c0c162e0d2c00120713da76bec7b6369333dbdca9d53dd0c81e2cd438c20e30076893742bfb8e14dbc89301c57 disable-preinit-array-tests.patch +4b0089f72c676fadbbcffbd87d2715ca010a4a87392d677b0887b86ce5c2ba446fb45e079bcd4492c47d1479b91b4a2c5b2466746166081e04f4b24191239625 disable-relr-glibc-tests.patch e8ebb984e9b13b75114c8092d1ad2d0c1b3bb59bf10e66ca250151e79844125a23f74b8c4142210c8e574785c35e0ee1df0499e0cfd6ef59e8e80d58121963e1 disable-sframe-tests.patch -8213bc7e965b7c93e24c755e3ca47c522e3ba0d8504ec1def58fad398dd215158740164276ec8a0b48f2058c7025b5b8b6b2e16e646baf4f7dc1841d4fc5a504 disable-textrel-test.patch -2972b86e1741866db244cd262469eaef244fc3fb0d569b58cb1ad427d31b3ffc9ccbde904e7bd78f10367a5bfe8ec7f4076253abe03edbabbb0e5894ccc20487 fix-pr28158-test.patch -8ef144efc8c0cc71b48d7ed9444fa70906c9a4894058588e3f49c1826975675ab8091681912a15ecbed6772aa5bba31935c92abef0095548fc8a9ecaa5d26526 musl-preinit-array.patch -ab4d03394073bb6dbd4a046637e9bf57f8b4dad163c551b0d9bb2202025b243161149c8622c2fae072c43082bbf19e15b667483831a58a5d1bc93b464763cdcc musl-versioned-syms.patch -7b5ee15c9e5a3567cb000a4ac07699f9d0f11354cf5ee20fd375e483945fd45d0e1551f3f28bdb8ebb49355b3180cc90977e81ae0c3c210cdc689add504952a7 ppc32-pic-required.patch -5456d4d6c1097f41e5c02d92ed83acf608eb05d912cf4d289e8f772e8eded9af2030c518b7a89133ef3905d084fc5354ec140e472c22fe11c6802c1e9a4237e7 ppc64-abiv2-addr2line.patch +4948b963906a72075873f2988289294f6c1eb60297ac2bdee5d8646ad8a23f8f16d98b3e4f048fb625d347be28028a87247241a8dca030b4847450951b7aca32 libctf-32bit-test.patch +1f22d31b4bc1ed96d9aa1fc49c4328c6516cbb196c0d86db3f68665b948a4950911bb23d53c6f3b82703cddf9380f706355177842f12aa7fc11dd0124feadd3e musl-preinit-array.patch +ad38c37ae67f60cf3091bf5012dbdaba0982a3e4eac5f3be400d989fb3f7400a4be2db0b8658357ec1e8be71eaddf012e9608ae8540f28fe9fa3af3d87e90fa3 musl-versioned-syms.patch c76733b76daf5d4af17464777cb753c68063fdc6040d943962c78182ca65f46a2744d4437f6cc3b8ff5f09ff8c0f582690b7dc89eaaf4da48f9300a81b8b3803 pr25749-test-size.patch -b97aa6fd5a0b5b71dadd7d9925a0642681ce96bb98348a01c5778e4e6570bd2e135ff0252dec6568e19df329fb1a36bcf495d332c0207573fe2e6e5842283d27 remove-pr2404-tests.patch -ac8d30f5af82653242355d7bb0835823ea474bc6d349df4a2e6db91d90f8f80ccab1ff4ede6734af76e79da2e083a1a90cb9ae0631e3d62d89bc5f5a57c24c92 remove-pr19719-test.patch +c54fa146dd6838c7b55441943b2ca0e344d851615574a46464e253d3f4a9ef3594ef9cf2bc69b584032a8206bf891d0aae62fb38b32873dc60c9d51874ead2ae remove-pr2404-tests.patch +b4bd7b5d2ad3705c7db0924c73bd91d5f8ef07e73f146c250af7d794387ab219b02254b1b61060a524f2c27c04e14a401e4ce7ed50367f424f8c03874318c2c1 remove-pr19719-test.patch 06f9df891a4ae0e9f6f8b3282d3691ede7cc0f08d63bf722f942f3c94dd4d7f3907b7bb5a8087e63639569e61aed6c39b5f5da7ad6566e7ef278524aa32ada63 remove-pr19553c-test.patch -bdfc92cdd6c31a68e09daf71e3c45900158f8222832bda14cb2f12d9d693e6f19fe00dd29a7af9850bf0a19afe6ef421a690195f1a4e96d3cc76370f1e3bd399 skip-thumb-plt-musl.patch -52f250970ba6814a7a992f6ad4a7c8bfbc9b5f0a0c422c920edf8b6c3dfbc353d13be940483bbbce1bfc543572c2abb06015df61a68a640774b827810d0dde6b vers-tests-eabi.patch 075565f9bc85c0fc4bd36c7a848f6b876b71fbbe0f572b5c21961687ab4e2cd00c784fba09fe92b214c4b1df871ebd6409e6c93dde5a0a6c1ef6e41a30b24520 visibility-musl.patch 55bdb08f93563449b170ba8623cd7d4409c8f22abb15fca23bc87f23cc43cd580fa149e68271e65fdf2c29ddb0a15cd78d6f0de1a50332fdc026ea1b7d0ec7b8 vsb-hammer.patch +fcd71dc0e664bce0d1066b6adec9b8eebb85eb589061ad7e88934dbda4d5f8849ff6db97299a8026840515e44a73de5e131e3209052be45e807706e79ef8a045 x86_64-mark-plt.patch +f524acb49e7ce14133a11b237858aaadc84f4c3290b6e59335ec293fc6cc0e65c9bdd47c2b68bf75bb3a39ebe2e61df4f7bf941acec69d79968aa68915ade4d5 x86_64-missing-test.patch c62365110dd0a550e55f1445b197f1f968849b1079439cda0d44778772964779b4ab1142ccc662ba75ebb040e09ef4b4bfc253f4632db24ed783155be2f5f3b1 BTS-170.patch ab7d0c1fa74862bf9364d5e2228200054a2c5c4351c979dc7a9850f630d74034edffba740b468e009c5419a3cec110322364303f8af28dcdbfbe672c3c16f450 BTS-196.patch 95f2063ecb902148e53603211452ca21d4dec215c32a07c2eebc5881dbdc7cba34a7a49177fedf4db1d7d8542708af673a31930fd7d49a6a2eb00b47dbe6eeb9 fix-deprecated-egrep-usage.patch" diff --git a/system/binutils/ar-deterministic-tests.patch b/system/binutils/ar-deterministic-tests.patch new file mode 100644 index 000000000..f3f63b937 --- /dev/null +++ b/system/binutils/ar-deterministic-tests.patch @@ -0,0 +1,67 @@ +From: Stephen Kitt <steve@sk2.org> +Date: Mon, 11 Mar 2024 07:21:47 +0000 (+0100) +Subject: tests: force non-deterministic mode in non-deterministic tests +X-Git-Tag: gdb-15-branchpoint~761 +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=64e215c15bc316f673161c76db93a50bda45666a;hp=5790996072837620a8fd3756dda5138eb2f2781b + +tests: force non-deterministic mode in non-deterministic tests + +Since ar can be built defaulting to deterministic mode, tests which +expect non-deterministic behaviour need to explicitly set the U flag. + +The non-deterministic member test expects SOURCE_DATE_EPOCH to not be +set; this documents that. Unconditionally unsetting the variable +causes issues in test infrastructure (which expects unsetenv to only +be called on variables which are already set). + +Signed-off-by: Stephen Kitt <steve@sk2.org> +--- + +diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp +index d4e4f64b42e..998cbe1f0a9 100644 +--- a/binutils/testsuite/binutils-all/ar.exp ++++ b/binutils/testsuite/binutils-all/ar.exp +@@ -538,6 +538,7 @@ proc replacing_deterministic_member { } { + } + + # Test replacing a member of a non-deterministic archive. ++# This test expects SOURCE_DATE_EPOCH to not be set in the environment. + + proc replacing_non_deterministic_member { } { + global AR +@@ -581,7 +582,7 @@ proc replacing_non_deterministic_member { } { + + # Build the archive with the *newer* object file. + +- set got [binutils_run $AR "rc $archive ${newer_objfile}"] ++ set got [binutils_run $AR "rcU $archive ${newer_objfile}"] + if ![string match "" $got] { + fail "$testname: (could not build archive)" + return +@@ -589,7 +590,7 @@ proc replacing_non_deterministic_member { } { + + # Now try to replace the newer file with the older one. This should not work. + +- set got [binutils_run $AR "ru $archive $older_objfile"] ++ set got [binutils_run $AR "ruU $archive $older_objfile"] + if ![string match "" $got] { + fail "$testname: (failed to replace file)" + return +@@ -651,7 +652,7 @@ proc replacing_sde_deterministic_member { } { + # Build the archive with the *newer* object file. + setenv SOURCE_DATE_EPOCH "1000" + +- set got [binutils_run $AR "rc $archive ${newer_objfile}"] ++ set got [binutils_run $AR "rcU $archive ${newer_objfile}"] + if ![string match "" $got] { + fail "$testname: (could not build archive)" + unsetenv SOURCE_DATE_EPOCH +@@ -662,7 +663,7 @@ proc replacing_sde_deterministic_member { } { + # archive this will not work, but one created to be deterministic + # should always replace its members. + +- set got [binutils_run $AR "ru $archive $older_objfile"] ++ set got [binutils_run $AR "ruU $archive $older_objfile"] + if ![string match "" $got] { + fail "$testname: (failed to replace file)" + unsetenv SOURCE_DATE_EPOCH diff --git a/system/binutils/binutils-ld-fix-static-linking.patch b/system/binutils/binutils-ld-fix-static-linking.patch index fb79e3213..d1bbe41a4 100644 --- a/system/binutils/binutils-ld-fix-static-linking.patch +++ b/system/binutils/binutils-ld-fix-static-linking.patch @@ -3,7 +3,7 @@ diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index e8126cb..9532bfb 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc -@@ -257,8 +257,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" +@@ -269,8 +269,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))" @@ -14,7 +14,7 @@ index e8126cb..9532bfb 100644 else SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))" SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))" -@@ -298,15 +298,14 @@ CTOR=".ctors ${CONSTRUCTING-0} : +@@ -310,15 +310,14 @@ CTOR=".ctors ${CONSTRUCTING-0} : doesn't matter which directory crtbegin.o is in. */ @@ -32,7 +32,7 @@ index e8126cb..9532bfb 100644 KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} -@@ -314,9 +313,8 @@ CTOR=".ctors ${CONSTRUCTING-0} : +@@ -326,9 +325,8 @@ CTOR=".ctors ${CONSTRUCTING-0} : DTOR=".dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} diff --git a/system/binutils/disable-ifunc-tests.patch b/system/binutils/disable-ifunc-tests.patch index 39b35d319..9f21a03fc 100644 --- a/system/binutils/disable-ifunc-tests.patch +++ b/system/binutils/disable-ifunc-tests.patch @@ -1,6 +1,6 @@ --- binutils-2.31.1/ld/testsuite/ld-ifunc/ifunc.exp.old 2018-06-27 07:55:16.000000000 +0000 +++ binutils-2.31.1/ld/testsuite/ld-ifunc/ifunc.exp 2018-10-12 03:23:09.240000000 +0000 -@@ -43,7 +43,8 @@ +@@ -44,7 +44,8 @@ || [istarget sh*-*-*] || [istarget tic6x-*-*] || [istarget tile*-*-*] diff --git a/system/binutils/disable-mbind2b.patch b/system/binutils/disable-mbind2b.patch index 6065ba0cf..dee8690f1 100644 --- a/system/binutils/disable-mbind2b.patch +++ b/system/binutils/disable-mbind2b.patch @@ -2,7 +2,7 @@ XXX working upstream with musl, trying to push to other arches for testing --- binutils-2.41/ld/testsuite/ld-elf/elf.exp.old 2023-09-22 22:22:00.860304785 -0500 +++ binutils-2.41/ld/testsuite/ld-elf/elf.exp 2023-09-22 23:43:12.163396014 -0500 -@@ -490,15 +490,6 @@ +@@ -493,15 +493,6 @@ "pass.out" \ "-O2 -I../bfd" \ ] \ diff --git a/system/binutils/disable-pr26580-test.patch b/system/binutils/disable-pr26580-test.patch index 768a7c0c0..681b8ec0c 100644 --- a/system/binutils/disable-pr26580-test.patch +++ b/system/binutils/disable-pr26580-test.patch @@ -7,7 +7,7 @@ Not reported upstream. --- binutils-2.41/ld/testsuite/ld-elf/shared.exp.old 2023-09-30 00:31:20.814410396 -0500 +++ binutils-2.41/ld/testsuite/ld-elf/shared.exp 2023-09-30 01:23:23.564443008 -0500 -@@ -1121,10 +1121,6 @@ +@@ -1157,10 +1157,6 @@ "" "" \ {pr26580-a.c} "pr26580-3" "pr26580-3.out" "-fcommon" "c" "" \ "-Wl,--as-needed tmpdir/libpr26580-2.so" ] \ diff --git a/system/binutils/disable-preinit-array-tests.patch b/system/binutils/disable-preinit-array-tests.patch index 4338fd5ec..5693d4bbd 100644 --- a/system/binutils/disable-preinit-array-tests.patch +++ b/system/binutils/disable-preinit-array-tests.patch @@ -1,6 +1,6 @@ --- binutils-2.29/ld/testsuite/ld-elf/elf.exp.old 2017-07-04 08:43:21.000000000 +0000 +++ binutils-2.29/ld/testsuite/ld-elf/elf.exp 2017-08-19 04:46:32.214460537 +0000 -@@ -391,8 +391,6 @@ +@@ -392,8 +392,6 @@ } set array_tests { @@ -9,7 +9,7 @@ {"init array" "" "" {init.c} "init" "init.out"} {"fini array" "" "" -@@ -401,8 +399,6 @@ +@@ -402,8 +400,6 @@ {init-mixed.c} "init-mixed" "init-mixed.out" "-I."} } set array_tests_pie { @@ -18,7 +18,7 @@ {"PIE init array" "-pie" "" {init.c} "init" "init.out" "-fPIE"} {"PIE fini array" "-pie" "" -@@ -413,8 +409,6 @@ +@@ -414,8 +410,6 @@ {pr14525.c} "pr14525" "pr14525.out" "-fPIE"} } set array_tests_static { diff --git a/system/binutils/disable-relr-glibc-tests.patch b/system/binutils/disable-relr-glibc-tests.patch index afefe593a..1edf30acb 100644 --- a/system/binutils/disable-relr-glibc-tests.patch +++ b/system/binutils/disable-relr-glibc-tests.patch @@ -6,7 +6,7 @@ Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30917 --- binutils-2.41/ld/testsuite/ld-elf/dt-relr.exp.old 2023-07-02 18:00:00.000000000 -0500 +++ binutils-2.41/ld/testsuite/ld-elf/dt-relr.exp 2023-09-22 20:28:27.455427142 -0500 -@@ -23,6 +23,10 @@ +@@ -27,6 +27,10 @@ return } diff --git a/system/binutils/disable-textrel-test.patch b/system/binutils/disable-textrel-test.patch deleted file mode 100644 index f01921996..000000000 --- a/system/binutils/disable-textrel-test.patch +++ /dev/null @@ -1,43 +0,0 @@ -musl doesn't support TEXTRELs, so the pr22001-1 test will always segfault. - -Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30925 - ---- binutils-2.41/ld/testsuite/ld-i386/i386.exp.old 2023-07-02 23:00:00.000000000 +0000 -+++ binutils-2.41/ld/testsuite/ld-i386/i386.exp 2023-09-30 12:34:46.594675721 +0000 -@@ -1318,6 +1318,20 @@ - ] \ - ] - -+ if { ![istarget i?86-*-musl] } { -+ run_ld_link_exec_tests [list \ -+ [list \ -+ "Run pr22001-1" \ -+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \ -+ "-Wa,-mx86-used-note=yes" \ -+ { pr22001-1b.c } \ -+ "pr22001-1" \ -+ "pass.out" \ -+ "$NOPIE_CFLAGS" \ -+ ] \ -+ ] -+ } -+ - run_ld_link_exec_tests [list \ - [list \ - "Run weakundef1 without PIE" \ -@@ -1328,15 +1342,6 @@ - "pass.out" \ - "$NOPIE_CFLAGS" \ - ] \ -- [list \ -- "Run pr22001-1" \ -- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \ -- "-Wa,-mx86-used-note=yes" \ -- { pr22001-1b.c } \ -- "pr22001-1" \ -- "pass.out" \ -- "$NOPIE_CFLAGS" \ -- ] \ - [list \ - "Run pr22001-1 (PIE 1)" \ - "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ diff --git a/system/binutils/fix-pr28158-test.patch b/system/binutils/fix-pr28158-test.patch deleted file mode 100644 index 2fade9593..000000000 --- a/system/binutils/fix-pr28158-test.patch +++ /dev/null @@ -1,30 +0,0 @@ -Upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=30905 - -From 221e4f9b4ac4e6d4e362fdadf7f86a8b0df94d47 Mon Sep 17 00:00:00 2001 -From: "A. Wilcox" <AWilcox@Wilcox-Tech.com> -Date: Tue, 26 Sep 2023 00:26:06 -0500 -Subject: [PATCH] elf: Adjust PR ld/28158 tests - -PR ld/28158 - * testsuite/ld-elf/pr28158.rd: ensure symbol indexes containing - the number 0 match in regex - -Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com> ---- - ld/testsuite/ld-elf/pr28158.rd | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ld/testsuite/ld-elf/pr28158.rd b/ld/testsuite/ld-elf/pr28158.rd -index b3cfe8915cb..c2cef7a0b39 100644 ---- a/ld/testsuite/ld-elf/pr28158.rd -+++ b/ld/testsuite/ld-elf/pr28158.rd -@@ -3,5 +3,5 @@ - #target: x86_64-*-linux* i?86-*-linux-gnu - - #... -- +[0-9]+: +[0-9a-f]+ +[0-9]+ +OBJECT +GLOBAL +DEFAULT +[1-9]+ foo@VERS_2.0 \([0-9]+\) -+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ foo@VERS_2.0 \([0-9]+\) - #pass --- -2.39.2 (Apple Git-143) - diff --git a/system/binutils/libctf-32bit-test.patch b/system/binutils/libctf-32bit-test.patch new file mode 100644 index 000000000..788c46259 --- /dev/null +++ b/system/binutils/libctf-32bit-test.patch @@ -0,0 +1,27 @@ +We need to use the proper format specifiers. + +Upstream-Status: Pending +Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=31882 + +--- binutils-2.41/libctf/testsuite/libctf-lookup/struct-iteration.c.old 2023-07-02 18:00:00.000000000 -0500 ++++ binutils-2.41/libctf/testsuite/libctf-lookup/struct-iteration.c 2024-06-11 16:22:32.976649333 -0500 +@@ -53,7 +53,7 @@ + { + char *type_name = ctf_type_aname (fp, membtype); + +- printf ("next test: %s, offset %lx, has type %lx/%s\n", ++ printf ("next test: %s, offset %zi, has type %lx/%s\n", + name, offset, membtype, type_name); + free (type_name); + } +--- binutils-2.41/libctf/testsuite/libctf-lookup/unnamed-field-info.c.old 2023-07-02 18:00:00.000000000 -0500 ++++ binutils-2.41/libctf/testsuite/libctf-lookup/unnamed-field-info.c 2024-06-11 16:23:19.191708550 -0500 +@@ -16,7 +16,7 @@ + goto err; + + if (mi.ctm_offset != offset * 8) +- fprintf (stderr, "field %s inconsistency: offsetof() says %zi bits, CTF says %zi\n", ++ fprintf (stderr, "field %s inconsistency: offsetof() says %zi bits, CTF says %li\n", + name, offset * 8, mi.ctm_offset); + + return; diff --git a/system/binutils/musl-preinit-array.patch b/system/binutils/musl-preinit-array.patch index 9932f3c7f..f06084658 100644 --- a/system/binutils/musl-preinit-array.patch +++ b/system/binutils/musl-preinit-array.patch @@ -2,7 +2,7 @@ musl libc currently does not run .preinit_array functions. --- binutils-2.41/ld/testsuite/ld-elf/elf.exp.old 2023-09-22 20:55:13.894385414 -0500 +++ binutils-2.41/ld/testsuite/ld-elf/elf.exp 2023-09-22 21:31:13.354594152 -0500 -@@ -427,17 +427,21 @@ +@@ -428,17 +428,21 @@ run_ld_link_exec_tests $array_tests_pie $xfails if { $STATIC_PIE_LDFLAGS != "" } then { diff --git a/system/binutils/musl-versioned-syms.patch b/system/binutils/musl-versioned-syms.patch index 3812947c3..ce7c9fb7d 100644 --- a/system/binutils/musl-versioned-syms.patch +++ b/system/binutils/musl-versioned-syms.patch @@ -2,7 +2,7 @@ This test will not work on musl which does not support symbol versioning. --- binutils-2.41/ld/testsuite/ld-elfvers/vers.exp.old 2023-07-02 18:00:00.000000000 -0500 +++ binutils-2.41/ld/testsuite/ld-elfvers/vers.exp 2023-09-22 22:20:51.407688782 -0500 -@@ -888,8 +888,12 @@ +@@ -890,8 +890,12 @@ # Test that when we override a versioned symbol from the library this # symbol appears in the dynamic symbol table of the executable. # diff --git a/system/binutils/ppc32-pic-required.patch b/system/binutils/ppc32-pic-required.patch deleted file mode 100644 index c9395d945..000000000 --- a/system/binutils/ppc32-pic-required.patch +++ /dev/null @@ -1,23 +0,0 @@ -On the 32-bit PowerPC target, musl does not support shared libraries without -PIC, because secure-PLT is required. - -Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30918 - ---- binutils-2.41/ld/testsuite/ld-shared/shared.exp.old 2023-07-02 23:00:00.000000000 +0000 -+++ binutils-2.41/ld/testsuite/ld-shared/shared.exp 2023-09-24 08:44:39.404937347 +0000 -@@ -226,6 +226,7 @@ - setup_xfail "*-*-solaris2*" - setup_xfail "ia64-*-linux*" - setup_xfail "alpha*-*-linux*" -+ setup_xfail "powerpc-*-linux-musl" - setup_xfail "powerpc64*-*-*" - if { ![istarget hppa*64*-*-linux*] } { - setup_xfail "hppa*-*-linux*" -@@ -307,6 +308,7 @@ - setup_xfail "*-*-solaris2*" - setup_xfail "ia64-*-linux*" - setup_xfail "alpha*-*-linux*" -+ setup_xfail "powerpc-*-linux-musl" - setup_xfail "powerpc64*-*-*" - if { ![istarget hppa*64*-*-linux*] } { - setup_xfail "hppa*-*-linux*" diff --git a/system/binutils/ppc64-abiv2-addr2line.patch b/system/binutils/ppc64-abiv2-addr2line.patch deleted file mode 100644 index e3cb4d73d..000000000 --- a/system/binutils/ppc64-abiv2-addr2line.patch +++ /dev/null @@ -1,15 +0,0 @@ -musl libc uses the same ELFv2 ABI on both endians of PowerPC64. - -Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30916 - ---- binutils-2.41/binutils/testsuite/binutils-all/addr2line.exp.old 2023-07-02 18:00:00.000000000 -0500 -+++ binutils-2.41/binutils/testsuite/binutils-all/addr2line.exp 2023-09-22 20:44:37.242158767 -0500 -@@ -20,7 +20,7 @@ - set exe [exeext] - - # powerpc64 function symbols are on descriptors rather than code. --if [istarget powerpc64-*-*] { -+if { [istarget powerpc64-*-*] && ![istarget powerpc64-*-musl] } { - set opts --synthetic - set dot {\.} - } diff --git a/system/binutils/remove-pr19719-test.patch b/system/binutils/remove-pr19719-test.patch index 09786fee6..24f44479b 100644 --- a/system/binutils/remove-pr19719-test.patch +++ b/system/binutils/remove-pr19719-test.patch @@ -1,7 +1,7 @@ We always use -fPIE (it's in our spec file), so it isn't possible to test this. --- binutils-2.30/ld/testsuite/ld-elf/shared.exp.old 2018-05-25 06:28:07.252414401 +0000 +++ binutils-2.30/ld/testsuite/ld-elf/shared.exp 2018-05-25 06:51:50.637028357 +0000 -@@ -1657,5 +1657,4 @@ +@@ -1593,5 +1593,4 @@ } } diff --git a/system/binutils/remove-pr2404-tests.patch b/system/binutils/remove-pr2404-tests.patch index 8dd7db65d..94ea63996 100644 --- a/system/binutils/remove-pr2404-tests.patch +++ b/system/binutils/remove-pr2404-tests.patch @@ -2,7 +2,7 @@ These tests fail to link correctly on musl. --- binutils-2.41/ld/testsuite/ld-elf/shared.exp.old 2023-09-22 20:47:52.781342124 -0500 +++ binutils-2.41/ld/testsuite/ld-elf/shared.exp 2023-09-22 20:54:03.151915244 -0500 -@@ -799,30 +799,6 @@ +@@ -800,30 +800,6 @@ run_cc_link_tests [list \ [list \ @@ -33,7 +33,7 @@ These tests fail to link correctly on musl. "Build libpr26590a.so" \ "-shared" \ "-fPIC" \ -@@ -1132,17 +1108,6 @@ +@@ -1133,17 +1107,6 @@ [list "Run relmain" \ "-Wl,--no-as-needed,-rpath=tmpdir -Ltmpdir -lrel" "" \ {relmain.c} "relmain" "relmain.out" ] \ @@ -51,7 +51,7 @@ These tests fail to link correctly on musl. [list "Run pr18458" \ "-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \ {pr18458c.c} "pr18458" "pass.out" ] \ -@@ -1341,14 +1306,6 @@ +@@ -1338,14 +1303,6 @@ || [istarget *-*-gnu*] } { run_cc_link_tests [list \ [list \ @@ -66,7 +66,7 @@ These tests fail to link correctly on musl. "Build pr19579a.o" \ "" "-fPIE -fcommon" \ {pr19579a.c} \ -@@ -1428,24 +1385,6 @@ +@@ -1425,24 +1382,6 @@ "-fPIE" \ ] \ [list \ diff --git a/system/binutils/skip-thumb-plt-musl.patch b/system/binutils/skip-thumb-plt-musl.patch deleted file mode 100644 index f88500de2..000000000 --- a/system/binutils/skip-thumb-plt-musl.patch +++ /dev/null @@ -1,28 +0,0 @@ -The file offsets are different causing this test to fail on hard-float EABI targets. - -Add musl target triplet alongside the glibc one. - -Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30923 - ---- binutils-2.41/ld/testsuite/ld-arm/thumb-plt.d.old 2023-07-02 23:00:00.000000000 +0000 -+++ binutils-2.41/ld/testsuite/ld-arm/thumb-plt.d 2023-09-30 11:03:51.611314942 +0000 -@@ -2,7 +2,7 @@ - #name: Thumb only PLT and GOT - #ld: -shared -e0 -z max-page-size=0x10000 - #objdump: -dr --#skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf -+#skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf *-*-musleabihf - - .*: +file format .*arm.* - ---- binutils-2.41/ld/testsuite/ld-arm/thumb-plt-got.d.old 2023-07-02 23:00:00.000000000 +0000 -+++ binutils-2.41/ld/testsuite/ld-arm/thumb-plt-got.d 2023-09-30 11:04:19.175314931 +0000 -@@ -2,7 +2,7 @@ - #name: Thumb only PLT and GOT LSB Symbol - #ld: -shared -e0 -z max-page-size=0x10000 - #readelf: -rx .got --#skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf -+#skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf *-*-musleabihf - - Relocation section '.rel.plt' at offset 0x108 contains 1 entry: - Offset Info Type Sym.Value Sym. Name diff --git a/system/binutils/vers-tests-eabi.patch b/system/binutils/vers-tests-eabi.patch deleted file mode 100644 index 2ce59cee2..000000000 --- a/system/binutils/vers-tests-eabi.patch +++ /dev/null @@ -1,33 +0,0 @@ -By default, the vers4 tests use `sed` to look for `Version` lines. - -The problem is, on 32-bit ARM targets we have Version5 EABI. This causes -the tests to fail, like so: - - objdump --private-headers tmpdir/vers4b | sed -n /Version/,\$p > tmpdir/objdump.out - private flags = 0x5000400: [Version5 EABI] [hard-float ABI] - - objdump_emptyverstuff: did not expect any output from objdump - FAIL: vers4b - -Take 'private flags' lines out of the output to fix this. - -Upstream-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=30924 - ---- binutils-2.41/ld/testsuite/ld-elfvers/vers.exp.old 2023-09-30 21:51:47.304868575 -0500 -+++ binutils-2.41/ld/testsuite/ld-elfvers/vers.exp 2023-09-30 21:52:49.738253244 -0500 -@@ -215,11 +215,14 @@ - # this probably means that there is version information in libc, so we - # can't really perform this test. - return 1 -+ } else { if { [string match "*Version? EABI*" $exec_output] } then { -+# there is EABI Version information in the private flags of the binary. -+ return 1 - } else { - verbose -log "$exec_output" - verbose -log "objdump_emptyverstuff: did not expect any output from objdump" - return 0 -- } } -+ } } } - - } - diff --git a/system/binutils/x86_64-mark-plt.patch b/system/binutils/x86_64-mark-plt.patch new file mode 100644 index 000000000..29e1bd3bc --- /dev/null +++ b/system/binutils/x86_64-mark-plt.patch @@ -0,0 +1,37 @@ +From 6ef47613129c9251a5b8d5fa15ce6ea3ebe81ec1 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" <hjl.tools@gmail.com> +Date: Wed, 10 Jul 2024 15:19:23 -0700 +Subject: [PATCH] x86-64: Skip -z mark-plt tests on MUSL + +Skip -z mark-plt tests, which are specific to glibc, on MUSL. + + PR ld/31970 + * ld/testsuite/ld-x86-64/x86-64.exp: Skip -z mark-plt tests on + MUSL. + +Signed-off-by: H.J. Lu <hjl.tools@gmail.com> +--- + ld/testsuite/ld-x86-64/x86-64.exp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp +index dddac4375e1..57a1cc44e2c 100644 +--- a/ld/testsuite/ld-x86-64/x86-64.exp ++++ b/ld/testsuite/ld-x86-64/x86-64.exp +@@ -2274,6 +2274,13 @@ run_dump_test "ibt-plt-3a-x32" + run_dump_test "ibt-plt-3b-x32" + run_dump_test "ibt-plt-3c-x32" + run_dump_test "ibt-plt-3d-x32" ++ ++# Skip -z mark-plt tests on MUSL. ++if { [istarget "x86_64-*-musl*"]} { ++ set ASFLAGS "$saved_ASFLAGS" ++ return ++} ++ + run_dump_test "mark-plt-1a" + run_dump_test "mark-plt-1b" + run_dump_test "mark-plt-1c" +-- +2.45.2 + diff --git a/system/binutils/x86_64-missing-test.patch b/system/binutils/x86_64-missing-test.patch new file mode 100644 index 000000000..e6544c1a1 --- /dev/null +++ b/system/binutils/x86_64-missing-test.patch @@ -0,0 +1,91 @@ +From: Indu Bhagat <indu.bhagat@oracle.com> +Date: Tue, 30 Jan 2024 08:35:04 +0000 (-0800) +Subject: gas: scfi: add missing ginsn-cofi-1 testcase files +X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=48942a586ebc056bd059d3f63a5eed3a2fa46ab3;hp=7586594c484bbc2a1fb472b988c7e9cbc08c8416 + +gas: scfi: add missing ginsn-cofi-1 testcase files + +Previous commit a58dc5427f0 intended to bring the following two commits +from master branch: + + 91cdbed4d7b gas: scfi: untraceable control flow should be a hard error + 16cbeae1b27 x86: testsuite: scfi: adjust COFI testcase + +But missed adding the testcase files. Fix the failure by adding the +missing files. + +gas/testsuite/ + * gas/scfi/x86_64/ginsn-cofi-1.l: New test. + * gas/scfi/x86_64/ginsn-cofi-1.s: Likewise. +--- + +diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l +new file mode 100644 +index 00000000000..ab6b50d47e8 +--- /dev/null ++++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l +@@ -0,0 +1,38 @@ ++.*: Assembler messages: ++.*:20: Error: untraceable control flow for func 'foo' ++GAS LISTING .* ++ ++ ++ 1 # Testcase with a variety of "change of flow instructions" ++ 2 # ++ 3 # This test does not have much going on wrt synthesis of CFI; ++ 4 # it just aims to ensure x8_64 -> ginsn decoding behaves ++ 5 # gracefully for these "change of flow instructions" ++ 6 .text ++ 7 .globl foo ++ 8 .type foo, @function ++ 8 ginsn: SYM FUNC_BEGIN ++ 9 foo: ++ 9 ginsn: SYM foo ++ 10 \?\?\?\? 4801D0 addq %rdx, %rax ++ 10 ginsn: ADD %r1, %r0, %r0 ++ 11 \?\?\?\? E200 loop foo ++ 11 ginsn: JCC ++ 12 \?\?\?\? 3EFFE0 notrack jmp \*%rax ++ 12 ginsn: JMP %r0, ++ 13 \?\?\?\? 41FFD0 call \*%r8 ++ 13 ginsn: CALL ++ 14 \?\?\?\? 67E305 jecxz .L179 ++ 14 ginsn: JCC ++ 15 \?\?\?\? FF6730 jmp \*48\(%rdi\) ++ 15 ginsn: JMP %r5, ++ 16 \?\?\?\? 7000 jo .L179 ++ 16 ginsn: JCC ++ 17 .L179: ++ 17 ginsn: SYM .L179 ++ 18 \?\?\?\? C3 ret ++ 18 ginsn: RET ++ 19 .LFE0: ++ 19 ginsn: SYM .LFE0 ++ 20 .size foo, .-foo ++ 20 ginsn: SYM FUNC_END +diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s +new file mode 100644 +index 00000000000..0a63910e046 +--- /dev/null ++++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s +@@ -0,0 +1,20 @@ ++# Testcase with a variety of "change of flow instructions" ++# ++# This test does not have much going on wrt synthesis of CFI; ++# it just aims to ensure x8_64 -> ginsn decoding behaves ++# gracefully for these "change of flow instructions" ++ .text ++ .globl foo ++ .type foo, @function ++foo: ++ addq %rdx, %rax ++ loop foo ++ notrack jmp *%rax ++ call *%r8 ++ jecxz .L179 ++ jmp *48(%rdi) ++ jo .L179 ++.L179: ++ ret ++.LFE0: ++ .size foo, .-foo diff --git a/system/ca-certificates/APKBUILD b/system/ca-certificates/APKBUILD index a65728805..8a9d26863 100644 --- a/system/ca-certificates/APKBUILD +++ b/system/ca-certificates/APKBUILD @@ -1,9 +1,9 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=ca-certificates -pkgver=20220331 +pkgver=20230727 pkgrel=0 pkgdesc="CA root certificates" -url="https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/" +url="https://wiki.mozilla.org/CA" arch="all" options="!fhs !check" license="MPL-2.0 AND GPL-2.0+" @@ -42,5 +42,5 @@ package() { install -D -m755 "$srcdir"/certhash "$pkgdir"/etc/ca-certificates/update.d/certhash } -sha512sums="cb4dba3d5fe955343a9cd8c150f3b1b8f012f2fd101bf0036fb3bf71fa4feffd82af7cc2cb6d8d0907d5bec5446f81e58dd52f9ac1aee8849f131dad5a2778d3 ca-certificates-20220331.tar.xz +sha512sums="b6e3cf4e9a2f5074a71fac368fa58afcbf8a6b23a0a788982a0c712054c91167b546c86470d8e193d8bd92c9b086d9793903ef48ffc0a9e4745aabdf9cede9f5 ca-certificates-20230727.tar.xz 1efe48235f150052da6b872d2ebff174359825ab3bd66086c9d7f4c18dcd8aa8953c634dbf1aa8416d30d5623babf589660a25cf6e3a4cdcce707c14cc2f348a certhash" diff --git a/system/curl/APKBUILD b/system/curl/APKBUILD index aedaa6e7b..e719f008a 100644 --- a/system/curl/APKBUILD +++ b/system/curl/APKBUILD @@ -3,19 +3,18 @@ # Contributor: Łukasz Jendrysik <scadu@yandex.com> # Maintainer: Zach van Rijn <me@zv.io> pkgname=curl -pkgver=8.3.0 -pkgrel=1 +pkgver=8.9.1 +pkgrel=0 pkgdesc="A URL retrival utility and library" url="https://curl.haxx.se" arch="all" license="MIT" depends="ca-certificates" makedepends_build="perl" -makedepends_host="libssh2-dev nghttp2-dev openssl-dev zlib-dev zstd-dev - autoconf automake libtool" +makedepends_host="libssh2-dev nghttp2-dev openssl-dev zlib-dev zstd-dev" makedepends="$makedepends_build $makedepends_host" source="https://curl.haxx.se/download/$pkgname-$pkgver.tar.xz - fix-fseek-type-mismatch.patch + errorcodes.pl " subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev libcurl" @@ -103,12 +102,10 @@ subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev libcurl" # - CVE-2014-0138 # - CVE-2014-0139 -# remove after the upstream release includes -# https://github.com/curl/curl/pull/11918 prepare() { default_prepare - autoreconf -vif + cp "$srcdir"/errorcodes.pl "$builddir"/tests/errorcodes.pl } build() { @@ -143,5 +140,5 @@ libcurl() { mv "$pkgdir"/usr/lib "$subpkgdir"/usr } -sha512sums="6404b4c74fe1185cb482631ca3a143996cb7298d0d8a76bfafd7696e7729c00559999a069bdba782dee3f3eb273fb678a4438cb27d3deca54022878cdff83a51 curl-8.3.0.tar.xz -c89178b8be2f48ba0a25072087d5430ec25293f3b5d5a7eef916656b356609624f679a143f90d28459cc6e669ad028526663934a22ea4c777e86ce154d6c5516 fix-fseek-type-mismatch.patch" +sha512sums="a0fe234402875db194aad4e4208b7e67e7ffc1562622eea90948d4b9b0122c95c3dde8bbe2f7445a687cb3de7cb09f20e5819d424570442d976aa4c913227fc7 curl-8.9.1.tar.xz +7848b1271e0bfe3be40221fb0582712d4af3ce1e1bdf16b5f0cac731d81bda145efc039f945a311af70caff279a44435a8ead6bb6e1db7570a4bd22df0a77fdb errorcodes.pl" diff --git a/system/curl/errorcodes.pl b/system/curl/errorcodes.pl new file mode 100644 index 000000000..9c8f9e882 --- /dev/null +++ b/system/curl/errorcodes.pl @@ -0,0 +1,99 @@ +#!/usr/bin/env perl +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### + +# Check that libcurl-errors.3 and the public header files have the same set of +# error codes. + +use strict; +use warnings; + +# we may get the dir roots pointed out +my $root=$ARGV[0] || "."; +my $manpge = "$root/docs/libcurl/libcurl-errors.3"; +my $curlh = "$root/include/curl"; +my $errors=0; + +my @hnames; +my %wherefrom; +my @mnames; +my %manfrom; + +sub scanheader { + my ($file)=@_; + open H, "<$file"; + my $line = 0; + while(<H>) { + $line++; + if($_ =~ /^ (CURL(E|UE|SHE|HE|M)_[A-Z0-9_]*)/) { + my ($name)=($1); + if(($name !~ /OBSOLETE/) && ($name !~ /_LAST\z/)) { + push @hnames, $name; + if($wherefrom{$name}) { + print STDERR "double: $name\n"; + } + $wherefrom{$name}="$file:$line"; + } + } + } + close(H); +} + +sub scanmanpage { + my ($file)=@_; + open H, "<$file"; + my $line = 0; + while(<H>) { + $line++; + if($_ =~ /^\.IP \"(CURL(E|UE|SHE|HE|M)_[A-Z0-9_]*)/) { + my ($name)=($1); + push @mnames, $name; + $manfrom{$name}="$file:$line"; + } + } + close(H); +} + + +opendir(my $dh, $curlh) || die "Can't opendir $curlh: $!"; +my @hfiles = grep { /\.h$/ } readdir($dh); +closedir $dh; + +for(sort @hfiles) { + scanheader("$curlh/$_"); +} +scanmanpage($manpge); + +print "Result\n"; +for my $h (sort @hnames) { + if(!$manfrom{$h}) { + printf "$h from %s, not in man page\n", $wherefrom{$h}; + } +} + +for my $m (sort @mnames) { + if(!$wherefrom{$m}) { + printf "$m from %s, not in any header\n", $manfrom{$m}; + } +} diff --git a/system/curl/fix-fseek-type-mismatch.patch b/system/curl/fix-fseek-type-mismatch.patch deleted file mode 100644 index ec83efb41..000000000 --- a/system/curl/fix-fseek-type-mismatch.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 40ee445b3b05be4e215be8b5b0f87f7080ceaf26 Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Mon, 25 Sep 2023 13:03:26 +0200 -Subject: [PATCH] configure: sort AC_CHECK_FUNCS - -No functional changes. ---- - configure.ac | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 2fc9f2f01783c..a6f9066a133a4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3583,8 +3583,10 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se - #include <sys/types.h>]]) - - --AC_CHECK_FUNCS([fnmatch \ -+AC_CHECK_FUNCS([\ -+ arc4random \ - fchmod \ -+ fnmatch \ - fork \ - geteuid \ - getpass_r \ -@@ -3604,7 +3606,6 @@ AC_CHECK_FUNCS([fnmatch \ - snprintf \ - utime \ - utimes \ -- arc4random - ],[ - ],[ - func="$ac_func" -From 60d047b6b238427a7dda916bb00d0a48238e7a27 Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Fri, 22 Sep 2023 13:58:49 +0000 -Subject: [PATCH] lib: use wrapper for curl_mime_data fseek callback - -fseek uses long offset which does not match with curl_off_t. This leads -to undefined behavior when calling the callback and caused failure on -arm 32 bit. - -Use a wrapper to solve this and use fseeko which uses off_t instead of -long. - -Thanks to the nice people at Libera IRC #musl for helping finding this -out. - -Closes #11882 -Closes #11900 ---- - CMakeLists.txt | 3 +++ - configure.ac | 2 ++ - lib/formdata.c | 17 +++++++++++++++-- - 3 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0b3aed90627b1..84774dc1db043 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1037,6 +1037,7 @@ check_include_file_concat("signal.h" HAVE_SIGNAL_H) - check_include_file_concat("stdatomic.h" HAVE_STDATOMIC_H) - check_include_file_concat("stdbool.h" HAVE_STDBOOL_H) - check_include_file_concat("stdint.h" HAVE_STDINT_H) -+check_include_file_concat("stdio.h" HAVE_STDIO_H) - check_include_file_concat("stdlib.h" HAVE_STDLIB_H) - check_include_file_concat("string.h" HAVE_STRING_H) - check_include_file_concat("strings.h" HAVE_STRINGS_H) -@@ -1122,6 +1123,8 @@ endif() - check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO) - check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE) - check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) -+check_symbol_exists(fseeko "${CURL_INCLUDES}" HAVE_FSEEKO) -+check_symbol_exists(_fseeki64 "${CURL_INCLUDES}" HAVE__FSEEKI64) - check_symbol_exists(getpeername "${CURL_INCLUDES}" HAVE_GETPEERNAME) - check_symbol_exists(getsockname "${CURL_INCLUDES}" HAVE_GETSOCKNAME) - check_symbol_exists(if_nametoindex "${CURL_INCLUDES}" HAVE_IF_NAMETOINDEX) -diff --git a/configure.ac b/configure.ac -index a6f9066a133a4..5fa7c45c47430 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3584,10 +3584,12 @@ AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Se - - - AC_CHECK_FUNCS([\ -+ _fseeki64 \ - arc4random \ - fchmod \ - fnmatch \ - fork \ -+ fseeko \ - geteuid \ - getpass_r \ - getppid \ -diff --git a/lib/formdata.c b/lib/formdata.c -index 8984b63223cc0..f370ce6854b5f 100644 ---- a/lib/formdata.c -+++ b/lib/formdata.c -@@ -789,6 +789,20 @@ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) - return res; - } - -+/* wrap call to fseeko so it matches the calling convetion of callback */ -+static int fseeko_wrapper(void *stream, curl_off_t offset, int whence) -+{ -+#if defined(HAVE_FSEEKO) -+ return fseeko(stream, (off_t)offset, whence); -+#elif defined(HAVE__FSEEKI64) -+ return _fseeki64(stream, (__int64)offset, whence); -+#else -+ if(offset > LONG_MAX) -+ return -1; -+ return fseek(stream, (long)offset, whence); -+#endif -+} -+ - /* - * Curl_getformdata() converts a linked list of "meta data" into a mime - * structure. The input list is in 'post', while the output is stored in -@@ -874,8 +888,7 @@ CURLcode Curl_getformdata(struct Curl_easy *data, - compatibility: use of "-" pseudo file name should be avoided. */ - result = curl_mime_data_cb(part, (curl_off_t) -1, - (curl_read_callback) fread, -- CURLX_FUNCTION_CAST(curl_seek_callback, -- fseek), -+ fseeko_wrapper, - NULL, (void *) stdin); - } - else diff --git a/system/db/APKBUILD b/system/db/APKBUILD index 587724143..1655d4556 100644 --- a/system/db/APKBUILD +++ b/system/db/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: pkgname=db pkgver=5.3.28 -pkgrel=2 +pkgrel=4 pkgdesc="The Berkeley DB embedded database system" url="https://www.oracle.com/technology/software/products/berkeley-db/index.html" arch="all" @@ -9,7 +9,8 @@ options="!check" # "check target not available" license="Sleepycat AND BSD-3-Clause" depends="" makedepends="" -subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-c++:cxx" +subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-c++:cxx + $pkgname-doc-pdf:pdf" source="https://download.oracle.com/berkeley-db/db-$pkgver.tar.gz atomics.patch time64.patch @@ -41,6 +42,11 @@ package() { mkdir -p "$pkgdir"/usr/share/doc mv "$pkgdir"/usr/docs "$pkgdir"/usr/share/doc/$pkgname + for _extraneous in api_reference/STL api_reference/TCL csharp java\ + gsg/JAVA gsg_db_rep/JAVA gsg_txn/JAVA installation; do + rm -r "$pkgdir"/usr/share/doc/$pkgname/$_extraneous + done + install -D -m644 "$builddir"/LICENSE \ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE } @@ -58,6 +64,17 @@ cxx() { mv "$pkgdir"/usr/lib/libdb_cxx*.so "$subpkgdir"/usr/lib/ } +pdf() { + pkgdesc="$pkgdesc (PDF documentation)" + mkdir -p "$subpkgdir" + + cd "$subpkgdir"/../$pkgname-doc + for _pdf in $(find . -type f -name '*.pdf'); do + install -D -m644 "$_pdf" "$subpkgdir"/$_pdf + rm $_pdf + done +} + sha512sums="e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090 db-5.3.28.tar.gz 8ba96cfc3e484a839b8651214f0769b35273c6235de7e53d5118eb0347f5a477f75e3336a12f1399b7748c6b6ab95aec39c8b813d7b227dd61f37ed4ab52f7d5 atomics.patch 5712bc36bd362820912bc899aff9738318b6f920e9fa71bef33c0d5c62dff7943827460b7b2194019738acfac2713954d01eab68c68ca02473f8d3f1a0950c48 time64.patch" diff --git a/system/easy-kernel/APKBUILD b/system/easy-kernel/APKBUILD index e328abef0..00f23330a 100644 --- a/system/easy-kernel/APKBUILD +++ b/system/easy-kernel/APKBUILD @@ -5,7 +5,7 @@ _kflavour="" _patchver=6 # must match 1000-version.patch _pkgname=easy-kernel$_kflavour pkgver=5.15.132 -pkgrel=0 +pkgrel=2 pkgname=$_pkgname-$pkgver-mc$_patchver pkgdesc="The Linux kernel, packaged for your convenience" url="https://kernel.org/" @@ -156,14 +156,14 @@ src() { } sha512sums="d25ad40b5bcd6a4c6042fd0fd84e196e7a58024734c3e9a484fd0d5d54a0c1d87db8a3c784eff55e43b6f021709dc685eb0efa18d2aec327e4f88a79f405705a linux-5.15.tar.xz -a83cf1c3747ada04836f10a1ec5d5afaccdcafb156d3380c39a021f70da59f19f2c747073e0e1ec5ec25b51d73446cf32a5621f35d3b749414b12bc8765fc43b config-aarch64 +d1d47dcf1c40df0e02422104961b73818de5635aa5e47c7ab332047aeee44a87f36fc2b1451079bfa787eb12cdebcb53806d17b6a010bc158db959642f151fb5 config-aarch64 8e216a2dafeafdf10ec0f3387b7ca13a3809ff83906573d77ab703c6970e6ac3666d863c54e67b70368f2a111d2e9f8d09d4ba9a684fca902f1193a8d3fc2ccc config-armv7 f42f9931a0a31bf65781ffd1acd44f28c2b3f4966808c2a07983f1ffccf96167a31280c4e6f0eed4ad91643d85bd267eed3dc0603d14d47b4eceacf04f2222df config-m68k -8ea6135c46d7d44217a0d615885cb7ff7adb738cf30e5b776c2c9c56934455b32a9374f4515bd5b0287ed514e3fb1bf9227954b7e8374716f2a923d6ea081165 config-pmmx -319a9e0c8c799066588aad0f94f4256207b30356b14c77c8ba5408e6ddbe12b332ab79dd5e0d38e9f99cc7bdd3d8c697f0b4852088c172ec7012fcf9361debe9 config-ppc -a60ddfc590d9a7a78c6b4d20900efce63bd8d7c6b91a56fdf91c10829ef120885f1f436813236db4158fc5da62fdbb0d4809ecbe3b328d8882c16bc90baab21e config-ppc64 +b440cbe7252aa55c2f80ad321d02371ecfdafc22e1e4f3fb72e1d398fb96fa90e2b811271b4d724d16696186000b8ee273b44f3446f763a89ed2c7e7f4b7703c config-pmmx +8f4b305cd8c81add318b88bb57c26d83dc1a6ed413dacc5b8c0bed7a11bc4149cba2a85085a96e8f61802dc210161f0cf87cee1826e64e4f224a7fd15fb3c326 config-ppc +9426c18b24889c18c051b3b88c68b958005e6c450047051fb25a8c0d2dd5ab5937e514b59da91a16ae9672e2ccc3b9ea62bd7d1fa0741732d52475f60fecbb9e config-ppc64 8401646537ff98382988b8e84b21d5ecf80b97587fd595c0dbb8848f7d0fe64fbaab4c8a949e12ef29a9b3d84be219d3eb3422848158c58f0797f2c4dfff352e config-sparc64 -85d0cc0303e84db7435e9b7c0214c00f67dbf30ea3d19941d19a7a0fb6653f3ce296d2a2a42d680fb4d00e4e7c8aa1e7b0f933ecfefc573e3c193c6d5428c761 config-x86_64 +a4661978273a65f181fb5583393b82be9b3412378e24a3bcf2c391165fad331ca63c78350555d2d0b3e61e48df49e820aaf3a36453f029fc8910da6c6c0c232b config-x86_64 1ca1bc094a8106b33176ab6cfb55c9514e7d69f1ed30c580eee419a3c422a2e6625d71c4581702e911f36c4bbac175010f46b7123bb81fda3303d4decdc57287 kernel.h a30efb8c4890d8be90c892cd73cf06e1701148888dcd729b1860b6bf519bca44690233197e6a8126fe51c522b9c0cb36030ff9dfe3ade7caf25d685e99333a7f 0100-linux-5.15.132.patch 3ed100909f9aed72836a3c712e45e0116cd3c4331961a76a27b867a7098d0df9458387b656c9ea01385c3c37585436e48168ac35666b0e46dca7da05e5e38a61 0120-XATTR_USER_PREFIX.patch diff --git a/system/easy-kernel/config-aarch64 b/system/easy-kernel/config-aarch64 index 439728ab4..fdbb2a124 100644 --- a/system/easy-kernel/config-aarch64 +++ b/system/easy-kernel/config-aarch64 @@ -7,9 +7,9 @@ CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=80500 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23200 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23200 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -290,7 +290,6 @@ CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=4 CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_BROKEN_GAS_INST=y # # Platform selection @@ -352,6 +351,7 @@ CONFIG_ARM64_ERRATUM_834220=y CONFIG_ARM64_ERRATUM_1742098=y CONFIG_ARM64_ERRATUM_845719=y CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y CONFIG_ARM64_ERRATUM_1024718=y CONFIG_ARM64_ERRATUM_1418040=y CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y @@ -439,6 +439,9 @@ CONFIG_CP15_BARRIER_EMULATION=y # CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_PAN=y +CONFIG_AS_HAS_LDAPR=y +CONFIG_AS_HAS_LSE_ATOMICS=y +CONFIG_ARM64_LSE_ATOMICS=y CONFIG_ARM64_USE_LSE_ATOMICS=y # end of ARMv8.1 architectural features @@ -454,20 +457,28 @@ CONFIG_ARM64_CNP=y # ARMv8.3 architectural features # # CONFIG_ARM64_PTR_AUTH is not set +CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y +CONFIG_AS_HAS_PAC=y +CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y # end of ARMv8.3 architectural features # # ARMv8.4 architectural features # CONFIG_ARM64_AMU_EXTN=y +CONFIG_AS_HAS_ARMV8_4=y +CONFIG_ARM64_TLB_RANGE=y # end of ARMv8.4 architectural features # # ARMv8.5 architectural features # +CONFIG_AS_HAS_ARMV8_5=y CONFIG_ARM64_BTI=y CONFIG_ARM64_E0PD=y CONFIG_ARCH_RANDOM=y +CONFIG_ARM64_AS_HAS_MTE=y +CONFIG_ARM64_MTE=y # end of ARMv8.5 architectural features # @@ -1010,6 +1021,7 @@ CONFIG_ARCH_HAS_PTE_DEVMAP=y CONFIG_ARCH_HAS_ZONE_DMA_SET=y CONFIG_ZONE_DMA=y CONFIG_ZONE_DMA32=y +CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y # CONFIG_PERCPU_STATS is not set # CONFIG_GUP_TEST is not set # CONFIG_READ_ONLY_THP_FOR_FS is not set @@ -3645,7 +3657,7 @@ CONFIG_I2C_ALGOBIT=y # # ACPI drivers # -# CONFIG_I2C_SCMI is not set +CONFIG_I2C_SCMI=m # # I2C system bus drivers (mostly embedded / system-on-chip) @@ -3698,7 +3710,7 @@ CONFIG_I2C_UNIPHIER_F=y # CONFIG_I2C_CROS_EC_TUNNEL=y # CONFIG_I2C_XGENE_SLIMPRO is not set -# CONFIG_I2C_VIRTIO is not set +CONFIG_I2C_VIRTIO=m # end of I2C Hardware Bus support # CONFIG_I2C_STUB is not set @@ -6650,57 +6662,60 @@ CONFIG_RTC_INTF_DEV=y # # I2C RTC drivers # -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABEOZ9 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -CONFIG_RTC_DRV_MAX77686=y +CONFIG_RTC_DRV_ABB5ZES3=m +CONFIG_RTC_DRV_ABEOZ9=m +CONFIG_RTC_DRV_ABX80X=m +CONFIG_RTC_DRV_DS1307=m +CONFIG_RTC_DRV_DS1307_CENTURY=y +CONFIG_RTC_DRV_DS1374=m +CONFIG_RTC_DRV_DS1374_WDT=y +CONFIG_RTC_DRV_DS1672=m +CONFIG_RTC_DRV_HYM8563=m +CONFIG_RTC_DRV_MAX6900=m +CONFIG_RTC_DRV_MAX77686=m CONFIG_RTC_DRV_RK808=m -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_ISL12026 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF85363 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV3028 is not set -# CONFIG_RTC_DRV_RV3032 is not set -# CONFIG_RTC_DRV_RV8803 is not set -CONFIG_RTC_DRV_S5M=y -# CONFIG_RTC_DRV_SD3078 is not set +CONFIG_RTC_DRV_RS5C372=m +CONFIG_RTC_DRV_ISL1208=m +CONFIG_RTC_DRV_ISL12022=m +CONFIG_RTC_DRV_ISL12026=m +CONFIG_RTC_DRV_X1205=m +CONFIG_RTC_DRV_PCF8523=m +CONFIG_RTC_DRV_PCF85063=m +CONFIG_RTC_DRV_PCF85363=m +CONFIG_RTC_DRV_PCF8563=m +CONFIG_RTC_DRV_PCF8583=m +CONFIG_RTC_DRV_M41T80=m +CONFIG_RTC_DRV_M41T80_WDT=y +CONFIG_RTC_DRV_BQ32K=m +CONFIG_RTC_DRV_S35390A=m +CONFIG_RTC_DRV_FM3130=m +CONFIG_RTC_DRV_RX8010=m +CONFIG_RTC_DRV_RX8581=m +CONFIG_RTC_DRV_RX8025=m +CONFIG_RTC_DRV_EM3027=m +CONFIG_RTC_DRV_RV3028=m +CONFIG_RTC_DRV_RV3032=m +CONFIG_RTC_DRV_RV8803=m +CONFIG_RTC_DRV_S5M=m +CONFIG_RTC_DRV_SD3078=m # # SPI RTC drivers # -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1302 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6916 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_MCP795 is not set +CONFIG_RTC_DRV_M41T93=m +CONFIG_RTC_DRV_M41T94=m +CONFIG_RTC_DRV_DS1302=m +CONFIG_RTC_DRV_DS1305=m +CONFIG_RTC_DRV_DS1343=m +CONFIG_RTC_DRV_DS1347=m +CONFIG_RTC_DRV_DS1390=m +CONFIG_RTC_DRV_MAX6916=m +CONFIG_RTC_DRV_R9701=m +CONFIG_RTC_DRV_RX4581=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF2123=m +CONFIG_RTC_DRV_MCP795=m CONFIG_RTC_I2C_AND_SPI=y # @@ -6708,60 +6723,66 @@ CONFIG_RTC_I2C_AND_SPI=y # CONFIG_RTC_DRV_DS3232=y CONFIG_RTC_DRV_DS3232_HWMON=y -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set -# CONFIG_RTC_DRV_RX6110 is not set +CONFIG_RTC_DRV_PCF2127=m +CONFIG_RTC_DRV_RV3029C2=m +CONFIG_RTC_DRV_RV3029_HWMON=y +CONFIG_RTC_DRV_RX6110=m # # Platform RTC drivers # -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_EFI is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_BQ4802 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set -# CONFIG_RTC_DRV_CROS_EC is not set +CONFIG_RTC_DRV_DS1286=m +CONFIG_RTC_DRV_DS1511=m +CONFIG_RTC_DRV_DS1553=m +CONFIG_RTC_DRV_DS1685_FAMILY=m +CONFIG_RTC_DRV_DS1685=y +# CONFIG_RTC_DRV_DS1689 is not set +# CONFIG_RTC_DRV_DS17285 is not set +# CONFIG_RTC_DRV_DS17485 is not set +# CONFIG_RTC_DRV_DS17885 is not set +CONFIG_RTC_DRV_DS1742=m +CONFIG_RTC_DRV_DS2404=m +CONFIG_RTC_DRV_EFI=y +CONFIG_RTC_DRV_STK17TA8=m +CONFIG_RTC_DRV_M48T86=m +CONFIG_RTC_DRV_M48T35=m +CONFIG_RTC_DRV_M48T59=m +CONFIG_RTC_DRV_MSM6242=m +CONFIG_RTC_DRV_BQ4802=m +CONFIG_RTC_DRV_RP5C01=m +CONFIG_RTC_DRV_V3020=m +CONFIG_RTC_DRV_ZYNQMP=m +CONFIG_RTC_DRV_CROS_EC=m # # on-CPU RTC drivers # -# CONFIG_RTC_DRV_IMXDI is not set -CONFIG_RTC_DRV_FSL_FTM_ALARM=y +CONFIG_RTC_DRV_IMXDI=m +CONFIG_RTC_DRV_FSL_FTM_ALARM=m CONFIG_RTC_DRV_MESON_VRTC=m CONFIG_HAVE_S3C_RTC=y CONFIG_RTC_DRV_S3C=y -# CONFIG_RTC_DRV_PL030 is not set +CONFIG_RTC_DRV_PL030=m CONFIG_RTC_DRV_PL031=y CONFIG_RTC_DRV_SUN6I=y -# CONFIG_RTC_DRV_MV is not set -# CONFIG_RTC_DRV_ARMADA38X is not set -# CONFIG_RTC_DRV_CADENCE is not set -# CONFIG_RTC_DRV_FTRTC010 is not set -CONFIG_RTC_DRV_TEGRA=y -# CONFIG_RTC_DRV_MXC is not set -# CONFIG_RTC_DRV_MXC_V2 is not set -# CONFIG_RTC_DRV_SNVS is not set -# CONFIG_RTC_DRV_MT2712 is not set -# CONFIG_RTC_DRV_MT7622 is not set +CONFIG_RTC_DRV_MV=m +CONFIG_RTC_DRV_ARMADA38X=m +CONFIG_RTC_DRV_CADENCE=m +CONFIG_RTC_DRV_FTRTC010=m +CONFIG_RTC_DRV_TEGRA=m +CONFIG_RTC_DRV_MXC=m +CONFIG_RTC_DRV_MXC_V2=m +CONFIG_RTC_DRV_SNVS=m +CONFIG_RTC_DRV_MT2712=m +CONFIG_RTC_DRV_MT7622=m CONFIG_RTC_DRV_XGENE=y -# CONFIG_RTC_DRV_R7301 is not set +CONFIG_RTC_DRV_R7301=m CONFIG_RTC_DRV_RTD119X=y # # HID Sensor RTC drivers # -# CONFIG_RTC_DRV_GOLDFISH is not set +CONFIG_RTC_DRV_GOLDFISH=m CONFIG_DMADEVICES=y # CONFIG_DMADEVICES_DEBUG is not set @@ -8983,6 +9004,7 @@ CONFIG_DEBUG_MEMORY_INIT=y # CONFIG_DEBUG_PER_CPU_MAPS is not set CONFIG_HAVE_ARCH_KASAN=y CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y +CONFIG_HAVE_ARCH_KASAN_HW_TAGS=y CONFIG_HAVE_ARCH_KASAN_VMALLOC=y CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y diff --git a/system/easy-kernel/config-pmmx b/system/easy-kernel/config-pmmx index 803db2445..02b2961a6 100644 --- a/system/easy-kernel/config-pmmx +++ b/system/easy-kernel/config-pmmx @@ -7,9 +7,9 @@ CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=80500 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23200 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23200 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_ASM_INLINE=y @@ -303,6 +303,7 @@ CONFIG_X86_32_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=2 +CONFIG_CC_HAS_SANE_STACKPROTECTOR=y # # Processor type and features @@ -505,8 +506,10 @@ CONFIG_HOTPLUG_CPU=y CONFIG_MODIFY_LDT_SYSCALL=y # end of Processor type and features +CONFIG_CC_HAS_RETURN_THUNK=y CONFIG_SPECULATION_MITIGATIONS=y CONFIG_RETPOLINE=y +# CONFIG_RETHUNK is not set # CONFIG_GDS_FORCE_MITIGATION is not set CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y @@ -712,6 +715,10 @@ CONFIG_KVM=y CONFIG_KVM_INTEL=m CONFIG_KVM_AMD=m # CONFIG_KVM_XEN is not set +CONFIG_AS_AVX512=y +CONFIG_AS_SHA1_NI=y +CONFIG_AS_SHA256_NI=y +CONFIG_AS_TPAUSE=y # # General architecture-dependent options @@ -775,6 +782,9 @@ CONFIG_SECCOMP=y CONFIG_SECCOMP_FILTER=y # CONFIG_SECCOMP_CACHE_DEBUG is not set CONFIG_HAVE_ARCH_STACKLEAK=y +CONFIG_HAVE_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR_STRONG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y CONFIG_LTO_NONE=y diff --git a/system/easy-kernel/config-ppc b/system/easy-kernel/config-ppc index da8c36e3b..fd17f343d 100644 --- a/system/easy-kernel/config-ppc +++ b/system/easy-kernel/config-ppc @@ -7,9 +7,9 @@ CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=80500 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23200 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23200 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_ASM_INLINE=y @@ -277,7 +277,6 @@ CONFIG_TARGET_CPU="powerpc" CONFIG_PPC_BOOK3S=y CONFIG_PPC_FPU_REGS=y CONFIG_PPC_FPU=y -# CONFIG_FSL_EMB_PERFMON is not set CONFIG_ALTIVEC=y CONFIG_PPC_HAVE_KUEP=y CONFIG_PPC_KUEP=y @@ -289,7 +288,6 @@ CONFIG_PPC_HAVE_PMU_SUPPORT=y CONFIG_PPC_PERF_CTRS=y CONFIG_SMP=y CONFIG_NR_CPUS=4 -CONFIG_NOT_COHERENT_CACHE=y # end of Processor support CONFIG_VDSO32=y @@ -330,10 +328,7 @@ CONFIG_GE_FPGA=y # # CONFIG_SCOM_DEBUGFS is not set CONFIG_PPC_CHRP=y -CONFIG_PPC_MPC512x=y -CONFIG_MPC5121_ADS=y -CONFIG_MPC512x_GENERIC=y -CONFIG_PDM360NG=y +# CONFIG_PPC_MPC512x is not set CONFIG_PPC_MPC52xx=y CONFIG_PPC_MPC5200_SIMPLE=y CONFIG_PPC_EFIKA=y @@ -351,23 +346,7 @@ CONFIG_PQ2ADS=y CONFIG_8260=y CONFIG_8272=y CONFIG_PQ2_ADS_PCI_PIC=y -CONFIG_PPC_83xx=y -CONFIG_MPC830x_RDB=y -CONFIG_MPC831x_RDB=y -CONFIG_MPC832x_MDS=y -CONFIG_MPC832x_RDB=y -CONFIG_MPC834x_MDS=y -CONFIG_MPC834x_ITX=y -CONFIG_MPC836x_MDS=y -CONFIG_MPC836x_RDK=y -CONFIG_MPC837x_MDS=y -CONFIG_MPC837x_RDB=y -CONFIG_ASP834x=y -CONFIG_KMETER1=y -CONFIG_PPC_MPC831x=y -CONFIG_PPC_MPC832x=y -CONFIG_PPC_MPC834x=y -CONFIG_PPC_MPC837x=y +# CONFIG_PPC_83xx is not set CONFIG_PPC_86xx=y CONFIG_MPC8641_HPCN=y CONFIG_MPC8610_HPCD=y @@ -383,7 +362,6 @@ CONFIG_PPC_NATIVE=y CONFIG_PPC_OF_BOOT_TRAMPOLINE=y # CONFIG_UDBG_RTAS_CONSOLE is not set CONFIG_PPC_SMP_MUXED_IPI=y -CONFIG_IPIC=y CONFIG_MPIC=y # CONFIG_MPIC_TIMER is not set CONFIG_MPIC_MSGR=y @@ -450,7 +428,6 @@ CONFIG_CPM2=y CONFIG_FSL_ULI1575=y CONFIG_CPM=y CONFIG_GEN_RTC=y -CONFIG_MCU_MPC8349EMITX=y # end of Platform support # @@ -463,7 +440,6 @@ CONFIG_HZ_100=y # CONFIG_HZ_1000 is not set CONFIG_HZ=100 CONFIG_SCHED_HRTICK=y -# CONFIG_MATH_EMULATION is not set CONFIG_HOTPLUG_CPU=y # CONFIG_PPC_QUEUED_SPINLOCKS is not set CONFIG_ARCH_CPU_PROBE_RELEASE=y @@ -515,7 +491,6 @@ CONFIG_FSL_SOC=y CONFIG_FSL_PCI=y CONFIG_FSL_PMC=y CONFIG_FSL_LBC=y -CONFIG_FSL_GTM=y CONFIG_PCI_8260=y # end of Bus options @@ -1771,6 +1746,7 @@ CONFIG_OF_ADDRESS=y CONFIG_OF_IRQ=y CONFIG_OF_RESERVED_MEM=y # CONFIG_OF_OVERLAY is not set +CONFIG_OF_DMA_DEFAULT_COHERENT=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_PARPORT=m CONFIG_PARPORT_PC=m @@ -3690,10 +3666,9 @@ CONFIG_VIDEO_V4L2_I2C=y CONFIG_VIDEO_TUNER=m CONFIG_V4L2_FWNODE=m CONFIG_V4L2_ASYNC=m -CONFIG_VIDEOBUF_GEN=y +CONFIG_VIDEOBUF_GEN=m CONFIG_VIDEOBUF_DMA_SG=m CONFIG_VIDEOBUF_VMALLOC=m -CONFIG_VIDEOBUF_DMA_CONTIG=y # end of Video4Linux options # @@ -3909,7 +3884,6 @@ CONFIG_V4L_PLATFORM_DRIVERS=y # CONFIG_VIDEO_CAFE_CCIC is not set # CONFIG_VIDEO_CADENCE is not set # CONFIG_VIDEO_ASPEED is not set -CONFIG_VIDEO_VIU=y # CONFIG_VIDEO_MUX is not set # CONFIG_VIDEO_XILINX is not set # CONFIG_V4L_MEM2MEM_DRIVERS is not set @@ -4981,8 +4955,6 @@ CONFIG_USB_HID=y CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y -CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y CONFIG_USB_SUPPORT=y CONFIG_USB_COMMON=y # CONFIG_USB_LED_TRIG is not set @@ -5210,7 +5182,6 @@ CONFIG_MMC_SDHCI_CADENCE=m CONFIG_MMC_SDHCI_F_SDH30=m # CONFIG_MMC_SDHCI_MILBEAUT is not set # CONFIG_MMC_WBSD is not set -# CONFIG_MMC_MXC is not set CONFIG_MMC_TIFM_SD=m CONFIG_MMC_SDRICOH_CS=m CONFIG_MMC_CB710=m @@ -6272,15 +6243,8 @@ CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_ARCH_HAS_DMA_SET_MASK=y CONFIG_DMA_DECLARE_COHERENT=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y -CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y -CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y CONFIG_SWIOTLB=y # CONFIG_DMA_RESTRICTED_POOL is not set -CONFIG_DMA_NONCOHERENT_MMAP=y -CONFIG_DMA_COHERENT_POOL=y -CONFIG_DMA_REMAP=y -CONFIG_DMA_DIRECT_REMAP=y # CONFIG_DMA_API_DEBUG is not set # CONFIG_DMA_MAP_BENCHMARK is not set CONFIG_SGL_ALLOC=y diff --git a/system/easy-kernel/config-ppc64 b/system/easy-kernel/config-ppc64 index f6510c274..825946664 100644 --- a/system/easy-kernel/config-ppc64 +++ b/system/easy-kernel/config-ppc64 @@ -7,9 +7,9 @@ CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=80500 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23200 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23200 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -1595,6 +1595,8 @@ CONFIG_DST_CACHE=y CONFIG_GRO_CELLS=y CONFIG_NET_SELFTESTS=m CONFIG_NET_SOCK_MSG=y +CONFIG_NET_DEVLINK=y +CONFIG_PAGE_POOL=y CONFIG_FAILOVER=m CONFIG_ETHTOOL_NETLINK=y @@ -1690,6 +1692,7 @@ CONFIG_HOTPLUG_PCI_RPA=m # # Generic Driver Options # +CONFIG_AUXILIARY_BUS=y # CONFIG_UEVENT_HELPER is not set CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y @@ -1717,6 +1720,7 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=m +CONFIG_REGMAP_MMIO=y CONFIG_DMA_SHARED_BUFFER=y # CONFIG_DMA_FENCE_TRACE is not set # end of Generic Driver Options @@ -2071,6 +2075,7 @@ CONFIG_SCSI_IPR_TRACE=y CONFIG_SCSI_IPR_DUMP=y CONFIG_SCSI_QLOGIC_1280=m CONFIG_SCSI_QLA_ISCSI=m +# CONFIG_QEDI is not set CONFIG_SCSI_DC395x=m CONFIG_SCSI_AM53C974=m CONFIG_SCSI_WD719X=m @@ -2287,42 +2292,50 @@ CONFIG_VIRTIO_NET=m CONFIG_SUNGEM_PHY=m # CONFIG_ARCNET is not set CONFIG_ETHERNET=y +CONFIG_MDIO=m CONFIG_NET_VENDOR_3COM=y -# CONFIG_VORTEX is not set -# CONFIG_TYPHOON is not set +CONFIG_VORTEX=m +CONFIG_TYPHOON=m CONFIG_NET_VENDOR_ADAPTEC=y -# CONFIG_ADAPTEC_STARFIRE is not set +CONFIG_ADAPTEC_STARFIRE=m CONFIG_NET_VENDOR_AGERE=y -# CONFIG_ET131X is not set +CONFIG_ET131X=m CONFIG_NET_VENDOR_ALACRITECH=y -# CONFIG_SLICOSS is not set +CONFIG_SLICOSS=m CONFIG_NET_VENDOR_ALTEON=y CONFIG_ACENIC=m CONFIG_ACENIC_OMIT_TIGON_I=y -# CONFIG_ALTERA_TSE is not set +CONFIG_ALTERA_TSE=m CONFIG_NET_VENDOR_AMAZON=y CONFIG_NET_VENDOR_AMD=y -# CONFIG_AMD8111_ETH is not set -# CONFIG_PCNET32 is not set +CONFIG_AMD8111_ETH=m +CONFIG_PCNET32=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_NET_VENDOR_ARC=y CONFIG_NET_VENDOR_ATHEROS=y -# CONFIG_ATL2 is not set -# CONFIG_ATL1 is not set -# CONFIG_ATL1E is not set -# CONFIG_ATL1C is not set -# CONFIG_ALX is not set +CONFIG_ATL2=m +CONFIG_ATL1=m +CONFIG_ATL1E=m +CONFIG_ATL1C=m +CONFIG_ALX=m CONFIG_NET_VENDOR_BROADCOM=y -# CONFIG_B44 is not set -# CONFIG_BCMGENET is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set +CONFIG_B44=m +CONFIG_B44_PCI_AUTOSELECT=y +CONFIG_B44_PCICORE_AUTOSELECT=y +CONFIG_B44_PCI=y +CONFIG_BCMGENET=m +CONFIG_BNX2=m +CONFIG_CNIC=m CONFIG_TIGON3=m CONFIG_TIGON3_HWMON=y -# CONFIG_BNX2X is not set -# CONFIG_SYSTEMPORT is not set -# CONFIG_BNXT is not set +CONFIG_BNX2X=m +CONFIG_BNX2X_SRIOV=y +CONFIG_SYSTEMPORT=m +CONFIG_BNXT=m +CONFIG_BNXT_SRIOV=y +CONFIG_BNXT_FLOWER_OFFLOAD=y +CONFIG_BNXT_HWMON=y CONFIG_NET_VENDOR_CADENCE=y CONFIG_NET_VENDOR_CAVIUM=y # CONFIG_THUNDER_NIC_PF is not set @@ -2333,160 +2346,224 @@ CONFIG_NET_VENDOR_CAVIUM=y # CONFIG_LIQUIDIO is not set # CONFIG_LIQUIDIO_VF is not set CONFIG_NET_VENDOR_CHELSIO=y -# CONFIG_CHELSIO_T1 is not set -# CONFIG_CHELSIO_T3 is not set -# CONFIG_CHELSIO_T4 is not set -# CONFIG_CHELSIO_T4VF is not set +CONFIG_CHELSIO_T1=m +CONFIG_CHELSIO_T1_1G=y +CONFIG_CHELSIO_T3=m +CONFIG_CHELSIO_T4=m +CONFIG_CHELSIO_T4VF=m +CONFIG_CHELSIO_INLINE_CRYPTO=y +CONFIG_CHELSIO_IPSEC_INLINE=m CONFIG_NET_VENDOR_CISCO=y -# CONFIG_ENIC is not set +CONFIG_ENIC=m CONFIG_NET_VENDOR_CORTINA=y -# CONFIG_GEMINI_ETHERNET is not set +CONFIG_GEMINI_ETHERNET=m # CONFIG_DNET is not set CONFIG_NET_VENDOR_DEC=y CONFIG_NET_TULIP=y -# CONFIG_DE2104X is not set +CONFIG_DE2104X=m +CONFIG_DE2104X_DSL=0 CONFIG_TULIP=m # CONFIG_TULIP_MWI is not set # CONFIG_TULIP_MMIO is not set # CONFIG_TULIP_NAPI is not set -# CONFIG_DE4X5 is not set -# CONFIG_WINBOND_840 is not set -# CONFIG_DM9102 is not set -# CONFIG_ULI526X is not set +CONFIG_DE4X5=m +CONFIG_WINBOND_840=m +CONFIG_DM9102=m +CONFIG_ULI526X=m CONFIG_NET_VENDOR_DLINK=y -# CONFIG_DL2K is not set -# CONFIG_SUNDANCE is not set +CONFIG_DL2K=m +CONFIG_SUNDANCE=m +# CONFIG_SUNDANCE_MMIO is not set CONFIG_NET_VENDOR_EMULEX=y -# CONFIG_BE2NET is not set +CONFIG_BE2NET=m +CONFIG_BE2NET_HWMON=y +CONFIG_BE2NET_BE2=y +CONFIG_BE2NET_BE3=y +CONFIG_BE2NET_LANCER=y +CONFIG_BE2NET_SKYHAWK=y CONFIG_NET_VENDOR_EZCHIP=y -# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set +CONFIG_EZCHIP_NPS_MANAGEMENT_ENET=m CONFIG_NET_VENDOR_GOOGLE=y CONFIG_NET_VENDOR_HUAWEI=y CONFIG_NET_VENDOR_I825XX=y CONFIG_NET_VENDOR_IBM=y CONFIG_IBMVETH=m -# CONFIG_IBM_EMAC is not set -# CONFIG_EHEA is not set +CONFIG_IBM_EMAC=m +CONFIG_IBM_EMAC_RXB=128 +CONFIG_IBM_EMAC_TXB=64 +CONFIG_IBM_EMAC_POLL_WEIGHT=32 +CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256 +# CONFIG_IBM_EMAC_DEBUG is not set +CONFIG_IBM_EMAC_ZMII=y +CONFIG_IBM_EMAC_RGMII=y +CONFIG_IBM_EMAC_TAH=y +CONFIG_IBM_EMAC_EMAC4=y +CONFIG_EHEA=m CONFIG_IBMVNIC=m CONFIG_NET_VENDOR_INTEL=y -# CONFIG_E100 is not set +CONFIG_E100=m CONFIG_E1000=m CONFIG_E1000E=m CONFIG_IGB=m CONFIG_IGB_HWMON=y -# CONFIG_IGBVF is not set +CONFIG_IGBVF=m CONFIG_IXGB=m -# CONFIG_IXGBE is not set -# CONFIG_IXGBEVF is not set -# CONFIG_I40E is not set -# CONFIG_I40EVF is not set -# CONFIG_ICE is not set -# CONFIG_FM10K is not set -# CONFIG_IGC is not set -# CONFIG_JME is not set +CONFIG_IXGBE=m +CONFIG_IXGBE_HWMON=y +CONFIG_IXGBE_IPSEC=y +CONFIG_IXGBEVF=m +CONFIG_IXGBEVF_IPSEC=y +CONFIG_I40E=m +CONFIG_IAVF=m +CONFIG_I40EVF=m +CONFIG_ICE=m +CONFIG_FM10K=m +CONFIG_IGC=m +CONFIG_JME=m CONFIG_NET_VENDOR_LITEX=y CONFIG_LITEX_LITEETH=m CONFIG_NET_VENDOR_MARVELL=y -# CONFIG_MVMDIO is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set +CONFIG_MVMDIO=m +CONFIG_SKGE=m +# CONFIG_SKGE_DEBUG is not set +# CONFIG_SKGE_GENESIS is not set +CONFIG_SKY2=m +# CONFIG_SKY2_DEBUG is not set CONFIG_NET_VENDOR_MELLANOX=y -# CONFIG_MLX4_EN is not set -# CONFIG_MLX5_CORE is not set +CONFIG_MLX4_EN=m +CONFIG_MLX4_CORE=m +CONFIG_MLX4_DEBUG=y +CONFIG_MLX4_CORE_GEN2=y +CONFIG_MLX5_CORE=m +CONFIG_MLX5_ACCEL=y +CONFIG_MLX5_FPGA=y +CONFIG_MLX5_CORE_EN=y +CONFIG_MLX5_EN_ARFS=y +CONFIG_MLX5_EN_RXNFC=y +CONFIG_MLX5_MPFS=y +# CONFIG_MLX5_CORE_IPOIB is not set +# CONFIG_MLX5_FPGA_IPSEC is not set +# CONFIG_MLX5_IPSEC is not set +# CONFIG_MLX5_SF is not set # CONFIG_MLXSW_CORE is not set # CONFIG_MLXFW is not set CONFIG_NET_VENDOR_MICREL=y -# CONFIG_KS8851_MLL is not set -# CONFIG_KSZ884X_PCI is not set +CONFIG_KS8851_MLL=m +CONFIG_KSZ884X_PCI=m CONFIG_NET_VENDOR_MICROCHIP=y -# CONFIG_LAN743X is not set +CONFIG_LAN743X=m CONFIG_NET_VENDOR_MICROSEMI=y CONFIG_NET_VENDOR_MICROSOFT=y CONFIG_NET_VENDOR_MYRI=y -# CONFIG_MYRI10GE is not set -# CONFIG_FEALNX is not set +CONFIG_MYRI10GE=m +CONFIG_FEALNX=m CONFIG_NET_VENDOR_NI=y -# CONFIG_NI_XGE_MANAGEMENT_ENET is not set +CONFIG_NI_XGE_MANAGEMENT_ENET=m CONFIG_NET_VENDOR_NATSEMI=y -# CONFIG_NATSEMI is not set -# CONFIG_NS83820 is not set +CONFIG_NATSEMI=m +CONFIG_NS83820=m CONFIG_NET_VENDOR_NETERION=y -# CONFIG_S2IO is not set -# CONFIG_VXGE is not set +CONFIG_S2IO=m +CONFIG_VXGE=m +# CONFIG_VXGE_DEBUG_TRACE_ALL is not set CONFIG_NET_VENDOR_NETRONOME=y -# CONFIG_NFP is not set +CONFIG_NFP=m +# CONFIG_NFP_DEBUG is not set CONFIG_NET_VENDOR_8390=y -# CONFIG_NE2K_PCI is not set +CONFIG_NE2K_PCI=m CONFIG_NET_VENDOR_NVIDIA=y -# CONFIG_FORCEDETH is not set +CONFIG_FORCEDETH=m CONFIG_NET_VENDOR_OKI=y -# CONFIG_ETHOC is not set +CONFIG_ETHOC=m CONFIG_NET_VENDOR_PACKET_ENGINES=y -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set +CONFIG_HAMACHI=m +CONFIG_YELLOWFIN=m CONFIG_NET_VENDOR_PENSANDO=y -# CONFIG_IONIC is not set +CONFIG_IONIC=m CONFIG_NET_VENDOR_QLOGIC=y -# CONFIG_QLA3XXX is not set -# CONFIG_QLCNIC is not set -# CONFIG_NETXEN_NIC is not set -# CONFIG_QED is not set +CONFIG_QLA3XXX=m +CONFIG_QLCNIC=m +CONFIG_QLCNIC_SRIOV=y +CONFIG_QLCNIC_HWMON=y +CONFIG_NETXEN_NIC=m +CONFIG_QED=m +CONFIG_QED_SRIOV=y +CONFIG_QEDE=m CONFIG_NET_VENDOR_BROCADE=y -# CONFIG_BNA is not set +CONFIG_BNA=m CONFIG_NET_VENDOR_QUALCOMM=y -# CONFIG_QCOM_EMAC is not set +CONFIG_QCOM_EMAC=m # CONFIG_RMNET is not set CONFIG_NET_VENDOR_RDC=y -# CONFIG_R6040 is not set +CONFIG_R6040=m CONFIG_NET_VENDOR_REALTEK=y -# CONFIG_8139CP is not set -# CONFIG_8139TOO is not set -# CONFIG_R8169 is not set +CONFIG_8139CP=m +CONFIG_8139TOO=m +# CONFIG_8139TOO_PIO is not set +CONFIG_8139TOO_TUNE_TWISTER=y +CONFIG_8139TOO_8129=y +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_R8169=m CONFIG_NET_VENDOR_RENESAS=y CONFIG_NET_VENDOR_ROCKER=y CONFIG_NET_VENDOR_SAMSUNG=y -# CONFIG_SXGBE_ETH is not set +CONFIG_SXGBE_ETH=m CONFIG_NET_VENDOR_SEEQ=y CONFIG_NET_VENDOR_SILAN=y -# CONFIG_SC92031 is not set +CONFIG_SC92031=m CONFIG_NET_VENDOR_SIS=y -# CONFIG_SIS900 is not set -# CONFIG_SIS190 is not set +CONFIG_SIS900=m +CONFIG_SIS190=m CONFIG_NET_VENDOR_SOLARFLARE=y -# CONFIG_SFC is not set -# CONFIG_SFC_FALCON is not set +CONFIG_SFC=m +CONFIG_SFC_MTD=y +CONFIG_SFC_MCDI_MON=y +CONFIG_SFC_SRIOV=y +CONFIG_SFC_MCDI_LOGGING=y +CONFIG_SFC_FALCON=m +CONFIG_SFC_FALCON_MTD=y CONFIG_NET_VENDOR_SMSC=y -# CONFIG_EPIC100 is not set -# CONFIG_SMSC911X is not set -# CONFIG_SMSC9420 is not set +CONFIG_EPIC100=m +CONFIG_SMSC911X=m +CONFIG_SMSC9420=m CONFIG_NET_VENDOR_SOCIONEXT=y CONFIG_NET_VENDOR_STMICRO=y -# CONFIG_STMMAC_ETH is not set +CONFIG_STMMAC_ETH=m +# CONFIG_STMMAC_SELFTESTS is not set +CONFIG_STMMAC_PLATFORM=m +# CONFIG_DWMAC_DWC_QOS_ETH is not set +CONFIG_DWMAC_GENERIC=m CONFIG_NET_VENDOR_SUN=y -# CONFIG_HAPPYMEAL is not set +CONFIG_HAPPYMEAL=m CONFIG_SUNGEM=m -# CONFIG_CASSINI is not set -# CONFIG_NIU is not set +CONFIG_CASSINI=m +CONFIG_NIU=m CONFIG_NET_VENDOR_SYNOPSYS=y -# CONFIG_DWC_XLGMAC is not set +CONFIG_DWC_XLGMAC=m +CONFIG_DWC_XLGMAC_PCI=m CONFIG_NET_VENDOR_TEHUTI=y -# CONFIG_TEHUTI is not set +CONFIG_TEHUTI=m CONFIG_NET_VENDOR_TI=y # CONFIG_TI_CPSW_PHY_SEL is not set -# CONFIG_TLAN is not set +CONFIG_TLAN=m CONFIG_NET_VENDOR_TOSHIBA=y -# CONFIG_GELIC_NET is not set -# CONFIG_SPIDER_NET is not set +CONFIG_GELIC_NET=m +CONFIG_GELIC_WIRELESS=y +CONFIG_SPIDER_NET=m CONFIG_NET_VENDOR_VIA=y -# CONFIG_VIA_RHINE is not set -# CONFIG_VIA_VELOCITY is not set +CONFIG_VIA_RHINE=m +# CONFIG_VIA_RHINE_MMIO is not set +CONFIG_VIA_VELOCITY=m CONFIG_NET_VENDOR_WIZNET=y -# CONFIG_WIZNET_W5100 is not set -# CONFIG_WIZNET_W5300 is not set +CONFIG_WIZNET_W5100=m +CONFIG_WIZNET_W5300=m +# CONFIG_WIZNET_BUS_DIRECT is not set +# CONFIG_WIZNET_BUS_INDIRECT is not set +CONFIG_WIZNET_BUS_ANY=y CONFIG_NET_VENDOR_XILINX=y CONFIG_XILINX_EMACLITE=m CONFIG_XILINX_AXI_EMAC=m -# CONFIG_XILINX_LL_TEMAC is not set +CONFIG_XILINX_LL_TEMAC=m # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PHYLINK=m @@ -2505,7 +2582,7 @@ CONFIG_FIXED_PHY=m # CONFIG_AX88796B_PHY is not set # CONFIG_BROADCOM_PHY is not set CONFIG_BCM54140_PHY=m -# CONFIG_BCM7XXX_PHY is not set +CONFIG_BCM7XXX_PHY=m CONFIG_BCM84881_PHY=m # CONFIG_BCM87XX_PHY is not set CONFIG_BCM_NET_PHYLIB=m @@ -2521,7 +2598,7 @@ CONFIG_BCM_NET_PHYLIB=m CONFIG_MARVELL_88X2222_PHY=m CONFIG_MAXLINEAR_GPHY=m CONFIG_MEDIATEK_GE_PHY=m -# CONFIG_MICREL_PHY is not set +CONFIG_MICREL_PHY=m # CONFIG_MICROCHIP_PHY is not set # CONFIG_MICROCHIP_T1_PHY is not set # CONFIG_MICROSEMI_PHY is not set @@ -2530,10 +2607,10 @@ CONFIG_MOTORCOMM_PHY=m CONFIG_NXP_C45_TJA11XX_PHY=m # CONFIG_NXP_TJA11XX_PHY is not set # CONFIG_QSEMI_PHY is not set -# CONFIG_REALTEK_PHY is not set +CONFIG_REALTEK_PHY=m # CONFIG_RENESAS_PHY is not set # CONFIG_ROCKCHIP_PHY is not set -# CONFIG_SMSC_PHY is not set +CONFIG_SMSC_PHY=m # CONFIG_STE10XP is not set # CONFIG_TERANETICS_PHY is not set # CONFIG_DP83822_PHY is not set @@ -2549,11 +2626,12 @@ CONFIG_FWNODE_MDIO=m CONFIG_OF_MDIO=m CONFIG_MDIO_DEVRES=m # CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BCM_UNIMAC is not set +CONFIG_MDIO_BCM_UNIMAC=m # CONFIG_MDIO_HISI_FEMAC is not set CONFIG_MDIO_MVUSB=m # CONFIG_MDIO_MSCC_MIIM is not set # CONFIG_MDIO_OCTEON is not set +# CONFIG_MDIO_IPQ8064 is not set # CONFIG_MDIO_THUNDER is not set # @@ -2565,7 +2643,7 @@ CONFIG_MDIO_MVUSB=m # # PCS device drivers # -# CONFIG_PCS_XPCS is not set +CONFIG_PCS_XPCS=m # end of PCS device drivers CONFIG_PPP=m @@ -2662,6 +2740,7 @@ CONFIG_WIL6210_DEBUGFS=y CONFIG_ATH10K=m CONFIG_ATH10K_CE=y CONFIG_ATH10K_PCI=m +# CONFIG_ATH10K_AHB is not set CONFIG_ATH10K_SDIO=m CONFIG_ATH10K_USB=m # CONFIG_ATH10K_DEBUG is not set @@ -3461,7 +3540,7 @@ CONFIG_BCMA_DRIVER_PCI=y # CONFIG_MFD_SM501 is not set # CONFIG_MFD_SKY81452 is not set # CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set +CONFIG_MFD_SYSCON=y # CONFIG_MFD_TI_AM335X_TSCADC is not set # CONFIG_MFD_LP3943 is not set # CONFIG_MFD_LP8788 is not set @@ -4197,6 +4276,7 @@ CONFIG_DRM_PANEL=y # # Display Panels # +# CONFIG_DRM_PANEL_ARM_VERSATILE is not set # CONFIG_DRM_PANEL_LVDS is not set # CONFIG_DRM_PANEL_SIMPLE is not set # CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set @@ -4951,6 +5031,7 @@ CONFIG_LEDS_CLASS=y # # CONFIG_LEDS_BLINKM is not set # CONFIG_LEDS_POWERNV is not set +# CONFIG_LEDS_SYSCON is not set # CONFIG_LEDS_MLXREG is not set # CONFIG_LEDS_USER is not set # CONFIG_LEDS_TI_LMU_COMMON is not set @@ -5109,7 +5190,16 @@ CONFIG_SYNC_FILE=y # end of DMABUF options # CONFIG_AUXDISPLAY is not set -# CONFIG_UIO is not set +CONFIG_UIO=m +# CONFIG_UIO_CIF is not set +# CONFIG_UIO_PDRV_GENIRQ is not set +# CONFIG_UIO_DMEM_GENIRQ is not set +# CONFIG_UIO_AEC is not set +# CONFIG_UIO_SERCOS3 is not set +# CONFIG_UIO_PCI_GENERIC is not set +# CONFIG_UIO_NETX is not set +# CONFIG_UIO_PRUSS is not set +# CONFIG_UIO_MF624 is not set CONFIG_VFIO=m CONFIG_VFIO_IOMMU_SPAPR_TCE=m CONFIG_VFIO_SPAPR_EEH=m @@ -5262,7 +5352,8 @@ CONFIG_IRQCHIP=y # end of IRQ chip support # CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set +CONFIG_RESET_CONTROLLER=y +# CONFIG_RESET_TI_SYSCON is not set # # PHY Subsystem @@ -5276,6 +5367,7 @@ CONFIG_IRQCHIP=y # CONFIG_PHY_MIXEL_MIPI_DPHY is not set # CONFIG_PHY_PXA_28NM_HSIC is not set # CONFIG_PHY_PXA_28NM_USB2 is not set +# CONFIG_PHY_OCELOT_SERDES is not set # end of PHY Subsystem # CONFIG_POWERCAP is not set @@ -5899,7 +5991,7 @@ CONFIG_CRC64=m # CONFIG_CRC4 is not set CONFIG_CRC7=m CONFIG_LIBCRC32C=y -# CONFIG_CRC8 is not set +CONFIG_CRC8=m CONFIG_XXHASH=y # CONFIG_RANDOM32_SELFTEST is not set CONFIG_ZLIB_INFLATE=y @@ -5958,6 +6050,7 @@ CONFIG_NLATTR=y CONFIG_CLZ_TAB=y CONFIG_IRQ_POLL=y CONFIG_MPILIB=y +CONFIG_DIMLIB=y CONFIG_LIBFDT=y CONFIG_OID_REGISTRY=y CONFIG_HAVE_GENERIC_VDSO=y @@ -5976,6 +6069,8 @@ CONFIG_ARCH_STACKWALK=y CONFIG_SBITMAP=y # end of Library routines +CONFIG_PLDMFW=y + # # Kernel hacking # diff --git a/system/easy-kernel/config-x86_64 b/system/easy-kernel/config-x86_64 index f3b185b5b..e297591bc 100644 --- a/system/easy-kernel/config-x86_64 +++ b/system/easy-kernel/config-x86_64 @@ -1,15 +1,15 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 5.15.132-mc6 Kernel Configuration +# Linux/x86_64 5.15.132-mc6 Kernel Configuration # CONFIG_CC_VERSION_TEXT="gcc (Adelie 8.5.0) 8.5.0" CONFIG_CC_IS_GCC=y CONFIG_GCC_VERSION=80500 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23200 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23200 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -318,6 +318,7 @@ CONFIG_X86_64_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=4 +CONFIG_CC_HAS_SANE_STACKPROTECTOR=y # # Processor type and features @@ -520,11 +521,15 @@ CONFIG_MODIFY_LDT_SYSCALL=y CONFIG_HAVE_LIVEPATCH=y # end of Processor type and features +CONFIG_CC_HAS_RETURN_THUNK=y CONFIG_SPECULATION_MITIGATIONS=y CONFIG_PAGE_TABLE_ISOLATION=y CONFIG_RETPOLINE=y +CONFIG_RETHUNK=y +CONFIG_CPU_UNRET_ENTRY=y CONFIG_CPU_IBPB_ENTRY=y CONFIG_CPU_IBRS_ENTRY=y +CONFIG_CPU_SRSO=y # CONFIG_GDS_FORCE_MITIGATION is not set CONFIG_ARCH_HAS_ADD_PAGES=y CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y @@ -716,6 +721,10 @@ CONFIG_KVM=y CONFIG_KVM_INTEL=m CONFIG_KVM_AMD=m # CONFIG_KVM_XEN is not set +CONFIG_AS_AVX512=y +CONFIG_AS_SHA1_NI=y +CONFIG_AS_SHA256_NI=y +CONFIG_AS_TPAUSE=y # # General architecture-dependent options @@ -779,6 +788,9 @@ CONFIG_SECCOMP=y CONFIG_SECCOMP_FILTER=y # CONFIG_SECCOMP_CACHE_DEBUG is not set CONFIG_HAVE_ARCH_STACKLEAK=y +CONFIG_HAVE_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR_STRONG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y CONFIG_LTO_NONE=y @@ -2600,7 +2612,8 @@ CONFIG_MII=m CONFIG_NET_CORE=y CONFIG_BONDING=m CONFIG_DUMMY=m -# CONFIG_WIREGUARD is not set +CONFIG_WIREGUARD=m +# CONFIG_WIREGUARD_DEBUG is not set # CONFIG_EQUALIZER is not set # CONFIG_NET_FC is not set # CONFIG_IFB is not set @@ -7772,7 +7785,7 @@ CONFIG_CRYPTO_ECDH=m # CONFIG_CRYPTO_ECRDSA is not set # CONFIG_CRYPTO_SM2 is not set # CONFIG_CRYPTO_CURVE25519 is not set -# CONFIG_CRYPTO_CURVE25519_X86 is not set +CONFIG_CRYPTO_CURVE25519_X86=m # # Authenticated Encryption with Associated Data @@ -7820,7 +7833,7 @@ CONFIG_CRYPTO_CRC32=m # CONFIG_CRYPTO_CRC32_PCLMUL is not set CONFIG_CRYPTO_XXHASH=y CONFIG_CRYPTO_BLAKE2B=y -# CONFIG_CRYPTO_BLAKE2S_X86 is not set +CONFIG_CRYPTO_BLAKE2S_X86=y CONFIG_CRYPTO_CRCT10DIF=y # CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set CONFIG_CRYPTO_GHASH=m @@ -7958,17 +7971,20 @@ CONFIG_ARCH_USE_SYM_ANNOTATIONS=y # CONFIG_CRYPTO_LIB_AES=y CONFIG_CRYPTO_LIB_ARC4=m +CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m -# CONFIG_CRYPTO_LIB_CHACHA is not set -# CONFIG_CRYPTO_LIB_CURVE25519 is not set +CONFIG_CRYPTO_LIB_CHACHA=m +CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=m +CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=m +CONFIG_CRYPTO_LIB_CURVE25519=m CONFIG_CRYPTO_LIB_DES=m CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11 CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=m CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m -# CONFIG_CRYPTO_LIB_POLY1305 is not set -# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set +CONFIG_CRYPTO_LIB_POLY1305=m +CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m CONFIG_CRYPTO_LIB_SHA256=y # end of Crypto library routines diff --git a/system/execline/APKBUILD b/system/execline/APKBUILD index 9746c2a6b..d4d136a2e 100644 --- a/system/execline/APKBUILD +++ b/system/execline/APKBUILD @@ -1,16 +1,17 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=execline -pkgver=2.9.2.1 +pkgver=2.9.6.0 pkgrel=0 pkgdesc="A small scripting language for non-interactive scripts" -url="https://skarnet.org/software/$pkgname/" +url="https://skarnet.org/software/execline/" arch="all" options="!check" # No test suite. license="ISC" -_skalibs_version=2.13 -makedepends="skalibs-dev>=$_skalibs_version" -subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc" +_skalibs_version=2.14 +depends_dev="skalibs-dev>=$_skalibs_version" +makedepends="$depends_dev" +subpackages="$pkgname-libs $pkgname-dev $pkgname-doc" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz" build() { @@ -27,39 +28,8 @@ build() { package() { make DESTDIR="$pkgdir" install + mkdir -p -m 0755 "$pkgdir/usr/share/doc" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="skalibs-libs>=$_skalibs_version" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - - -dev() { - pkgdesc="$pkgdesc (development files)" - depends="skalibs-dev>=$_skalibs_version" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr" - mv "$pkgdir/usr/lib" "$pkgdir/usr/include" "$subpkgdir/usr/" -} - - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" -} - -sha512sums="6dbe37fd73ec0bba89e1fc539e27f34fdbcf6028a4053e762cd21036e1a131e0156022bf84467ecba3cdbb4dfba7ee30574283d31e7e228e175775e8e16c1000 execline-2.9.2.1.tar.gz" +sha512sums="1c5233b0f17b4c92ab2e9e8700b47c8429ad97962bcb7c83190d0b3251b26584e591d77418eca77e8112cdecd24eec50aaca7da1dbb506120931bbda39f2b7cb execline-2.9.6.0.tar.gz" diff --git a/system/file/APKBUILD b/system/file/APKBUILD index 39c1da51e..47e781590 100644 --- a/system/file/APKBUILD +++ b/system/file/APKBUILD @@ -2,7 +2,7 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> pkgname=file -pkgver=5.44 +pkgver=5.45 pkgrel=0 pkgdesc="File type identification utility" url="http://www.darwinsys.com/file/" @@ -41,4 +41,4 @@ libmagic() { mv "$pkgdir"/usr/lib "$pkgdir"/usr/share "$subpkgdir"/usr } -sha512sums="547429f30105a1c96604b67440cbd1c52f684d8ce6b26e2413dd54ede8aadb2ffb489b52e67bfab9ff5a48133f0aa0589873e58dc7c6c0a10a59571cf9850b95 file-5.44.tar.gz" +sha512sums="fdd4c5d13d5ea1d25686c76d8ebc3252c54040c4871e3f0f623c4548b3841795d4e36050292a9453eedf0fbf932573890e9d6ac9fa63ccf577215598ae84b9ea file-5.45.tar.gz" diff --git a/system/gcc/0008-s390x-muslldso.patch b/system/gcc/0008-s390x-muslldso.patch deleted file mode 100644 index 64833f308..000000000 --- a/system/gcc/0008-s390x-muslldso.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b693804c8dba92fea7beee98f0aa520853a0532b Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <nsz@port70.net> -Date: Thu, 22 Dec 2016 11:22:28 +0000 -Subject: [PATCH 08/12] s390x muslldso - ---- - gcc/config/s390/linux.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h -index 525c17c2c9f..2d4f4a0654e 100644 ---- a/gcc/config/s390/linux.h -+++ b/gcc/config/s390/linux.h -@@ -76,6 +76,9 @@ along with GCC; see the file COPYING3. If not see - #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" - #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1" - -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1" -+ - #undef LINK_SPEC - #define LINK_SPEC \ - "%{m31:-m elf_s390}%{m64:-m elf64_s390} \ --- -2.17.1 - diff --git a/system/gcc/0009-microblaze-pr65649.patch b/system/gcc/0009-microblaze-pr65649.patch deleted file mode 100644 index 35bf88d69..000000000 --- a/system/gcc/0009-microblaze-pr65649.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a0934d40a8ed3b6e82abb31d2f8d7c60548d4a05 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <nsz@port70.net> -Date: Fri, 26 Jan 2018 20:25:11 +0000 -Subject: [PATCH 09/12] microblaze-pr65649 - ---- - gcc/config/microblaze/microblaze.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c -index 9a4a287be23..60aadaf51f7 100644 ---- a/gcc/config/microblaze/microblaze.c -+++ b/gcc/config/microblaze/microblaze.c -@@ -2399,7 +2399,7 @@ print_operand (FILE * file, rtx op, int letter) - unsigned long value_long; - REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op), - value_long); -- fprintf (file, HOST_WIDE_INT_PRINT_HEX, value_long); -+ fprintf (file, "0x%lx", value_long); - } - else - { -@@ -2458,7 +2458,7 @@ print_operand (FILE * file, rtx op, int letter) - print_operand_address (file, XEXP (op, 0)); - } - else if (letter == 'm') -- fprintf (file, HOST_WIDE_INT_PRINT_DEC, (1L << INTVAL (op))); -+ fprintf (file, "%ld", (1L << INTVAL (op))); - else - output_addr_const (file, op); - } --- -2.17.1 - diff --git a/system/gcc/0010-ldbl128-config.patch b/system/gcc/0010-ldbl128-config.patch deleted file mode 100644 index b5a101052..000000000 --- a/system/gcc/0010-ldbl128-config.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 47467f3ab0fb2f2fcede81060fe8bb339d0909eb Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <nsz@port70.net> -Date: Wed, 28 Feb 2018 00:54:05 +0000 -Subject: [PATCH 10/12] ldbl128 config - ---- - gcc/configure | 13 +++++++++++++ - gcc/configure.ac | 16 ++++++++++++++-- - 2 files changed, 27 insertions(+), 2 deletions(-) - -diff --git a/gcc/configure b/gcc/configure -index 6121e163259..07ff8597d48 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -29309,6 +29309,15 @@ if test "${with_long_double_128+set}" = set; then : - withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128" - else - -+ case "$target" in -+ s390*-*-linux-musl*) -+ gcc_cv_target_ldbl128=yes -+ ;; -+ powerpc*-*-linux-musl*) -+ gcc_cv_target_ldbl128=no -+ ;; -+ *) -+ - if test $glibc_version_major -gt 2 \ - || ( test $glibc_version_major -eq 2 && test $glibc_version_minor -ge 4 ); then : - gcc_cv_target_ldbl128=yes -@@ -29320,6 +29329,10 @@ else - && gcc_cv_target_ldbl128=yes - - fi -+ -+ ;; -+ esac -+ - fi - - ;; -diff --git a/gcc/configure.ac b/gcc/configure.ac -index b066cc609e1..6c15ed898c0 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -5971,13 +5971,25 @@ case "$target" in - AC_ARG_WITH(long-double-128, - [AS_HELP_STRING([--with-long-double-128], - [use 128-bit long double by default])], -- gcc_cv_target_ldbl128="$with_long_double_128", -+ gcc_cv_target_ldbl128="$with_long_double_128", [ -+ case "$target" in -+ s390*-*-linux-musl*) -+ gcc_cv_target_ldbl128=yes -+ ;; -+ powerpc*-*-linux-musl*) -+ gcc_cv_target_ldbl128=no -+ ;; -+ *)] - [GCC_GLIBC_VERSION_GTE_IFELSE([2], [4], [gcc_cv_target_ldbl128=yes], [ - [gcc_cv_target_ldbl128=no - grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ - $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \ - && gcc_cv_target_ldbl128=yes -- ]])]) -+ ]])] -+ [ -+ ;; -+ esac -+ ]) - ;; - esac - if test x$gcc_cv_target_ldbl128 = xyes; then --- -2.17.1 - diff --git a/system/gcc/0011-m68k.patch b/system/gcc/0011-m68k.patch deleted file mode 100644 index 74a5a98da..000000000 --- a/system/gcc/0011-m68k.patch +++ /dev/null @@ -1,40 +0,0 @@ -From cc44e95053140efe41212746882d410052b480a3 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <nsz@port70.net> -Date: Sun, 1 Jul 2018 18:34:01 +0000 -Subject: [PATCH 11/12] m68k - ---- - gcc/config/m68k/linux.h | 3 +++ - libgcc/config/m68k/linux-unwind.h | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h -index f584d19e179..a3c215550fe 100644 ---- a/gcc/config/m68k/linux.h -+++ b/gcc/config/m68k/linux.h -@@ -73,6 +73,9 @@ along with GCC; see the file COPYING3. If not see - - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" - -+#undef MUSL_DYNAMIC_LINKER -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" -+ - #undef LINK_SPEC - #define LINK_SPEC "-m m68kelf %{shared} \ - %{!shared: \ -diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h -index 395e4b3212a..432b757541c 100644 ---- a/libgcc/config/m68k/linux-unwind.h -+++ b/libgcc/config/m68k/linux-unwind.h -@@ -37,7 +37,7 @@ struct uw_ucontext { - stack_t uc_stack; - mcontext_t uc_mcontext; - unsigned long uc_filler[80]; -- __sigset_t uc_sigmask; -+ sigset_t uc_sigmask; - }; - - #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state --- -2.17.1 - diff --git a/system/gcc/0012-static-pie.patch b/system/gcc/0012-static-pie.patch index 0600c791e..5c7a1b519 100644 --- a/system/gcc/0012-static-pie.patch +++ b/system/gcc/0012-static-pie.patch @@ -13,14 +13,14 @@ an alias to -static -pie. gcc/common.opt | 4 ++-- gcc/config/gnu-user.h | 12 +++++------- gcc/config/rs6000/sysv4.h | 11 +++++------ - gcc/gcc.c | 6 +++--- + gcc/gcc.cc | 6 +++--- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index b52ef0b38c8..0ce5857e01d 100644 --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -3197,11 +3197,11 @@ Driver +@@ -3669,11 +3669,11 @@ Driver no-pie Driver RejectNegative Negative(shared) @@ -38,7 +38,7 @@ diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h index 8620de3e42d..235328a2642 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h -@@ -52,13 +52,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +@@ -51,13 +51,12 @@ #define GNU_USER_TARGET_STARTFILE_SPEC \ "%{shared:; \ pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ @@ -46,8 +46,8 @@ index 8620de3e42d..235328a2642 100644 - static-pie:rcrt1.o%s; \ + static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ " PIE_SPEC ":Scrt1.o%s; \ - :crt1.o%s} \ - crti.o%s \ + :crt1.o%s} " \ + GNU_USER_TARGET_CRTI " \ - %{static:crtbeginT.o%s; \ - shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ + %{shared|" PIE_SPEC ":crtbeginS.o%s; \ @@ -55,7 +55,7 @@ index 8620de3e42d..235328a2642 100644 :crtbegin.o%s} \ %{fvtable-verify=none:%s; \ fvtable-verify=preinit:vtv_start_preinit.o%s; \ -@@ -92,8 +91,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +@@ -76,8 +75,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see "%{fvtable-verify=none:%s; \ fvtable-verify=preinit:vtv_end_preinit.o%s; \ fvtable-verify=std:vtv_end.o%s} \ @@ -63,9 +63,9 @@ index 8620de3e42d..235328a2642 100644 - shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ + %{shared|" PIE_SPEC ":crtendS.o%s; \ :crtend.o%s} \ - crtn.o%s \ - " CRTOFFLOADEND -@@ -133,7 +131,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + GNU_USER_TARGET_CRTN " " \ + CRTOFFLOADEND +@@ -106,7 +104,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC #if defined(HAVE_LD_EH_FRAME_HDR) @@ -73,43 +73,12 @@ index 8620de3e42d..235328a2642 100644 +#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " #endif - #undef LINK_GCC_C_SEQUENCE_SPEC -diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h -index bb19d0dcd41..bb2a2324eb0 100644 ---- a/gcc/config/rs6000/sysv4.h -+++ b/gcc/config/rs6000/sysv4.h -@@ -763,12 +763,12 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) - #define STARTFILE_LINUX_SPEC \ - "%{shared:; \ - pg|p|profile:gcrt1.o%s; \ -- static:crt1.o%s; \ -- static-pie|" PIE_SPEC ":Scrt1.o%s; \ -+ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ -+ " PIE_SPEC ":Scrt1.o%s; \ - :crt1.o%s} \ - %{mnewlib:ecrti.o%s;:crti.o%s} \ -- %{static:crtbeginT.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ -+ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ -+ static:crtbeginT.o%s; \ - :crtbegin.o%s} \ - %{fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_start_preinit.o%s; \ -@@ -781,8 +781,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) - "%{fvtable-verify=none:%s; \ - fvtable-verify=preinit:vtv_end_preinit.o%s; \ - fvtable-verify=std:vtv_end.o%s} \ -- %{static:crtend.o%s; \ -- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ -+ %{shared|" PIE_SPEC ":crtendS.o%s; \ - :crtend.o%s} \ - %{mnewlib:ecrtn.o%s;:crtn.o%s} \ - " CRTOFFLOADEND -diff --git a/gcc/gcc.c b/gcc/gcc.c + #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ +diff --git a/gcc/gcc.cc b/gcc/gcc.cc index eb1610ba8b0..87560afb03c 100644 ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -900,7 +900,7 @@ proper position among the other output files. */ +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1003,7 +1003,7 @@ proper position among the other output files. */ #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" #else @@ -118,7 +87,7 @@ index eb1610ba8b0..87560afb03c 100644 #define FPIE1_SPEC "fpie" #define NO_FPIE1_SPEC FPIE1_SPEC ":;" #define FPIE2_SPEC "fPIE" -@@ -924,12 +924,12 @@ proper position among the other output files. */ +@@ -1027,12 +1027,12 @@ proper position among the other output files. */ #ifndef LINK_PIE_SPEC #ifdef HAVE_LD_PIE #ifndef LD_PIE_SPEC @@ -135,4 +104,3 @@ index eb1610ba8b0..87560afb03c 100644 #ifndef LINK_BUILDID_SPEC -- 2.17.1 - diff --git a/system/gcc/0016-invalid-tls-model.patch b/system/gcc/0016-invalid-tls-model.patch deleted file mode 100644 index d3b2b8ea0..000000000 --- a/system/gcc/0016-invalid-tls-model.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- gcc-7.3.0/libgomp/configure.tgt.orig 2018-09-25 13:44:16.654561098 -0400 -+++ gcc-7.3.0/libgomp/configure.tgt 2018-09-25 13:44:50.452688100 -0400 -@@ -10,23 +10,6 @@ - # XCFLAGS Add extra compile flags to use. - # XLDFLAGS Add extra link flags to use. - --# Optimize TLS usage by avoiding the overhead of dynamic allocation. --if test $gcc_cv_have_tls = yes ; then -- case "${target}" in -- -- *-*-k*bsd*-gnu*) -- ;; -- -- *-*-linux* | *-*-gnu*) -- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec" -- ;; -- -- *-*-rtems*) -- XCFLAGS="${XCFLAGS} -ftls-model=local-exec" -- ;; -- esac --fi -- - # Since we require POSIX threads, assume a POSIX system by default. - config_path="posix" - ---- gcc-7.3.0/libitm/configure.tgt.orig 2018-09-25 13:47:31.019296903 -0400 -+++ gcc-7.3.0/libitm/configure.tgt 2018-09-25 13:47:37.676322335 -0400 -@@ -27,22 +27,6 @@ - # XCFLAGS Add extra compile flags to use. - # XLDFLAGS Add extra link flags to use. - --# Optimize TLS usage by avoiding the overhead of dynamic allocation. --if test "$gcc_cv_have_tls" = yes ; then -- case "${target}" in -- -- # For x86, we use slots in the TCB head for most of our TLS. -- # The setup of those slots in beginTransaction can afford to -- # use the global-dynamic model. -- i[456]86-*-linux* | x86_64-*-linux*) -- ;; -- -- *-*-linux*) -- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec" -- ;; -- esac --fi -- - # Map the target cpu to an ARCH sub-directory. At the same time, - # work out any special compilation flags as necessary. - case "${target_cpu}" in diff --git a/system/gcc/002_all_default-relro.patch b/system/gcc/002_all_default-relro.patch index 284deef1a..6fbf7684d 100644 --- a/system/gcc/002_all_default-relro.patch +++ b/system/gcc/002_all_default-relro.patch @@ -19,11 +19,11 @@ Index: b/gcc/doc/invoke.texi @item -u @var{symbol} @opindex u Pretend the symbol @var{symbol} is undefined, to force linking of -Index: b/gcc/gcc.c +Index: b/gcc/gcc.cc =================================================================== ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -890,6 +890,7 @@ proper position among the other output f +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -1144,6 +1144,7 @@ proper position among the other output f "%{flto|flto=*:%<fcompare-debug*} \ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \ "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ diff --git a/system/gcc/005_all_default-as-needed.patch b/system/gcc/005_all_default-as-needed.patch index 00852197f..b02382c54 100644 --- a/system/gcc/005_all_default-as-needed.patch +++ b/system/gcc/005_all_default-as-needed.patch @@ -1,63 +1,77 @@ # DP: On linux targets pass --as-needed by default to the linker, but always # DP: link the sanitizer libraries with --no-as-needed. -Index: b/gcc/gcc.c +Index: b/gcc/gcc.cc =================================================================== ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -692,8 +692,11 @@ proper position among the other output f +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -754,8 +754,11 @@ proper position among the other output f #ifdef LIBASAN_EARLY_SPEC #define LIBASAN_SPEC STATIC_LIBASAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) -#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \ - "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \ +#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \ -+ " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libasan:--push-state --no-as-needed}" \ + " -lasan " \ + " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ -+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libasan:--pop-state}" \ STATIC_LIBASAN_LIBS #else #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -710,8 +713,11 @@ proper position among the other output f +@@ -772,8 +775,11 @@ + #ifdef LIBHWASAN_EARLY_SPEC + #define LIBHWASAN_SPEC STATIC_LIBHWASAN_LIBS + #elif defined(HAVE_LD_STATIC_DYNAMIC) +-#define LIBHWASAN_SPEC "%{static-libhwasan:" LD_STATIC_OPTION \ +- "} -lhwasan %{static-libhwasan:" LD_DYNAMIC_OPTION "}" \ ++#define LIBHWASAN_SPEC "%{static-libhwasan:" LD_STATIC_OPTION \ ++ " %{!static-libhwasan:--push-state --no-as-needed}" \ ++ " -lhwasan " \ ++ " %{static-libhwasan:" LD_DYNAMIC_OPTION "}" \ ++ " %{!static-libhwasan:--pop-state}" \ + STATIC_LIBHWASAN_LIBS + #else + #define LIBHWASAN_SPEC "-lhwasan" STATIC_LIBHWASAN_LIBS +@@ -790,8 +797,11 @@ proper position among the other output f #ifdef LIBTSAN_EARLY_SPEC #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) -#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \ - "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ +#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \ -+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libtsan:--push-state --no-as-needed}" \ + " -ltsan " \ + " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ -+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libtsan:--pop-state}" \ STATIC_LIBTSAN_LIBS #else #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -728,8 +734,11 @@ proper position among the other output f +@@ -808,8 +817,11 @@ proper position among the other output f #ifdef LIBLSAN_EARLY_SPEC #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS #elif defined(HAVE_LD_STATIC_DYNAMIC) -#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \ - "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ +#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \ -+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-liblsan:--push-state --no-as-needed}" \ + " -llsan " \ + " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ -+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-liblsan:--pop-state}" \ STATIC_LIBLSAN_LIBS #else #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -744,8 +753,11 @@ proper position among the other output f +@@ -824,8 +833,11 @@ proper position among the other output f #define STATIC_LIBUBSAN_LIBS \ " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" #ifdef HAVE_LD_STATIC_DYNAMIC -#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \ - "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ +#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \ -+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ ++ " %{!static-libubsan:--push-state --no-as-needed}" \ + " -lubsan " \ + " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ -+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ ++ " %{!static-libubsan:--pop-state}" \ STATIC_LIBUBSAN_LIBS #else #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS @@ -65,24 +79,30 @@ Index: b/gcc/config/gnu-user.h =================================================================== --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h -@@ -161,15 +161,15 @@ see the files COPYING3 and COPYING.RUNTI +@@ -135,20 +135,20 @@ see the files COPYING3 and COPYING.RUNTI #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \ "%{static-libasan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ - LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" -+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}" ++ LD_DYNAMIC_OPTION "}}%{!static-libasan:--push-state --no-as-needed -lasan --pop-state}" + #undef LIBHWASAN_EARLY_SPEC + #define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \ + "%{static-libhwasan:%{!shared:" \ + LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \ +- LD_DYNAMIC_OPTION "}}%{!static-libhwasan:-lhwasan}" ++ LD_DYNAMIC_OPTION "}}%{!static-libhwasan:--push-state --no-as-needed -lhwasan --pop-state}" #undef LIBTSAN_EARLY_SPEC #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \ "%{static-libtsan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ - LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}" -+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}" ++ LD_DYNAMIC_OPTION "}}%{!static-libtsan:--push-state --no-as-needed -ltsan --pop-state}" #undef LIBLSAN_EARLY_SPEC #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \ "%{static-liblsan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \ - LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}" -+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}" ++ LD_DYNAMIC_OPTION "}}%{!static-liblsan:--push-state --no-as-needed -llsan --pop-state}" #endif Index: b/gcc/config/aarch64/aarch64-linux.h =================================================================== @@ -113,7 +133,7 @@ Index: b/gcc/config/sparc/linux.h =================================================================== --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h -@@ -86,7 +86,7 @@ extern const char *host_detect_local_cpu +@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" #undef LINK_SPEC @@ -126,7 +146,7 @@ Index: b/gcc/config/s390/linux.h =================================================================== --- a/gcc/config/s390/linux.h +++ b/gcc/config/s390/linux.h -@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3. +@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. #undef LINK_SPEC #define LINK_SPEC \ @@ -139,7 +159,7 @@ Index: b/gcc/config/rs6000/linux64.h =================================================================== --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h -@@ -490,13 +490,13 @@ extern int dot_symbols; +@@ -377,13 +377,13 @@ extern int dot_symbols; " -m elf64ppc") #endif @@ -159,7 +179,7 @@ Index: b/gcc/config/rs6000/sysv4.h =================================================================== --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h -@@ -811,7 +811,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF +@@ -780,7 +780,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ MUSL_DYNAMIC_LINKER) @@ -184,7 +204,7 @@ Index: b/gcc/config/i386/gnu-user.h =================================================================== --- a/gcc/config/i386/gnu-user.h +++ b/gcc/config/i386/gnu-user.h -@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3. +@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. { "link_emulation", GNU_USER_LINK_EMULATION },\ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER } diff --git a/system/gcc/006_as-needed-gold.patch b/system/gcc/006_as-needed-gold.patch deleted file mode 100644 index 3dc0aee7a..000000000 --- a/system/gcc/006_as-needed-gold.patch +++ /dev/null @@ -1,58 +0,0 @@ -# DP: Use --push-state/--pop-state for gold as well when linking libtsan. - -Index: src/gcc/gcc.c -=================================================================== ---- src/gcc/gcc.c -+++ src/gcc/gcc.c -@@ -686,10 +686,10 @@ proper position among the other output f - #define LIBASAN_SPEC STATIC_LIBASAN_LIBS - #elif defined(HAVE_LD_STATIC_DYNAMIC) - #define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \ -- " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libasan:--push-state --no-as-needed}" \ - " -lasan " \ - " %{static-libasan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libasan:--pop-state}" \ - STATIC_LIBASAN_LIBS - #else - #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS -@@ -707,10 +707,10 @@ proper position among the other output f - #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS - #elif defined(HAVE_LD_STATIC_DYNAMIC) - #define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \ -- " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libtsan:--push-state --no-as-needed}" \ - " -ltsan " \ - " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libtsan:--pop-state}" \ - STATIC_LIBTSAN_LIBS - #else - #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS -@@ -728,10 +728,10 @@ proper position among the other output f - #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS - #elif defined(HAVE_LD_STATIC_DYNAMIC) - #define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \ -- " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-liblsan:--push-state --no-as-needed}" \ - " -llsan " \ - " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-liblsan:--pop-state}" \ - STATIC_LIBLSAN_LIBS - #else - #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS -@@ -747,10 +747,10 @@ proper position among the other output f - " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}" - #ifdef HAVE_LD_STATIC_DYNAMIC - #define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \ -- " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \ -+ " %{!static-libubsan:--push-state --no-as-needed}" \ - " -lubsan " \ - " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \ -- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \ -+ " %{!static-libubsan:--pop-state}" \ - STATIC_LIBUBSAN_LIBS - #else - #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS diff --git a/system/gcc/007_all_alpha-mieee-default.patch b/system/gcc/007_all_alpha-mieee-default.patch new file mode 100644 index 000000000..560c2cc45 --- /dev/null +++ b/system/gcc/007_all_alpha-mieee-default.patch @@ -0,0 +1,48 @@ +Since we have interest in an eventual Alpha port, it seems good to add this +patch to our patchset now. The original patch comes from Gentoo, and like +them, we would like to see packages behave consistently across our various +architectures. + +Original Gentoo patch content follows. + +-- + +Set the default behavior on alpha to use -mieee since the large majority of +time we want this (bad/weird things can happen with packages built without +it). + +To satisfy those people who may not want -mieee forced on them all the time, +we also provide -mno-ieee. + +Patch by Mike Frysinger <vapier@gentoo.org> + +Note: upstream doesn't want to take this due to long standing behavior, and +because it'd make behavior across OS's inconsistent: + https://gcc.gnu.org/ml/gcc-patches/2003-07/msg02144.html + +This makes sense for upstream, but Gentoo is more concerned about packages +behaving the same across arches under Linux. + +--- a/gcc/config/alpha/alpha.h ++++ b/gcc/config/alpha/alpha.h +@@ -94,6 +94,8 @@ along with GCC; see the file COPYING3. If not see + while (0) + #endif + ++#define CPP_SPEC "%{!no-ieee:-mieee}" ++ + /* Run-time compilation parameters selecting different hardware subsets. */ + + /* Which processor to schedule for. The cpu attribute defines a list that +--- a/gcc/config/alpha/alpha.opt ++++ b/gcc/config/alpha/alpha.opt +@@ -35,7 +35,7 @@ + Request IEEE-conformant math library routines (OSF/1). + + mieee +-Target RejectNegative Mask(IEEE) ++Target Mask(IEEE) + Emit IEEE-conformant code, without inexact exceptions. + + mieee-with-inexact + diff --git a/system/gcc/011_all_default-warn-format-security.patch b/system/gcc/011_all_default-warn-format-security.patch index 1f400d026..6b62fdecf 100644 --- a/system/gcc/011_all_default-warn-format-security.patch +++ b/system/gcc/011_all_default-warn-format-security.patch @@ -1,10 +1,9 @@ Enable -Wformat and -Wformat-security by default. - --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ O - Warn about format strings that are not literals. +@@ -704,7 +704,7 @@ Warn about function calls with format strings that write past the end + of the destination region. Same as -Wformat-overflow=1. Wformat-security -C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) @@ -12,7 +11,7 @@ Enable -Wformat and -Wformat-security by default. Warn about possible security problems with format functions. Wformat-signedness -@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ +@@ -725,7 +725,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ Warn about zero-length formats. Wformat= @@ -20,4 +19,4 @@ Enable -Wformat and -Wformat-security by default. +C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2) Warn about printf/scanf/strftime/strfmon format string anomalies. - Wignored-qualifiers + Wformat-overflow= diff --git a/system/gcc/012_all_default-warn-trampolines.patch b/system/gcc/012_all_default-warn-trampolines.patch index 89ebfaccd..0bb1bd6d8 100644 --- a/system/gcc/012_all_default-warn-trampolines.patch +++ b/system/gcc/012_all_default-warn-trampolines.patch @@ -3,7 +3,7 @@ Enable -Wtrampolines by default. --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -648,7 +648,7 @@ Common Var(warn_system_headers) Warning +@@ -799,7 +799,7 @@ Common Var(warn_system_headers) Warning Do not suppress warnings from system headers Wtrampolines @@ -14,7 +14,7 @@ Enable -Wtrampolines by default. Wtype-limits --- a/gcc/doc/gcc.info +++ b/gcc/doc/gcc.info -@@ -4021,6 +4021,8 @@ compiler warns that an unrecognized option is present. +@@ -7744,6 +7744,8 @@ compiler warns that an unrecognized option is present. and thus requires the stack to be made executable in order for the program to work properly. diff --git a/system/gcc/020_all_msgfmt-libstdc++-link.patch b/system/gcc/020_all_msgfmt-libstdc++-link.patch index a70ea50a0..753b70302 100644 --- a/system/gcc/020_all_msgfmt-libstdc++-link.patch +++ b/system/gcc/020_all_msgfmt-libstdc++-link.patch @@ -19,7 +19,7 @@ https://bugs.gentoo.org/295480 --- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.am +++ gcc-4.1.2/libstdc++-v3/po/Makefile.am -@@ -39,6 +39,7 @@ MSGFMT = msgfmt +@@ -38,6 +38,7 @@ MSGFMT = msgfmt EXTRA_DIST = string_literals.cc POTFILES.in $(PACKAGE).pot $(LOCALE_IN) .po.mo: @@ -29,7 +29,7 @@ https://bugs.gentoo.org/295480 all-local: all-local-$(USE_NLS) --- gcc-4.1.2.orig/libstdc++-v3/po/Makefile.in +++ gcc-4.1.2/libstdc++-v3/po/Makefile.in -@@ -419,6 +419,7 @@ uninstall-am: uninstall-info-am +@@ -561,6 +561,7 @@ uninstall-am: uninstall-info-am .po.mo: diff --git a/system/gcc/050_all_sanitizer-lfs.patch b/system/gcc/050_all_sanitizer-lfs.patch new file mode 100644 index 000000000..65baea289 --- /dev/null +++ b/system/gcc/050_all_sanitizer-lfs.patch @@ -0,0 +1,197 @@ +https://bugs.gentoo.org/900871 +https://reviews.llvm.org/D141186 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109533 +https://github.com/llvm/llvm-project/commit/a5519b99bc73d50f362d6fb306411e9fcb758b53 +--- a/libsanitizer/interception/interception_type_test.cpp ++++ b/libsanitizer/interception/interception_type_test.cpp +@@ -24,9 +24,9 @@ COMPILER_CHECK(sizeof(::SSIZE_T) == sizeof(ssize_t)); + COMPILER_CHECK(sizeof(::PTRDIFF_T) == sizeof(ptrdiff_t)); + COMPILER_CHECK(sizeof(::INTMAX_T) == sizeof(intmax_t)); + +-#if !SANITIZER_APPLE ++# if SANITIZER_GLIBC || SANITIZER_ANDROID + COMPILER_CHECK(sizeof(::OFF64_T) == sizeof(off64_t)); +-#endif ++# endif + + // The following are the cases when pread (and friends) is used instead of + // pread64. In those cases we need OFF_T to match off_t. We don't care about the +--- a/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc ++++ b/libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc +@@ -910,24 +910,26 @@ POST_SYSCALL(statfs)(long res, const void *path, void *buf) { + } + } + +-PRE_SYSCALL(statfs64)(const void *path, long sz, void *buf) { +- if (path) +- PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); +-} ++PRE_SYSCALL(fstatfs)(long fd, void *buf) {} + +-POST_SYSCALL(statfs64)(long res, const void *path, long sz, void *buf) { ++POST_SYSCALL(fstatfs)(long res, long fd, void *buf) { + if (res >= 0) { + if (buf) +- POST_WRITE(buf, struct_statfs64_sz); ++ POST_WRITE(buf, struct_statfs_sz); + } + } ++# endif // !SANITIZER_ANDROID + +-PRE_SYSCALL(fstatfs)(long fd, void *buf) {} ++# if SANITIZER_GLIBC ++PRE_SYSCALL(statfs64)(const void *path, long sz, void *buf) { ++ if (path) ++ PRE_READ(path, __sanitizer::internal_strlen((const char *)path) + 1); ++} + +-POST_SYSCALL(fstatfs)(long res, long fd, void *buf) { ++POST_SYSCALL(statfs64)(long res, const void *path, long sz, void *buf) { + if (res >= 0) { + if (buf) +- POST_WRITE(buf, struct_statfs_sz); ++ POST_WRITE(buf, struct_statfs64_sz); + } + } + +@@ -939,7 +941,7 @@ POST_SYSCALL(fstatfs64)(long res, long fd, long sz, void *buf) { + POST_WRITE(buf, struct_statfs64_sz); + } + } +-# endif // !SANITIZER_ANDROID ++# endif // SANITIZER_GLIBC + + PRE_SYSCALL(lstat)(const void *filename, void *statbuf) { + if (filename) +@@ -998,7 +1000,7 @@ POST_SYSCALL(newfstat)(long res, long fd, void *statbuf) { + } + } + +-# if !SANITIZER_ANDROID ++# if SANITIZER_GLIBC + PRE_SYSCALL(ustat)(long dev, void *ubuf) {} + + POST_SYSCALL(ustat)(long res, long dev, void *ubuf) { +@@ -1007,7 +1009,7 @@ POST_SYSCALL(ustat)(long res, long dev, void *ubuf) { + POST_WRITE(ubuf, struct_ustat_sz); + } + } +-# endif // !SANITIZER_ANDROID ++# endif // SANITIZER_GLIBC + + PRE_SYSCALL(stat64)(const void *filename, void *statbuf) { + if (filename) +@@ -2228,7 +2230,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) { + } + } + +-# if !SANITIZER_ANDROID ++# if SANITIZER_GLIBC + PRE_SYSCALL(prlimit64) + (long pid, long resource, const void *new_rlim, void *old_rlim) { + if (new_rlim) +--- a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h +@@ -269,7 +269,7 @@ + #define SANITIZER_INTERCEPT_INET_ATON SI_POSIX + #define SANITIZER_INTERCEPT_SYSINFO SI_LINUX + #define SANITIZER_INTERCEPT_READDIR SI_POSIX +-#define SANITIZER_INTERCEPT_READDIR64 SI_LINUX_NOT_ANDROID || SI_SOLARIS32 ++#define SANITIZER_INTERCEPT_READDIR64 SI_GLIBC || SI_SOLARIS32 + #if SI_LINUX_NOT_ANDROID && \ + (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ + defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \ +@@ -308,7 +308,7 @@ + #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID + #define SANITIZER_INTERCEPT_SCANDIR \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID || SI_SOLARIS) +-#define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID || SI_SOLARIS32 ++#define SANITIZER_INTERCEPT_SCANDIR64 SI_GLIBC || SI_SOLARIS32 + #define SANITIZER_INTERCEPT_GETGROUPS SI_POSIX + #define SANITIZER_INTERCEPT_POLL SI_POSIX + #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID || SI_SOLARIS +@@ -330,10 +330,10 @@ + #define SANITIZER_INTERCEPT_GETMNTENT_R SI_LINUX_NOT_ANDROID + #define SANITIZER_INTERCEPT_STATFS \ + (SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS) +-#define SANITIZER_INTERCEPT_STATFS64 SI_LINUX_NOT_ANDROID && SANITIZER_HAS_STATFS64 ++#define SANITIZER_INTERCEPT_STATFS64 SI_GLIBC && SANITIZER_HAS_STATFS64 + #define SANITIZER_INTERCEPT_STATVFS \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) +-#define SANITIZER_INTERCEPT_STATVFS64 SI_LINUX_NOT_ANDROID ++#define SANITIZER_INTERCEPT_STATVFS64 SI_GLIBC + #define SANITIZER_INTERCEPT_INITGROUPS SI_POSIX + #define SANITIZER_INTERCEPT_ETHER_NTOA_ATON SI_POSIX + #define SANITIZER_INTERCEPT_ETHER_HOST \ +@@ -471,9 +471,9 @@ + #define SANITIZER_INTERCEPT_LSTAT (SI_NETBSD || SI_FREEBSD || SI_STAT_LINUX) + #define SANITIZER_INTERCEPT___XSTAT \ + ((!SANITIZER_INTERCEPT_STAT && SI_POSIX) || SI_STAT_LINUX) +-#define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID ++#define SANITIZER_INTERCEPT___XSTAT64 SI_GLIBC + #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT +-#define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID ++#define SANITIZER_INTERCEPT___LXSTAT64 SI_GLIBC + + #define SANITIZER_INTERCEPT_UTMP \ + (SI_POSIX && !SI_MAC && !SI_FREEBSD && !SI_NETBSD) +@@ -484,7 +484,7 @@ + (SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD || SI_NETBSD) + + #define SANITIZER_INTERCEPT_MMAP SI_POSIX +-#define SANITIZER_INTERCEPT_MMAP64 SI_LINUX_NOT_ANDROID || SI_SOLARIS ++#define SANITIZER_INTERCEPT_MMAP64 SI_GLIBC || SI_SOLARIS + #define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO (SI_GLIBC || SI_ANDROID) + #define SANITIZER_INTERCEPT_MEMALIGN (!SI_FREEBSD && !SI_MAC && !SI_NETBSD) + #define SANITIZER_INTERCEPT___LIBC_MEMALIGN SI_GLIBC +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp +@@ -260,7 +260,7 @@ namespace __sanitizer { + unsigned struct_itimerspec_sz = sizeof(struct itimerspec); + #endif // SANITIZER_LINUX + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_GLIBC + // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which + // has been removed from glibc 2.28. + #if defined(__aarch64__) || defined(__s390x__) || defined(__mips64) || \ +@@ -281,7 +281,7 @@ namespace __sanitizer { + unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; + unsigned struct_rlimit64_sz = sizeof(struct rlimit64); + unsigned struct_statvfs64_sz = sizeof(struct statvfs64); +-#endif // SANITIZER_LINUX && !SANITIZER_ANDROID ++#endif // SANITIZER_GLIBC + + #if SANITIZER_INTERCEPT_CRYPT_R + unsigned struct_crypt_data_sz = sizeof(struct crypt_data); +@@ -1089,7 +1089,7 @@ CHECK_SIZE_AND_OFFSET(dirent, d_off); + #endif + CHECK_SIZE_AND_OFFSET(dirent, d_reclen); + +-#if SANITIZER_LINUX && !SANITIZER_ANDROID ++#if SANITIZER_GLIBC + COMPILER_CHECK(sizeof(__sanitizer_dirent64) <= sizeof(dirent64)); + CHECK_SIZE_AND_OFFSET(dirent64, d_ino); + CHECK_SIZE_AND_OFFSET(dirent64, d_off); +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -28,8 +28,7 @@ + #define SANITIZER_HAS_STAT64 0 + #define SANITIZER_HAS_STATFS64 0 + #endif +-#else +-// Must be SANITIZER_LINUX then ++#elif SANITIZER_GLIBC || SANITIZER_ANDROID + #define SANITIZER_HAS_STAT64 1 + #define SANITIZER_HAS_STATFS64 1 + #endif +@@ -517,7 +516,7 @@ struct __sanitizer_dirent { + }; + # endif + +-# if SANITIZER_LINUX && !SANITIZER_ANDROID ++# if SANITIZER_GLIBC + struct __sanitizer_dirent64 { + unsigned long long d_ino; + unsigned long long d_off; + diff --git a/system/gcc/051_all_libiberty-pic.patch b/system/gcc/051_all_libiberty-pic.patch index b6160a730..3f0bae16b 100644 --- a/system/gcc/051_all_libiberty-pic.patch +++ b/system/gcc/051_all_libiberty-pic.patch @@ -1,6 +1,6 @@ --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in -@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) +@@ -265,6 +265,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ diff --git a/system/gcc/076_all_match.pd-don-t-emit-label-if-not-needed.patch b/system/gcc/076_all_match.pd-don-t-emit-label-if-not-needed.patch new file mode 100644 index 000000000..95da940fe --- /dev/null +++ b/system/gcc/076_all_match.pd-don-t-emit-label-if-not-needed.patch @@ -0,0 +1,114 @@ +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21 + +From 6178fddd3e0957fbb8bcfc443fef172691b7640b Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Fri, 5 May 2023 13:35:17 +0100 +Subject: [PATCH 01/15] match.pd: don't emit label if not needed + +This is a small QoL codegen improvement for match.pd to not emit labels when +they are not needed. The codegen is nice and there is a small (but consistent) +improvement in compile time. + +gcc/ChangeLog: + + PR bootstrap/84402 + * genmatch.cc (dt_simplify::gen_1): Only emit labels if used. + +(cherry picked from commit 580cda3c2799b1f8323af770e52f1eb0fa204718) +--- + gcc/genmatch.cc | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc +index c1023d921fca..9ecd0a462b4f 100644 +--- a/gcc/genmatch.cc ++++ b/gcc/genmatch.cc +@@ -3354,6 +3354,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + char local_fail_label[256]; + snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt); + fail_label = local_fail_label; ++ bool needs_label = false; + + /* Analyze captures and perform early-outs on the incoming arguments + that cover cases we cannot handle. */ +@@ -3368,6 +3369,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + fprintf_indent (f, indent, + "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n", + i, fail_label); ++ needs_label = true; + if (verbose >= 1) + warning_at (as_a <expr *> (s->match)->ops[i]->location, + "forcing toplevel operand to have no " +@@ -3383,6 +3385,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + fprintf_indent (f, indent, + "if (TREE_SIDE_EFFECTS (captures[%d])) " + "goto %s;\n", i, fail_label); ++ needs_label = true; + if (verbose >= 1) + warning_at (cinfo.info[i].c->location, + "forcing captured operand to have no " +@@ -3425,7 +3428,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + } + + if (s->kind == simplify::SIMPLIFY) +- fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); ++ { ++ fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); ++ needs_label = true; ++ } + + fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " + "fprintf (dump_file, \"%s ", +@@ -3498,9 +3504,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + "res_op->resimplify (%s, valueize);\n", + !e->force_leaf ? "lseq" : "NULL"); + if (e->force_leaf) +- fprintf_indent (f, indent, +- "if (!maybe_push_res_to_seq (res_op, NULL)) " +- "goto %s;\n", fail_label); ++ { ++ fprintf_indent (f, indent, ++ "if (!maybe_push_res_to_seq (res_op, NULL)) " ++ "goto %s;\n", fail_label); ++ needs_label = true; ++ } + } + } + else if (result->type == operand::OP_CAPTURE +@@ -3556,9 +3565,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + continue; + if (cinfo.info[i].result_use_count + > cinfo.info[i].match_use_count) +- fprintf_indent (f, indent, +- "if (! tree_invariant_p (captures[%d])) " +- "goto %s;\n", i, fail_label); ++ { ++ fprintf_indent (f, indent, ++ "if (! tree_invariant_p (captures[%d])) " ++ "goto %s;\n", i, fail_label); ++ needs_label = true; ++ } + } + for (unsigned j = 0; j < e->ops.length (); ++j) + { +@@ -3609,6 +3621,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + { + fprintf_indent (f, indent, "if (!_r)\n"); + fprintf_indent (f, indent, " goto %s;\n", fail_label); ++ needs_label = true; + } + } + } +@@ -3649,7 +3662,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + } + indent -= 2; + fprintf_indent (f, indent, "}\n"); +- fprintf (f, "%s:;\n", fail_label); ++ if (needs_label) ++ fprintf (f, "%s:;\n", fail_label); + fail_label = NULL; + } + +-- +2.44.0 + diff --git a/system/gcc/078_all_match.pd-CSE-the-dump-output-check.patch b/system/gcc/078_all_match.pd-CSE-the-dump-output-check.patch new file mode 100644 index 000000000..e084c4c77 --- /dev/null +++ b/system/gcc/078_all_match.pd-CSE-the-dump-output-check.patch @@ -0,0 +1,70 @@ +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21 + +From 2d83fafb3f263544be09bf7dbde036e4a84f6d7c Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Fri, 5 May 2023 13:36:43 +0100 +Subject: [PATCH 03/15] match.pd: CSE the dump output check. + +This is a small improvement in QoL codegen for match.pd to save time not +re-evaluating the condition for printing debug information in every function. + +There is a small but consistent runtime and compile time win here. The runtime +win comes from not having to do the condition over again, and on Arm plaforms +we now use the new test-and-branch support for booleans to only have a single +instruction here. + +gcc/ChangeLog: + + PR bootstrap/84402 + * genmatch.cc (decision_tree::gen, write_predicate): Generate new + debug_dump var. + (dt_simplify::gen_1): Use it. + +(cherry picked from commit c0ce29bc1ce329001b6c02bb3d34bcbb086e1b72) +--- + gcc/genmatch.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc +index 45e49c790b6d..a17ef8a23ed5 100644 +--- a/gcc/genmatch.cc ++++ b/gcc/genmatch.cc +@@ -3433,7 +3433,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) + needs_label = true; + } + +- fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " ++ fprintf_indent (f, indent, "if (UNLIKELY (debug_dump)) " + "fprintf (dump_file, \"%s ", + s->kind == simplify::SIMPLIFY + ? "Applying pattern" : "Matching expression"); +@@ -3894,6 +3894,8 @@ decision_tree::gen (FILE *f, bool gimple) + } + + fprintf (f, ")\n{\n"); ++ fprintf_indent (f, 2, "const bool debug_dump = " ++ "dump_file && (dump_flags & TDF_FOLDING);\n"); + s->s->gen_1 (f, 2, gimple, s->s->s->result); + if (gimple) + fprintf (f, " return false;\n"); +@@ -3939,6 +3941,8 @@ decision_tree::gen (FILE *f, bool gimple) + fprintf (f, ", tree _p%d", i); + fprintf (f, ")\n"); + fprintf (f, "{\n"); ++ fprintf_indent (f, 2, "const bool debug_dump = " ++ "dump_file && (dump_flags & TDF_FOLDING);\n"); + dop->gen_kids (f, 2, gimple, 0); + if (gimple) + fprintf (f, " return false;\n"); +@@ -4048,6 +4052,8 @@ write_predicate (FILE *f, predicate_id *p, decision_tree &dt, bool gimple) + gimple ? ", tree (*valueize)(tree) ATTRIBUTE_UNUSED" : ""); + /* Conveniently make 'type' available. */ + fprintf_indent (f, 2, "const tree type = TREE_TYPE (t);\n"); ++ fprintf_indent (f, 2, "const bool debug_dump = " ++ "dump_file && (dump_flags & TDF_FOLDING);\n"); + + if (!gimple) + fprintf_indent (f, 2, "if (TREE_SIDE_EFFECTS (t)) return false;\n"); +-- +2.44.0 + diff --git a/system/gcc/092_all_riscv_PR109760-gstreamer.patch b/system/gcc/092_all_riscv_PR109760-gstreamer.patch new file mode 100644 index 000000000..976f68915 --- /dev/null +++ b/system/gcc/092_all_riscv_PR109760-gstreamer.patch @@ -0,0 +1,337 @@ +https://bugs.gentoo.org/928234 +https://gcc.gnu.org/PR109760 +https://gcc.gnu.org/PR110095 +https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=55914b016de8c8514c58eb59822677a69e44135c + +From 55914b016de8c8514c58eb59822677a69e44135c Mon Sep 17 00:00:00 2001 +From: Die Li <lidie@eswincomputing.com> +Date: Fri, 19 May 2023 23:00:13 -0600 +Subject: [PATCH] Fix riscv_expand_conditional_move. + +Two issues have been observed in current riscv_expand_conditional_move +implementation. +1. Before introduction of TARGET_XTHEADCONDMOV, op0 of comparision expression +is used for mode comparision with word_mode, but after TARGET_XTHEADCONDMOV +megered with TARGET_SFB_ALU, dest of if-then-else is used for mode comparision with +word_mode, and from md file mode of dest is DI or SI which can be different with +word_mode in RV64. + +2. TARGET_XTHEADCONDMOV cannot be generated when the mode of the comparison is E_VOID. + +This patch solves the issues above. + +Provide an example from the newly added test case. + +Testcase: +int ConNmv_reg_reg_reg(int x, int y, int z, int n){ + if (x != y) return z; + return n; +} + +Cflags: +-O2 -march=rv64gc_xtheadcondmov -mabi=lp64d + +before patch: +ConNmv_reg_reg_reg: + bne a0,a1,.L23 + mv a2,a3 +.L23: + mv a0,a2 + ret + +after patch: +ConNmv_reg_reg_reg: + sub a1,a0,a1 + th.mveqz a2,zero,a1 + th.mvnez a3,zero,a1 + or a0,a2,a3 + ret + +Co-Authored by: Fei Gao <gaofei@eswincomputing.com> +Signed-off-by: Die Li <lidie@eswincomputing.com> + +gcc/ChangeLog: + + * config/riscv/riscv.cc (riscv_expand_conditional_move): Fix mode + checking. + +gcc/testsuite/ChangeLog: + + * gcc.target/riscv/xtheadcondmov-indirect-rv32.c: New test. + * gcc.target/riscv/xtheadcondmov-indirect-rv64.c: New test. +--- + gcc/config/riscv/riscv.cc | 4 +- + .../riscv/xtheadcondmov-indirect-rv32.c | 116 ++++++++++++++++++ + .../riscv/xtheadcondmov-indirect-rv64.c | 116 ++++++++++++++++++ + 3 files changed, 234 insertions(+), 2 deletions(-) + create mode 100644 gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv32.c + create mode 100644 gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv64.c + +diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc +index 2a7b43849e5..7bb38978261 100644 +--- a/gcc/config/riscv/riscv.cc ++++ b/gcc/config/riscv/riscv.cc +@@ -3406,7 +3406,7 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt) + && GET_MODE_CLASS (mode) == MODE_INT + && reg_or_0_operand (cons, mode) + && reg_or_0_operand (alt, mode) +- && GET_MODE (op) == mode ++ && (GET_MODE (op) == mode || GET_MODE (op) == E_VOIDmode) + && GET_MODE (op0) == mode + && GET_MODE (op1) == mode + && (code == EQ || code == NE)) +@@ -3415,7 +3415,7 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt) + return true; + } + else if (TARGET_SFB_ALU +- && mode == word_mode) ++ && GET_MODE (op0) == word_mode) + { + riscv_emit_int_compare (&code, &op0, &op1); + rtx cond = gen_rtx_fmt_ee (code, GET_MODE (op0), op0, op1); +diff --git a/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv32.c b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv32.c +new file mode 100644 +index 00000000000..9afdc2eabfd +--- /dev/null ++++ b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv32.c +@@ -0,0 +1,116 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -march=rv32gc_xtheadcondmov -mabi=ilp32 -mriscv-attribute" } */ ++/* { dg-skip-if "" { *-*-* } { "-O0" "-Os" "-Og" } } */ ++/* { dg-final { check-function-bodies "**" "" } } */ ++ ++/* ++**ConEmv_imm_imm_reg: ++** addi a5,a0,-1000 ++** li a0,10 ++** th.mvnez a0,zero,a5 ++** th.mveqz a1,zero,a5 ++** or a0,a0,a1 ++** ret ++*/ ++int ConEmv_imm_imm_reg(int x, int y){ ++ if (x == 1000) return 10; ++ return y; ++} ++ ++/* ++**ConEmv_imm_reg_reg: ++** addi a5,a0,-1000 ++** th.mvnez a1,zero,a5 ++** th.mveqz a2,zero,a5 ++** or a0,a1,a2 ++** ret ++*/ ++int ConEmv_imm_reg_reg(int x, int y, int z){ ++ if (x == 1000) return y; ++ return z; ++} ++ ++/* ++**ConEmv_reg_imm_reg: ++** sub a1,a0,a1 ++** li a0,10 ++** th.mvnez a0,zero,a1 ++** th.mveqz a2,zero,a1 ++** or a0,a0,a2 ++** ret ++*/ ++int ConEmv_reg_imm_reg(int x, int y, int z){ ++ if (x == y) return 10; ++ return z; ++} ++ ++/* ++**ConEmv_reg_reg_reg: ++** sub a1,a0,a1 ++** th.mvnez a2,zero,a1 ++** th.mveqz a3,zero,a1 ++** or a0,a2,a3 ++** ret ++*/ ++int ConEmv_reg_reg_reg(int x, int y, int z, int n){ ++ if (x == y) return z; ++ return n; ++} ++ ++/* ++**ConNmv_imm_imm_reg: ++** li a5,9998336 ++** addi a4,a0,-1000 ++** addi a5,a5,1664 ++** th.mvnez a1,zero,a4 ++** th.mveqz a5,zero,a4 ++** or a0,a1,a5 ++** ret ++*/ ++int ConNmv_imm_imm_reg(int x, int y){ ++ if (x != 1000) return 10000000; ++ return y; ++} ++ ++/* ++**ConNmv_imm_reg_reg: ++** addi a5,a0,-1000 ++** th.mveqz a1,zero,a5 ++** th.mvnez a2,zero,a5 ++** or a0,a1,a2 ++** ret ++*/ ++int ConNmv_imm_reg_reg(int x, int y, int z){ ++ if (x != 1000) return y; ++ return z; ++} ++ ++/* ++**ConNmv_reg_imm_reg: ++** sub a1,a0,a1 ++** li a0,10 ++** th.mveqz a0,zero,a1 ++** th.mvnez a2,zero,a1 ++** or a0,a0,a2 ++** ret ++*/ ++int ConNmv_reg_imm_reg(int x, int y, int z){ ++ if (x != y) return 10; ++ return z; ++} ++ ++/* ++**ConNmv_reg_reg_reg: ++** sub a1,a0,a1 ++** th.mveqz a2,zero,a1 ++** th.mvnez a3,zero,a1 ++** or a0,a2,a3 ++** ret ++*/ ++int ConNmv_reg_reg_reg(int x, int y, int z, int n){ ++ if (x != y) return z; ++ return n; ++} ++ ++ ++/* { dg-final { scan-assembler ".attribute arch, \"rv32i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_xtheadcondmov1p0\"" } } */ +diff --git a/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv64.c b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv64.c +new file mode 100644 +index 00000000000..a1982fd90bd +--- /dev/null ++++ b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-indirect-rv64.c +@@ -0,0 +1,116 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -march=rv64gc_xtheadcondmov -mabi=lp64d -mriscv-attribute" } */ ++/* { dg-skip-if "" { *-*-* } { "-O0" "-Os" "-Og" } } */ ++/* { dg-final { check-function-bodies "**" "" } } */ ++ ++/* ++**ConEmv_imm_imm_reg: ++** addi a5,a0,-1000 ++** li a0,10 ++** th.mvnez a0,zero,a5 ++** th.mveqz a1,zero,a5 ++** or a0,a0,a1 ++** ret ++*/ ++int ConEmv_imm_imm_reg(int x, int y){ ++ if (x == 1000) return 10; ++ return y; ++} ++ ++/* ++**ConEmv_imm_reg_reg: ++** addi a5,a0,-1000 ++** th.mvnez a1,zero,a5 ++** th.mveqz a2,zero,a5 ++** or a0,a1,a2 ++** ret ++*/ ++int ConEmv_imm_reg_reg(int x, int y, int z){ ++ if (x == 1000) return y; ++ return z; ++} ++ ++/* ++**ConEmv_reg_imm_reg: ++** sub a1,a0,a1 ++** li a0,10 ++** th.mvnez a0,zero,a1 ++** th.mveqz a2,zero,a1 ++** or a0,a0,a2 ++** ret ++*/ ++int ConEmv_reg_imm_reg(int x, int y, int z){ ++ if (x == y) return 10; ++ return z; ++} ++ ++/* ++**ConEmv_reg_reg_reg: ++** sub a1,a0,a1 ++** th.mvnez a2,zero,a1 ++** th.mveqz a3,zero,a1 ++** or a0,a2,a3 ++** ret ++*/ ++int ConEmv_reg_reg_reg(int x, int y, int z, int n){ ++ if (x == y) return z; ++ return n; ++} ++ ++/* ++**ConNmv_imm_imm_reg: ++** li a5,9998336 ++** addi a4,a0,-1000 ++** addi a5,a5,1664 ++** th.mvnez a1,zero,a4 ++** th.mveqz a5,zero,a4 ++** or a0,a1,a5 ++** ret ++*/ ++int ConNmv_imm_imm_reg(int x, int y){ ++ if (x != 1000) return 10000000; ++ return y; ++} ++ ++/* ++**ConNmv_imm_reg_reg: ++** addi a5,a0,-1000 ++** th.mveqz a1,zero,a5 ++** th.mvnez a2,zero,a5 ++** or a0,a1,a2 ++** ret ++*/ ++int ConNmv_imm_reg_reg(int x, int y, int z){ ++ if (x != 1000) return y; ++ return z; ++} ++ ++/* ++**ConNmv_reg_imm_reg: ++** sub a1,a0,a1 ++** li a0,10 ++** th.mveqz a0,zero,a1 ++** th.mvnez a2,zero,a1 ++** or a0,a0,a2 ++** ret ++*/ ++int ConNmv_reg_imm_reg(int x, int y, int z){ ++ if (x != y) return 10; ++ return z; ++} ++ ++/* ++**ConNmv_reg_reg_reg: ++** sub a1,a0,a1 ++** th.mveqz a2,zero,a1 ++** th.mvnez a3,zero,a1 ++** or a0,a2,a3 ++** ret ++*/ ++int ConNmv_reg_reg_reg(int x, int y, int z, int n){ ++ if (x != y) return z; ++ return n; ++} ++ ++ ++/* { dg-final { scan-assembler ".attribute arch, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_xtheadcondmov1p0\"" } } */ +-- +2.39.3 diff --git a/system/gcc/101-pr115836.patch b/system/gcc/101-pr115836.patch new file mode 100644 index 000000000..72c78f925 --- /dev/null +++ b/system/gcc/101-pr115836.patch @@ -0,0 +1,50 @@ +From: Uros Bizjak <ubizjak@gmail.com> +Date: Wed, 10 Jul 2024 07:27:27 +0000 (+0200) +Subject: middle-end: Fix stalled swapped condition code value [PR115836] +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=47a8b464d2dd9a586a9e15242c9825e39e1ecd4c;hp=efa30f619361b043616e624e57366a50982e11df + +middle-end: Fix stalled swapped condition code value [PR115836] + +emit_store_flag_1 calculates scode (swapped condition code) at the +beginning of the function from the value of code variable. However, +code variable may change before scode usage site, resulting in +invalid stalled scode value. + +Move calculation of scode value just before its only usage site to +avoid stalled scode value. + + PR middle-end/115836 + +gcc/ChangeLog: + + * expmed.cc (emit_store_flag_1): Move calculation of + scode just before its only usage site. + +(cherry picked from commit 44933fdeb338e00c972e42224b9a83d3f8f6a757) +--- + +diff --git a/gcc/expmed.cc b/gcc/expmed.cc +index 4ec035e4843b..19765311b954 100644 +--- a/gcc/expmed.cc ++++ b/gcc/expmed.cc +@@ -5607,11 +5607,9 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1, + enum insn_code icode; + machine_mode compare_mode; + enum mode_class mclass; +- enum rtx_code scode; + + if (unsignedp) + code = unsigned_condition (code); +- scode = swap_condition (code); + + /* If one operand is constant, make it the second one. Only do this + if the other operand is not constant as well. */ +@@ -5726,6 +5724,8 @@ emit_store_flag_1 (rtx target, enum rtx_code code, rtx op0, rtx op1, + + if (GET_MODE_CLASS (mode) == MODE_FLOAT) + { ++ enum rtx_code scode = swap_condition (code); ++ + tem = emit_cstore (target, icode, scode, mode, compare_mode, + unsignedp, op1, op0, normalizep, target_mode); + if (tem) diff --git a/system/gcc/201-ada.patch b/system/gcc/201-ada.patch index acb1e1f1b..d16bbbbaa 100644 --- a/system/gcc/201-ada.patch +++ b/system/gcc/201-ada.patch @@ -1,29 +1,8 @@ -diff --git a/gcc/ada/adadecode.c b/gcc/ada/adadecode.c -index a63b7e7641b0..92155ef2025a 100644 ---- a/gcc/ada/adadecode.c -+++ b/gcc/ada/adadecode.c -@@ -29,6 +29,7 @@ - * * - ****************************************************************************/ - -+#include "adaint.h" /* for a macro version of xstrdup. */ - - #if defined(IN_RTS) - #include "tconfig.h" -@@ -42,8 +43,6 @@ - #include <stdio.h> - #include <ctype.h> - --#include "adaint.h" /* for a macro version of xstrdup. */ -- - #ifndef ISDIGIT - #define ISDIGIT(c) isdigit(c) - #endif diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 414346558654..2586a1368903 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c -@@ -85,6 +85,8 @@ +@@ -101,6 +101,8 @@ #define _LARGEFILE64_SOURCE 1 #endif @@ -32,7 +11,7 @@ index 414346558654..2586a1368903 100644 #ifdef IN_RTS #include "tconfig.h" #include "tsystem.h" -@@ -202,8 +204,6 @@ UINT __gnat_current_ccs_encoding; +@@ -243,8 +245,6 @@ UINT __gnat_current_ccs_encoding; #include <utime.h> #endif @@ -45,7 +24,7 @@ diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index 0d12f7e90209..74182446d4ac 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h -@@ -316,6 +316,7 @@ extern void *__gnat_lwp_self (void); +@@ -319,6 +319,7 @@ extern void *__gnat_lwp_self (void); /* Routines for interface to required CPU set primitives */ @@ -64,8 +43,8 @@ index f62cf1eb37dc..0b6c5fe6f0df 100644 +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" + #include "runtime.h" + #include <stdlib.h> @@ -51,8 +53,6 @@ #include "system.h" #endif @@ -86,9 +65,9 @@ index ff97abe36ef1..56aa3477c8cd 100644 +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" -@@ -38,8 +40,6 @@ + #include "runtime.h" + #include <sys/stat.h> +@@ -37,8 +39,6 @@ #include "system.h" #endif @@ -101,38 +80,16 @@ diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c index cdcb531e2b3f..dde6b9948089 100644 --- a/gcc/ada/cstreams.c +++ b/gcc/ada/cstreams.c -@@ -52,6 +52,8 @@ - #include "vxWorks.h" - #endif - -+#include "adaint.h" -+ - #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" -@@ -61,8 +63,6 @@ - #include "system.h" - #endif - --#include "adaint.h" -- - #ifdef __cplusplus - extern "C" { - #endif -diff --git a/gcc/ada/exit.c b/gcc/ada/exit.c -index 6274571c6f04..336b0f8f386b 100644 ---- a/gcc/ada/exit.c -+++ b/gcc/ada/exit.c -@@ -33,6 +33,8 @@ +@@ -58,6 +58,8 @@ #include "vxWorks.h" #endif +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" -@@ -42,8 +44,6 @@ + #include <string.h> + #else +@@ -65,8 +67,6 @@ #include "system.h" #endif @@ -141,11 +98,11 @@ index 6274571c6f04..336b0f8f386b 100644 #ifdef __cplusplus extern "C" { #endif -diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in +diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 0258f106d404..0416244ae428 100644 ---- a/gcc/ada/gcc-interface/Makefile.in -+++ b/gcc/ada/gcc-interface/Makefile.in -@@ -1574,7 +1574,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),) +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),) endif # ARM linux, GNU eabi @@ -165,9 +122,9 @@ index 5088ecffc4f1..02a45b3ce7ca 100644 +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" -@@ -65,7 +67,6 @@ + + #ifdef STANDALONE +@@ -71,7 +73,6 @@ #include "system.h" #endif @@ -179,7 +136,7 @@ diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__l index 5bf4a5fe1d26..c52cc70dfbab 100644 --- a/gcc/ada/libgnarl/s-osinte__linux.ads +++ b/gcc/ada/libgnarl/s-osinte__linux.ads -@@ -394,12 +394,6 @@ package System.OS_Interface is +@@ -403,12 +403,6 @@ package System.OS_Interface is PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1; PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2; @@ -192,7 +149,7 @@ index 5bf4a5fe1d26..c52cc70dfbab 100644 function pthread_rwlock_init (mutex : access pthread_rwlock_t; attr : access pthread_rwlockattr_t) return int; -@@ -464,11 +458,6 @@ package System.OS_Interface is +@@ -470,11 +464,6 @@ package System.OS_Interface is protocol : int) return int; pragma Import (C, pthread_mutexattr_setprotocol); @@ -208,7 +165,7 @@ diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__l index e55cd65e54f6..32d72b3980a6 100644 --- a/gcc/ada/libgnarl/s-taprop__linux.adb +++ b/gcc/ada/libgnarl/s-taprop__linux.adb -@@ -202,9 +202,6 @@ package body System.Task_Primitives.Operations is +@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is pragma Import (C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup"); @@ -218,7 +175,7 @@ index e55cd65e54f6..32d72b3980a6 100644 -- We do not have pragma Linker_Options ("-lcap"); here, because this -- library is not present on many Linux systems. 'libcap' is the Linux -- "capabilities" library, called by __gnat_has_cap_sys_nice. -@@ -214,38 +211,6 @@ package body System.Task_Primitives.Operations is +@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is -- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on -- GNU/Linux, so we map 0 .. 98 to 1 .. 99. @@ -251,13 +208,13 @@ index e55cd65e54f6..32d72b3980a6 100644 - return Ceiling_Support; - end Get_Ceiling_Support; - -- pragma Warnings (Off, "non-static call not allowed in preelaborated unit"); +- pragma Warnings (Off, "non-preelaborable call not allowed*"); - Ceiling_Support : constant Boolean := Get_Ceiling_Support; -- pragma Warnings (On, "non-static call not allowed in preelaborated unit"); +- pragma Warnings (On, "non-preelaborable call not allowed*"); -- True if the locking policy is Ceiling_Locking, and the current process -- has permission to use this policy. The process has permission if it is -- running as 'root', or if the capability was set by the setcap command, -@@ -348,7 +313,9 @@ package body System.Task_Primitives.Operations is +@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is -- Init_Mutex -- ---------------- @@ -267,7 +224,7 @@ index e55cd65e54f6..32d72b3980a6 100644 Mutex_Attr : aliased pthread_mutexattr_t; Result, Result_2 : C.int; -@@ -360,16 +327,7 @@ package body System.Task_Primitives.Operations is +@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is return Result; end if; @@ -285,7 +242,7 @@ index e55cd65e54f6..32d72b3980a6 100644 Result := pthread_mutexattr_setprotocol (Mutex_Attr'Access, PTHREAD_PRIO_INHERIT); pragma Assert (Result = 0); -@@ -409,11 +367,6 @@ package body System.Task_Primitives.Operations is +@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is Result := pthread_rwlockattr_init (RWlock_Attr'Access); pragma Assert (Result = 0); @@ -301,91 +258,31 @@ diff --git a/gcc/ada/libgnat/s-dwalin.adb b/gcc/ada/libgnat/s-dwalin.adb index a857b67132af..1e2bb4c545ad 100644 --- a/gcc/ada/libgnat/s-dwalin.adb +++ b/gcc/ada/libgnat/s-dwalin.adb -@@ -382,7 +382,7 @@ package body System.Dwarf_Lines is - - function Low (C : Dwarf_Context) return Address is - begin -- return C.Low; -+ return To_Address (To_Integer (C.Low) + C.Load_Slide); - end Low; - - ---------- -@@ -1210,19 +1210,21 @@ package body System.Dwarf_Lines is - -- Discard symbols whose length is 0 - Sz := uint32 (Size (S)); - -- -- Try to filter symbols at the same address. This is a best -- -- effort as they might not be consecutive. -- Addr := uint32 (Value (S) - uint64 (C.Low)); -- if Sz > 0 and then Addr /= Prev_Addr then -- Nbr_Symbols := Nbr_Symbols + 1; -- Prev_Addr := Addr; -- -- if Phase = 2 then -- C.Cache (Nbr_Symbols) := -- (First => Addr, -- Size => Sz, -- Sym => uint32 (Off (S)), -- Line => 0); -+ if Sz > 0 then -+ -- Try to filter symbols at the same address. This is a best -+ -- effort as they might not be consecutive. -+ Addr := uint32 (Value (S) - uint64 (C.Low)); -+ if Addr /= Prev_Addr then -+ Nbr_Symbols := Nbr_Symbols + 1; -+ Prev_Addr := Addr; -+ -+ if Phase = 2 then -+ C.Cache (Nbr_Symbols) := -+ (First => Addr, -+ Size => Sz, -+ Sym => uint32 (Off (S)), -+ Line => 0); -+ end if; - end if; - end if; - -@@ -1267,6 +1269,10 @@ package body System.Dwarf_Lines is +@@ -1538,7 +1538,11 @@ package body System.Dwarf_Lines is -- Read table + loop - Read_Aranges_Entry (C, Ar_Start, Ar_Len); + Read_Aranges_Entry (C, Addr_Size, Ar_Start, Ar_Len); + -- Skip references to discarded sections + while Ar_Start = 0 and Ar_Len /= 0 loop -+ Read_Aranges_Entry (C, Ar_Start, Ar_Len); ++ Read_Aranges_Entry (C, Addr_Size, Ar_Start, Ar_Len); + end loop; - exit when Ar_Start = 0 and Ar_Len = 0; + exit when Ar_Start = Null_Address and Ar_Len = 0; Len := uint32 (Ar_Len); -diff --git a/gcc/ada/libgnat/s-trasym__dwarf.adb b/gcc/ada/libgnat/s-trasym__dwarf.adb -index db7c5eb4cdd8..3cd60ecbc37b 100644 ---- a/gcc/ada/libgnat/s-trasym__dwarf.adb -+++ b/gcc/ada/libgnat/s-trasym__dwarf.adb -@@ -123,7 +123,8 @@ package body System.Traceback.Symbolic is - -- Return the String contained in Item, up until the first NUL character - - pragma Warnings (Off, "*Add_Module_To_Cache*"); -- procedure Add_Module_To_Cache (Module_Name : String); -+ procedure Add_Module_To_Cache (Module_Name : String; -+ Load_Address : System.Address); - -- To be called by Build_Cache_For_All_Modules to add a new module to the - -- list. May not be referenced. - -@@ -217,12 +218,13 @@ package body System.Traceback.Symbolic is - -- Add_Module_To_Cache -- - ------------------------- - -- procedure Add_Module_To_Cache (Module_Name : String) is -+ procedure Add_Module_To_Cache (Module_Name : String; -+ Load_Address : System.Address) is - Module : Module_Cache_Acc; - Success : Boolean; - begin - Module := new Module_Cache; -- Init_Module (Module.all, Success, Module_Name); -+ Init_Module (Module.all, Success, Module_Name, Load_Address); - if not Success then - Free (Module); - return; +diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads +index 3d6e345a1ba9..cfe0b4d3ca6c 100644 +--- a/gcc/ada/libgnat/s-parame.ads ++++ b/gcc/ada/libgnat/s-parame.ads +@@ -102,7 +102,7 @@ package System.Parameters is + -- Characteristics of time_t type -- + ------------------------------------ + +- time_t_bits : constant := Long_Integer'Size; ++ time_t_bits : constant := Long_Long_Integer'Size; + -- Number of bits in type time_t + + ---------------------------------------------- diff --git a/gcc/ada/libgnat/s-tsmona__linux.adb b/gcc/ada/libgnat/s-tsmona__linux.adb index cbebd0652048..c882aa64a6e2 100644 --- a/gcc/ada/libgnat/s-tsmona__linux.adb @@ -468,7 +365,7 @@ index cbebd0652048..c882aa64a6e2 100644 - while lm /= null loop - if Big_String_Conv.To_Pointer (lm.l_name) (1) /= ASCII.NUL then - -- Discard non-file (like the executable itself or the gate). -- Add_Module_To_Cache (Value (lm.l_name)); +- Add_Module_To_Cache (Value (lm.l_name), lm.l_addr); - end if; - lm := lm.l_next; - end loop; @@ -487,8 +384,8 @@ index c101d968a851..43cdd51e8320 100644 +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" + #include "runtime.h" + #include <sys/stat.h> @@ -53,8 +55,6 @@ #endif #endif @@ -509,9 +406,9 @@ index 70ad6cd3282a..eb92de1b2137 100644 +#include "adaint.h" + #ifdef IN_RTS - #include "tconfig.h" - #include "tsystem.h" -@@ -40,7 +42,6 @@ + #include "runtime.h" + #else +@@ -39,7 +41,6 @@ #include "system.h" #endif @@ -531,8 +428,8 @@ index 98b3901cb16f..98db6a14c2d5 100644 + #ifdef IN_RTS #define POSIX - #include "tconfig.h" -@@ -72,8 +74,6 @@ + #include "runtime.h" +@@ -74,8 +76,6 @@ extern struct tm *localtime_r(const time_t *, struct tm *); #endif @@ -541,25 +438,34 @@ index 98b3901cb16f..98db6a14c2d5 100644 /* Don't use macros versions of this functions on VxWorks since they cause imcompatible changes in some VxWorks versions */ #ifdef __vxworks -diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c -index 7025f57d645e..074845584958 100644 ---- a/gcc/ada/terminals.c -+++ b/gcc/ada/terminals.c -@@ -1112,7 +1112,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns) - (HP-UX) */ - #if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \ - && !defined (__rtems__) && !defined (__QNXNTO__) --# include <termio.h> - #endif - - #include <sys/ioctl.h> -@@ -1159,7 +1158,8 @@ __gnat_setup_winsize (void *desc, int rows, int columns) +--- a/gcc/ada/terminals.c 2019-01-08 10:54:04.000000000 +0100 ++++ b/gcc/ada/terminals.c 2019-05-15 13:14:09.935742526 +0200 +@@ -1136,7 +1136,7 @@ + /* POSIX does not specify how to open the master side of a terminal.Several + methods are available (system specific): + 1- using a cloning device (USE_CLONE_DEVICE) +- 2- getpt (USE_GETPT) ++ 2- posix_openpt (USE_POSIX_OPENPT) + 3- openpty (USE_OPENPTY) + + When using the cloning device method, the macro USE_CLONE_DEVICE should +@@ -1150,7 +1150,7 @@ #if defined (__APPLE__) || defined (BSD) #define USE_OPENPTY #elif defined (__linux__) -#define USE_GETPT -+#include <pty.h> -+#define USE_OPENPTY ++#define USE_POSIX_OPENPT #elif defined (__sun__) #define USE_CLONE_DEVICE "/dev/ptmx" #elif defined (_AIX) +@@ -1199,8 +1199,8 @@ + int master_fd = -1; + char *slave_name = NULL; + +-#ifdef USE_GETPT +- master_fd = getpt (); ++#if defined(USE_POSIX_OPENPT) ++ master_fd = posix_openpt(O_RDWR | O_NOCTTY); + #elif defined (USE_OPENPTY) + status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); + #elif defined (USE_CLONE_DEVICE) diff --git a/system/gcc/202-ibm-ldbl.patch b/system/gcc/202-ibm-ldbl.patch index bdf5c75d9..d67cbbf46 100644 --- a/system/gcc/202-ibm-ldbl.patch +++ b/system/gcc/202-ibm-ldbl.patch @@ -32,7 +32,7 @@ index 4f6d4c4..fa93bb6 100644 @@ -1,3 +1,3 @@ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver --HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc -+HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -mno-minimal-toc +-HOST_LIBGCC2_CFLAGS += -mlong-double-128 ++HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-gnu-attribute -- 2.24.0 diff --git a/system/gcc/205-nopie.patch b/system/gcc/205-nopie.patch index e3da94d10..262749d62 100644 --- a/system/gcc/205-nopie.patch +++ b/system/gcc/205-nopie.patch @@ -12,7 +12,7 @@ diff --git a/gcc/configure b/gcc/configure index 1c6e340..7e8b5d6 100755 --- a/gcc/configure +++ b/gcc/configure -@@ -29390,6 +29390,33 @@ fi +@@ -32441,6 +32441,33 @@ fi $as_echo "$gcc_cv_no_pie" >&6; } if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" @@ -50,7 +50,7 @@ diff --git a/gcc/configure.ac b/gcc/configure.ac index 6c1dcd9..0ca7647 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -6098,6 +6098,19 @@ AC_CACHE_CHECK([for -no-pie option], +@@ -7621,6 +7621,19 @@ AC_CACHE_CHECK([for -no-pie option], LDFLAGS="$saved_LDFLAGS"]) if test "$gcc_cv_no_pie" = "yes"; then NO_PIE_FLAG="-no-pie" diff --git a/system/gcc/206-arm-unwind-functionise.patch b/system/gcc/206-arm-unwind-functionise.patch index 0cee39e54..a5cc9236e 100644 --- a/system/gcc/206-arm-unwind-functionise.patch +++ b/system/gcc/206-arm-unwind-functionise.patch @@ -1,6 +1,6 @@ --- gcc-8.5.0/libgcc/config/arm/unwind-arm.c.old 2021-05-14 03:42:10.000000000 -0500 +++ gcc-8.5.0/libgcc/config/arm/unwind-arm.c 2022-12-24 20:04:04.085095067 -0600 -@@ -510,22 +510,22 @@ +@@ -539,22 +539,22 @@ return __gnu_unwind_pr_common (state, ucbp, context, 2); } @@ -30,7 +30,7 @@ _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1)); --- gcc-8.5.0/libgcc/config/arm/unwind-arm.h.old 2021-05-14 03:42:10.000000000 -0500 +++ gcc-8.5.0/libgcc/config/arm/unwind-arm.h 2022-12-24 20:03:41.415095129 -0600 -@@ -72,7 +72,7 @@ +@@ -97,7 +97,7 @@ { return _URC_FAILURE; } @@ -41,7 +41,7 @@ (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1) --- gcc-8.5.0/gcc/ada/raise-gcc.c.old 2021-05-14 03:42:08.000000000 -0500 +++ gcc-8.5.0/gcc/ada/raise-gcc.c 2022-12-24 22:43:03.605084414 -0600 -@@ -91,7 +91,9 @@ +@@ -90,7 +90,9 @@ This is a hack ???, the real fix is to link gnat1/gnatbind with the runtime of the build compiler. */ # ifdef EH_MECHANISM_arm diff --git a/system/gcc/320-libffi-gnulinux.patch b/system/gcc/320-libffi-gnulinux.patch deleted file mode 100644 index b3b4fc931..000000000 --- a/system/gcc/320-libffi-gnulinux.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libffi/closures.c.orig b/libffi/closures.c -index 721ff00..22a699c 100644 ---- a/libffi/src/closures.c.orig -+++ b/libffi/src/closures.c -@@ -34,7 +34,7 @@ - #include <ffi_common.h> - - #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE --# if __gnu_linux__ && !defined(__ANDROID__) -+# if __linux__ && !defined(__ANDROID__) - /* This macro indicates it may be forbidden to map anonymous memory - with both write and execute permission. Code compiled when this - option is defined will attempt to map such pages once, but if it diff --git a/system/gcc/330-gccgo-link-to-ucontext.patch b/system/gcc/330-gccgo-link-to-ucontext.patch index 8aa60ca54..63446f23c 100644 --- a/system/gcc/330-gccgo-link-to-ucontext.patch +++ b/system/gcc/330-gccgo-link-to-ucontext.patch @@ -1,6 +1,6 @@ --- gcc-6.4.0/Makefile.in.old 2018-06-21 22:16:35.167781541 -0500 +++ gcc-6.4.0/Makefile.in 2018-06-22 00:36:13.849486086 -0500 -@@ -41332,7 +41332,7 @@ +@@ -52324,7 +52324,7 @@ esac; \ module_srcdir=libgo; \ rm -f no-such-file || : ; \ diff --git a/system/gcc/331-gccgo-use-real-off_t-type.patch b/system/gcc/331-gccgo-use-real-off_t-type.patch index 1c8c43e9e..c652dd448 100644 --- a/system/gcc/331-gccgo-use-real-off_t-type.patch +++ b/system/gcc/331-gccgo-use-real-off_t-type.patch @@ -1,30 +1,11 @@ ---- gcc-6.4.0/libgo/go/syscall/libcall_linux.go.old 2016-02-03 15:58:02.419872000 -0600 -+++ gcc-6.4.0/libgo/go/syscall/libcall_linux.go 2018-06-22 00:56:31.478280552 -0500 -@@ -355,19 +355,19 @@ - //sys Setxattr(path string, attr string, data []byte, flags int) (err error) - //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int +--- gcc-13.3.0/libgo/sysinfo.c.old 2024-05-22 20:29:51.727156372 -0500 ++++ gcc-13.3.0/libgo/sysinfo.c 2024-05-22 20:35:39.499799256 -0500 +@@ -363,6 +363,8 @@ + // loff_t can be defined as a macro; for -fgo-dump-spec make sure we + // see a typedef. + typedef loff_t libgo_loff_t_type; ++#else ++typedef off_t libgo_loff_t_type; + #endif --//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error) --//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t -+//sys splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error) -+//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t - func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { -- var lroff _loff_t -- var plroff *_loff_t -+ var lroff _off_t -+ var plroff *_off_t - if roff != nil { -- lroff = _loff_t(*roff) -+ lroff = _off_t(*roff) - plroff = &lroff - } -- var lwoff _loff_t -- var plwoff *_loff_t -+ var lwoff _off_t -+ var plwoff *_off_t - if woff != nil { -- lwoff = _loff_t(*woff) -+ lwoff = _off_t(*woff) - plwoff = &lwoff - } - n, err = splice(rfd, plroff, wfd, plwoff, len, flags) + #if defined(HAVE_OFF64_T) diff --git a/system/gcc/332-gccgo-sysinfo.patch b/system/gcc/332-gccgo-sysinfo.patch index 822bc53c9..8c02cb6e0 100644 --- a/system/gcc/332-gccgo-sysinfo.patch +++ b/system/gcc/332-gccgo-sysinfo.patch @@ -1,6 +1,6 @@ --- gcc-8.3.0/libgo/sysinfo.c.old 2018-06-22 14:25:34.000000000 +0000 +++ gcc-8.3.0/libgo/sysinfo.c 2019-02-27 20:18:38.740000000 +0000 -@@ -73,9 +73,6 @@ +@@ -78,9 +78,6 @@ #include <sys/times.h> #include <sys/wait.h> #include <sys/un.h> diff --git a/system/gcc/333-gccgo-signal-ppc64.patch b/system/gcc/333-gccgo-signal-ppc64.patch deleted file mode 100644 index 304b71733..000000000 --- a/system/gcc/333-gccgo-signal-ppc64.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gcc-8.3.0/libgo/runtime/go-signal.c.old 2017-08-18 20:17:26.000000000 +0000 -+++ gcc-8.3.0/libgo/runtime/go-signal.c 2019-02-27 20:25:02.560000000 +0000 -@@ -222,7 +222,7 @@ - #endif - #ifdef __PPC__ - #ifdef __linux__ -- ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip; -+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; - #endif - #ifdef _AIX - ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; diff --git a/system/gcc/334-gccgo-signal-shell.patch b/system/gcc/334-gccgo-signal-shell.patch index 5c7405c4f..68fa80bca 100644 --- a/system/gcc/334-gccgo-signal-shell.patch +++ b/system/gcc/334-gccgo-signal-shell.patch @@ -1,6 +1,6 @@ --- gcc-8.3.0/libgo/mksigtab.sh.old 2017-11-22 00:27:29.000000000 +0000 +++ gcc-8.3.0/libgo/mksigtab.sh 2019-03-02 22:01:17.530000000 +0000 -@@ -82,7 +82,7 @@ +@@ -86,7 +86,7 @@ checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}' checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}' checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}' @@ -9,17 +9,3 @@ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}' checksig _SIGLWP '{_SigNotify, "SIGLWP: reserved signal no longer used by"}' checksig _SIGFREEZE '{_SigNotify, "SIGFREEZE: special signal used by CPR"}' -@@ -94,10 +94,12 @@ - - # Special handling of signals 32 and 33 on GNU/Linux systems, - # because they are special to glibc. -+# Signal 34 is additionally special to Linux systems with musl. - if test "${GOOS}" = "linux"; then -- SIGLIST=$SIGLIST"_32__33_" -+ SIGLIST=$SIGLIST"_32__33__34_" - echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */' - echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */' -+ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */' - fi - - if test "${GOOS}" = "aix"; then diff --git a/system/gcc/335-gccgo-signal-ppc32.patch b/system/gcc/335-gccgo-signal-ppc32.patch index f44444948..1e52b925e 100644 --- a/system/gcc/335-gccgo-signal-ppc32.patch +++ b/system/gcc/335-gccgo-signal-ppc32.patch @@ -1,6 +1,6 @@ --- gcc-8.3.0/libgo/runtime/go-signal.c.old 2019-03-02 22:02:02.250000000 +0000 +++ gcc-8.3.0/libgo/runtime/go-signal.c 2019-03-03 02:04:13.220000000 +0000 -@@ -222,7 +222,11 @@ +@@ -249,7 +249,11 @@ #endif #ifdef __PPC__ #ifdef __linux__ diff --git a/system/gcc/336-gccgo-mmap64.patch b/system/gcc/336-gccgo-mmap64.patch deleted file mode 100644 index 23b4cebc8..000000000 --- a/system/gcc/336-gccgo-mmap64.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- gcc-8.3.0/libgo/go/runtime/mem_gccgo.go.old 2018-01-09 01:23:08.000000000 +0000 -+++ gcc-8.3.0/libgo/go/runtime/mem_gccgo.go 2019-03-03 05:15:33.010000000 +0000 -@@ -16,7 +16,7 @@ - //go:linkname sysFree runtime.sysFree - - //extern mmap --func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer -+func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer - - //extern munmap - func munmap(addr unsafe.Pointer, length uintptr) int32 -@@ -41,7 +41,7 @@ - } - } - --func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) { -+func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) { - p := sysMmap(addr, n, prot, flags, fd, off) - if uintptr(p) == _MAP_FAILED { - return nil, errno() -@@ -84,7 +84,7 @@ - return true - } - --func mmap_fixed(v unsafe.Pointer, n uintptr, prot, flags, fd int32, offset uintptr) (unsafe.Pointer, int) { -+func mmap_fixed(v unsafe.Pointer, n uintptr, prot, flags, fd int32, offset int64) (unsafe.Pointer, int) { - p, err := mmap(v, n, prot, flags, fd, offset) - // On some systems, mmap ignores v without - // MAP_FIXED, so retry if the address space is free. diff --git a/system/gcc/337-gccgo-signal-sig34.patch b/system/gcc/337-gccgo-signal-sig34.patch deleted file mode 100644 index 757d2f216..000000000 --- a/system/gcc/337-gccgo-signal-sig34.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gcc-8.3.0/libgo/go/runtime/signal_gccgo.go.old 2018-01-10 05:15:52.000000000 +0000 -+++ gcc-8.3.0/libgo/go/runtime/signal_gccgo.go 2019-03-03 05:19:28.000000000 +0000 -@@ -111,7 +111,7 @@ - if sigaction(i, nil, &sa) < 0 { - // On GNU/Linux glibc rejects attempts to call - // sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID). -- if GOOS == "linux" && (i == 32 || i == 33) { -+ if GOOS == "linux" && (i == 32 || i == 33 || i == 34) { - return _SIG_DFL - } - throw("sigaction read failure") diff --git a/system/gcc/338-gccgo-syscall.patch b/system/gcc/338-gccgo-syscall.patch deleted file mode 100644 index a4ecb5b6b..000000000 --- a/system/gcc/338-gccgo-syscall.patch +++ /dev/null @@ -1,115 +0,0 @@ -diff -Naur gcc-8.3.0-orig/libgo/go/runtime/stubs.go gcc-8.3.0/libgo/go/runtime/stubs.go ---- gcc-8.3.0-orig/libgo/go/runtime/stubs.go 2019-04-25 03:03:52.311215191 +0000 -+++ gcc-8.3.0/libgo/go/runtime/stubs.go 2019-04-25 03:03:27.973824045 +0000 -@@ -284,8 +284,7 @@ - // For gccgo this is in the C code. - func osyield() - --// For gccgo this can be called directly. --//extern syscall -+//extern __go_syscall6 - func syscall(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) uintptr - - // For gccgo, to communicate from the C code to the Go code. -diff -Naur gcc-8.3.0-orig/libgo/go/syscall/syscall_unix.go gcc-8.3.0/libgo/go/syscall/syscall_unix.go ---- gcc-8.3.0-orig/libgo/go/syscall/syscall_unix.go 2019-04-25 03:04:55.064488337 +0000 -+++ gcc-8.3.0/libgo/go/syscall/syscall_unix.go 2019-04-25 03:08:23.612133013 +0000 -@@ -19,11 +19,8 @@ - Stderr = 2 - ) - --//extern syscall --func c_syscall32(trap int32, a1, a2, a3, a4, a5, a6 int32) int32 -- --//extern syscall --func c_syscall64(trap int64, a1, a2, a3, a4, a5, a6 int64) int64 -+//extern __go_syscall6 -+func syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) uintptr - - const ( - darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8 -@@ -38,14 +35,7 @@ - func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { - Entersyscall() - SetErrno(0) -- var r uintptr -- if unsafe.Sizeof(r) == 4 { -- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0) -- r = uintptr(r1) -- } else { -- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), 0, 0, 0) -- r = uintptr(r1) -- } -+ r := syscall6(trap, a1, a2, a3, 0, 0, 0) - err = GetErrno() - Exitsyscall() - return r, 0, err -@@ -54,47 +44,22 @@ - func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { - Entersyscall() - SetErrno(0) -- var r uintptr -- if unsafe.Sizeof(r) == 4 { -- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), -- int32(a4), int32(a5), int32(a6)) -- r = uintptr(r1) -- } else { -- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), -- int64(a4), int64(a5), int64(a6)) -- r = uintptr(r1) -- } -+ r := syscall6(trap, a1, a2, a3, a4, a5, a6) - err = GetErrno() - Exitsyscall() - return r, 0, err - } - - func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { -- var r uintptr - SetErrno(0) -- if unsafe.Sizeof(r) == 4 { -- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0) -- r = uintptr(r1) -- } else { -- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), 0, 0, 0) -- r = uintptr(r1) -- } -+ r := syscall6(trap, a1, a2, a3, 0, 0, 0) - err = GetErrno() - return r, 0, err - } - - func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { -- var r uintptr - SetErrno(0) -- if unsafe.Sizeof(r) == 4 { -- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), -- int32(a4), int32(a5), int32(a6)) -- r = uintptr(r1) -- } else { -- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), -- int64(a4), int64(a5), int64(a6)) -- r = uintptr(r1) -- } -+ r := syscall6(trap, a1, a2, a3, a4, a5, a6) - err = GetErrno() - return r, 0, err - } -diff -Naur gcc-8.3.0-orig/libgo/runtime/go-varargs.c gcc-8.3.0/libgo/runtime/go-varargs.c ---- gcc-8.3.0-orig/libgo/runtime/go-varargs.c 2015-11-06 19:15:45.000000000 +0000 -+++ gcc-8.3.0/libgo/runtime/go-varargs.c 2019-04-25 03:14:11.404851275 +0000 -@@ -89,3 +89,14 @@ - } - - #endif -+ -+// __go_syscall6 is called by both the runtime and syscall packages. -+// We use uintptr_t to make sure that the types match, since the Go -+// and C "int" types are not the same. -+ -+uintptr_t -+__go_syscall6(uintptr_t flag, uintptr_t a1, uintptr_t a2, uintptr_t a3, -+ uintptr_t a4, uintptr_t a5, uintptr_t a6) -+{ -+ return syscall (flag, a1, a2, a3, a4, a5, a6); -+} diff --git a/system/gcc/339-gccgo-errstr.patch b/system/gcc/339-gccgo-errstr.patch deleted file mode 100644 index f78d18aa4..000000000 --- a/system/gcc/339-gccgo-errstr.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- gcc-8.3.0/libgo/go/syscall/errstr_linux.go 2016-08-06 00:36:33.000000000 +0000 -+++ /dev/null 2019-04-08 15:05:18.560000000 +0000 -@@ -1,31 +0,0 @@ --// errstr_linux.go -- GNU/Linux specific error strings. -- --// Copyright 2010 The Go Authors. All rights reserved. --// Use of this source code is governed by a BSD-style --// license that can be found in the LICENSE file. -- --// We use this rather than errstr.go because on GNU/Linux sterror_r --// returns a pointer to the error message, and may not use buf at all. -- --package syscall -- --import "unsafe" -- --//sysnb strerror_r(errnum int, b []byte) (errstr *byte) --//strerror_r(errnum _C_int, b *byte, len Size_t) *byte -- --func Errstr(errnum int) string { -- a := make([]byte, 128) -- p := strerror_r(errnum, a) -- b := (*[1000]byte)(unsafe.Pointer(p)) -- i := 0 -- for b[i] != 0 { -- i++ -- } -- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM. -- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' { -- c := b[0] + 'a' - 'A' -- return string(c) + string(b[1:i]) -- } -- return string(b[:i]) --} ---- gcc-8.3.0/libgo/go/syscall/errstr.go.old 2016-08-06 00:36:33.000000000 +0000 -+++ gcc-8.3.0/libgo/go/syscall/errstr.go 2019-04-25 05:41:27.915806277 +0000 -@@ -4,8 +4,6 @@ - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - --// +build !linux -- - package syscall - - //sysnb strerror_r(errnum int, buf []byte) (err Errno) diff --git a/system/gcc/340-gccgo-time64-stat.patch b/system/gcc/340-gccgo-time64-stat.patch deleted file mode 100644 index 332712a13..000000000 --- a/system/gcc/340-gccgo-time64-stat.patch +++ /dev/null @@ -1,19 +0,0 @@ -There are more than one st_{a,m,c}tim fields in struct stat on time64 machines. - -Run the Go-isation on all of them. - ---- gcc-8.3.0/libgo/mksysinfo.sh.old 2018-11-09 15:29:52.000000000 +0000 -+++ gcc-8.3.0/libgo/mksysinfo.sh 2019-12-23 00:18:54.129911814 +0000 -@@ -468,9 +468,9 @@ - -e 's/st_size/Size/' \ - -e 's/st_blksize/Blksize/' \ - -e 's/st_blocks/Blocks/' \ -- -e 's/st_atim/Atim/' \ -- -e 's/st_mtim/Mtim/' \ -- -e 's/st_ctim/Ctim/' \ -+ -e 's/st_atim/Atim/g' \ -+ -e 's/st_mtim/Mtim/g' \ -+ -e 's/st_ctim/Ctim/g' \ - -e 's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g' \ - -e 's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g' \ - -e 's/\([^a-zA-Z0-9_]\)_st_timespec_t\([^a-zA-Z0-9_]\)/\1StTimespec\2/g' \ diff --git a/system/gcc/341-gccgo-libucontext-stack.patch b/system/gcc/341-gccgo-libucontext-stack.patch index 2befc5d32..cc88bda5a 100644 --- a/system/gcc/341-gccgo-libucontext-stack.patch +++ b/system/gcc/341-gccgo-libucontext-stack.patch @@ -4,15 +4,39 @@ This causes the Go frontend to sometimes go below the stack. On 32-bit Arm systems, this resulted in #832. It is likely, though not known, that this could have caused other issues we've seen in gccgo as well. ---- gcc-8.5.0/libgo/runtime/go-callers.c.old 2021-05-14 03:42:11.000000000 -0500 -+++ gcc-8.5.0/libgo/runtime/go-callers.c 2022-12-25 01:46:15.834110528 -0600 -@@ -117,7 +117,8 @@ - Solaris (http://gcc.gnu.org/PR52583 comment #21). */ +Additionally, since we strip libgo.so, filename is always NULL. This caused +the unwinder to continue through runtime_mstart which caused the same issue. +--- gcc-8.5.0/libgo/runtime/go-callers.c.old 2023-01-01 17:56:27.302982459 -0600 ++++ gcc-8.5.0/libgo/runtime/go-callers.c 2023-01-01 17:58:00.612903483 -0600 +@@ -165,26 +165,11 @@ if (function != NULL) { - if (__builtin_strcmp (function, "makecontext") == 0) + if (__builtin_strcmp (function, "makecontext") == 0 -+ || __builtin_strcmp (function, "libucontext_makecontext") == 0) ++ || __builtin_strcmp (function, "libucontext_makecontext") == 0 ++ || __builtin_strcmp (function, "runtime_mstart") == 0 ++ || __builtin_strcmp (function, "runtime.kickoff") == 0 ++ || __builtin_strcmp (function, "runtime.main") == 0) return 1; - if (filename != NULL) - { +- if (filename != NULL) +- { +- const char *p; +- +- p = strrchr (filename, '/'); +- if (p == NULL) +- p = filename; +- if (__builtin_strcmp (p, "/proc.c") == 0) +- { +- if (__builtin_strcmp (function, "runtime_mstart") == 0) +- return 1; +- } +- else if (__builtin_strcmp (p, "/proc.go") == 0) +- { +- if (__builtin_strcmp (function, "runtime.kickoff") == 0 +- || __builtin_strcmp (function, "runtime.main") == 0) +- return 1; +- } +- } + } + + return arg->index >= arg->max; diff --git a/system/gcc/342-gccgo-more-unwinding.patch b/system/gcc/342-gccgo-more-unwinding.patch deleted file mode 100644 index 7f059b4dc..000000000 --- a/system/gcc/342-gccgo-more-unwinding.patch +++ /dev/null @@ -1,37 +0,0 @@ -The fix for #832 was incomplete. Since we strip libgo.so, filename is -always NULL. This caused the unwinder to continue through -runtime_mstart which caused the same issue. ---- gcc-8.5.0/libgo/runtime/go-callers.c.old 2023-01-01 17:56:27.302982459 -0600 -+++ gcc-8.5.0/libgo/runtime/go-callers.c 2023-01-01 17:58:00.612903483 -0600 -@@ -118,27 +118,11 @@ - if (function != NULL) - { - if (__builtin_strcmp (function, "makecontext") == 0 -- || __builtin_strcmp (function, "libucontext_makecontext") == 0) -+ || __builtin_strcmp (function, "libucontext_makecontext") == 0 -+ || __builtin_strcmp (function, "runtime_mstart") == 0 -+ || __builtin_strcmp (function, "runtime.kickoff") == 0 -+ || __builtin_strcmp (function, "runtime.main") == 0) - return 1; -- if (filename != NULL) -- { -- const char *p; -- -- p = strrchr (filename, '/'); -- if (p == NULL) -- p = filename; -- if (__builtin_strcmp (p, "/proc.c") == 0) -- { -- if (__builtin_strcmp (function, "runtime_mstart") == 0) -- return 1; -- } -- else if (__builtin_strcmp (p, "/proc.go") == 0) -- { -- if (__builtin_strcmp (function, "runtime.kickoff") == 0 -- || __builtin_strcmp (function, "runtime.main") == 0) -- return 1; -- } -- } - } - - return arg->index >= arg->max; diff --git a/system/gcc/342-gccgo-reflect-underscore.patch b/system/gcc/342-gccgo-reflect-underscore.patch new file mode 100644 index 000000000..8edad0e39 --- /dev/null +++ b/system/gcc/342-gccgo-reflect-underscore.patch @@ -0,0 +1,28 @@ +See also: https://github.com/modern-go/reflect2/issues/21 + +--- gcc-13.3.0/libgo/go/runtime/malloc.go.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libgo/go/runtime/malloc.go 2024-06-03 19:25:48.497999687 -0500 +@@ -1297,6 +1297,11 @@ + return mallocgc(typ.size, typ, true) + } + ++//go:linkname reflect_unsafe_New_one_underscore reflect.unsafe_New ++func reflect_unsafe_New_one_underscore(typ *_type) unsafe.Pointer { ++ return mallocgc(typ.size, typ, true) ++} ++ + //go:linkname reflectlite_unsafe_New internal_1reflectlite.unsafe__New + func reflectlite_unsafe_New(typ *_type) unsafe.Pointer { + return mallocgc(typ.size, typ, true) +@@ -1319,6 +1324,11 @@ + return newarray(typ, n) + } + ++//go:linkname reflect_unsafe_NewArray_one_underscore reflect.unsafe_NewArray ++func reflect_unsafe_NewArray_one_underscore(typ *_type, n int) unsafe.Pointer { ++ return newarray(typ, n) ++} ++ + func profilealloc(mp *m, x unsafe.Pointer, size uintptr) { + c := getMCache(mp) + if c == nil { diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD index b7dcfb592..ecdfeb48a 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -1,12 +1,12 @@ # Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org> pkgname=gcc -pkgver=8.5.0 +pkgver=13.3.0 [ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" [ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="$pkgname$_target" -pkgrel=4 +pkgrel=0 pkgdesc="The GNU Compiler Collection" url="https://gcc.gnu.org" arch="all" @@ -32,6 +32,7 @@ LIBGOMP=true LIBGCC=true LIBATOMIC=true LIBITM=true +LIBSANITIZER=true if [ "$CHOST" != "$CTARGET" ]; then if [ "$BOOTSTRAP" = nolibc ]; then @@ -48,6 +49,7 @@ if [ "$CHOST" != "$CTARGET" ]; then LIBGOMP=false LIBATOMIC=false LIBITM=false + LIBSANITIZER=false # reset target flags (should be set in crosscreate abuild) # fixup flags. seems gcc treats CPPFLAGS as global without @@ -109,6 +111,7 @@ esac $LIBATOMIC && subpackages="$subpackages libatomic::$CTARGET_ARCH" $LIBGCC && subpackages="$subpackages libgcc::$CTARGET_ARCH" $LIBQUADMATH && subpackages="$subpackages libquadmath::$CTARGET_ARCH" +$LIBSANITIZER && subpackages="$subpackages libsanitizer::$CTARGET_ARCH" if $LIBGOMP; then depends="$depends libgomp=$_gccrel" subpackages="$subpackages libgomp::$CTARGET_ARCH" @@ -141,20 +144,21 @@ makedepends="$makedepends_build $makedepends_host" source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz 0002-posix_memalign.patch - 0008-s390x-muslldso.patch - 0009-microblaze-pr65649.patch - 0010-ldbl128-config.patch - 0011-m68k.patch 0012-static-pie.patch - 0016-invalid-tls-model.patch 002_all_default-relro.patch 005_all_default-as-needed.patch - 006_as-needed-gold.patch + 007_all_alpha-mieee-default.patch 011_all_default-warn-format-security.patch 012_all_default-warn-trampolines.patch 020_all_msgfmt-libstdc++-link.patch + 050_all_sanitizer-lfs.patch 051_all_libiberty-pic.patch + 076_all_match.pd-don-t-emit-label-if-not-needed.patch + 078_all_match.pd-CSE-the-dump-output-check.patch + 092_all_riscv_PR109760-gstreamer.patch + + 101-pr115836.patch 201-ada.patch 202-ibm-ldbl.patch @@ -169,27 +173,23 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz fix-cxxflags-passing.patch ada-shared.patch - 320-libffi-gnulinux.patch 330-gccgo-link-to-ucontext.patch 331-gccgo-use-real-off_t-type.patch 332-gccgo-sysinfo.patch - 333-gccgo-signal-ppc64.patch 334-gccgo-signal-shell.patch 335-gccgo-signal-ppc32.patch - 336-gccgo-mmap64.patch - 337-gccgo-signal-sig34.patch - 338-gccgo-syscall.patch - 339-gccgo-errstr.patch - 340-gccgo-time64-stat.patch 341-gccgo-libucontext-stack.patch - 342-gccgo-more-unwinding.patch + 342-gccgo-reflect-underscore.patch + libgo-musl-1.2.3.patch add-classic_table-support.patch gcc-5.4.0-locale.patch - backport-r267157-posix-conformant-snprintf.patch + sanitation.patch + risc-san.patch - libgo-musl-1.2.3.patch + match-split.patch + insn-split.patch " # we build out-of-tree @@ -232,7 +232,7 @@ build() { cd "$_gccdir" case "$CTARGET" in - aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64 --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419";; + aarch64*-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";; armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";; armv6-*-*-*eabihf) _arch_configure="--with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-abi=aapcs-linux";; armv7-*-*-*eabihf) _arch_configure="--with-arch=armv7-a --with-tune=generic-armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-abi=aapcs-linux --with-mode=thumb";; @@ -241,8 +241,8 @@ build() { mips-*-*-*) _arch_configure="--with-arch=mips3 --with-mips-plt --with-abi=32"; _hash_style="sysv";; mips32el-*-*-*) _arch_configure="--with-arch=mips32 --with-mips-plt --with-abi=32"; _hash_style="sysv";; powerpc-*-*-*) _arch_configure="--enable-secureplt --enable-decimal-float=no";; - powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no";; powerpc64le*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no";; + powerpc64*-*-*-*) _arch_configure="--with-abi=elfv2 --enable-secureplt --enable-decimal-float=no";; i486-*-*-*) _arch_configure="--with-arch=i486 --with-tune=generic --enable-cld";; i586-*-*-*) _arch_configure="--with-arch=i586 --with-tune=pentium2 --enable-cld --enable-mmx";; pentium3-*-*-*) _arch_configure="--with-arch=pentium3 --with-tune=pentium-m";; @@ -251,9 +251,6 @@ build() { case "$CTARGET_LIBC" in musl) - # musl does not support mudflap - # libmpx uses secure_getenv and struct _libc_fpstate not present in musl - _libc_configure="--disable-libmpx --disable-libmudflap --disable-libsanitizer" _symvers="--disable-symvers" export libat_cv_have_ifunc=no export ac_cv_type_off64_t=no @@ -271,6 +268,7 @@ build() { $LIBGOMP || _bootstrap_configure="$_bootstrap_configure --disable-libgomp" $LIBATOMIC || _bootstrap_configure="$_bootstrap_configure --disable-libatomic" $LIBITM || _bootstrap_configure="$_bootstrap_configure --disable-libitm" + $LIBSANITIZER || _bootstrap_configure="$_bootstrap_configure --disable-libsanitizer" $LIBQUADMATH || _arch_configure="$_arch_configure --disable-libquadmath" msg "Building the following:" @@ -312,13 +310,17 @@ build() { --enable-default-ssp \ --enable-cloog-backend \ --enable-languages=$_languages \ + --enable-linker-build-id \ $_arch_configure \ $_libc_configure \ $_cross_configure \ $_bootstrap_configure \ + --with-matchpd-partitions=32 \ --with-system-zlib \ --with-linker-hash-style=$_hash_style - make + make \ + STAGE1_CFLAGS="$CFLAGS" STAGE1_LDFLAGS="$LDFLAGS" \ + BOOT_CFLAGS="$CFLAGS" BOOT_LDFLAGS="$LDFLAGS" } check() { @@ -504,6 +506,29 @@ libquadmath() { mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/ } +libsanitizer() { + pkgdesc="Runtime code linting libraries for GCC" + depends= + + # https://github.com/google/sanitizers/issues/794 + # https://reviews.llvm.org/D28609 ("ported to GCC") + case $CTARGET_ARCH in + pmmx|x86|i528|armel|armhf|armv7|m68k|mips32|mips32el|ppc) + sanitizer_extras="";; + *) + sanitizer_extras="lsan tsan";; + esac + + mkdir -p "$subpkgdir"/usr/lib + for san in asan sanitizer ubsan ${sanitizer_extras}; do + mv "$pkgdir"/usr/lib/lib${san}* "$subpkgdir"/usr/lib/ + done + + mkdir -p "$subpkgdir"/$_gcclibdir/include + mv "$pkgdir"/$_gcclibdir/include/sanitizer \ + "$subpkgdir"/$_gcclibdir/include/ +} + gfortran() { pkgdesc="GNU Fortran Compiler" depends="gcc=$_gccrel libgfortran=$_gccrel" @@ -548,46 +573,42 @@ gnat() { mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ } -sha512sums="92f599680e6b7fbce88bcdda810f468777d541e5fddfbb287f7977d51093de2a5178bd0e6a08dfe37090ea10a0508a43ccd00220041abbbec33f1179bfc174d8 gcc-8.5.0.tar.xz +sha512sums="ed5f2f4c6ed2c796fcf2c93707159e9dbd3ddb1ba063d549804dd68cdabbb6d550985ae1c8465ae9a336cfe29274a6eb0f42e21924360574ebd8e5d5c7c9a801 gcc-13.3.0.tar.xz 6d84354e6df96d5ea244eb3bb5f044781796b88040b11c78fb6ee509e5aac19d46e0e92ca836e98e6495d9751f52439833b748efc419e4f5d5301fb549c4dcc9 0002-posix_memalign.patch -7f434a7350c9b06d0ae7cc18a569d813238483afa34b0801d112844a0dfe6164ae36b0416955fd4da7a8caa54672247f319a8ec7ce4b6a97a5f4e17ec083112a 0008-s390x-muslldso.patch -b8207c1be82b20fdad2596bb0a60469db52257456d0925bacf48b44899f4c6ece93c501347e1ffe92fd372c30f90d05a6d8d8078876abf4cf2deae3dbb1a1f58 0009-microblaze-pr65649.patch -66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch -cd3ba928121e8578ba9f73215e4d81ee3ebbab33e00b04cdfd62b46d21f9536297ae12dc021aad6e56f3b28d9d544727331bbe6db1e3438d7b9545b2c3250906 0011-m68k.patch -9fbfd2213b445a82ae00c72412a8f87a2d0afc8614168698a12dfc6ad874b525de7f15b3eb2d54b7737d0a9d90f18f134e7cdbf4259e32d9a631c3795b8d44be 0012-static-pie.patch -dfedf48829cff22ee836ece743de20ad467b40e86c8f4034326a4c32df35b10affd69d6b9ab3382df2871a99ad0c2e99d4342183b59f9bca7f15112eed58ec8d 0016-invalid-tls-model.patch -625c02e03c2f1db04da12cc6a086ec85790a031a13df36486243fd9569cd17f7c8ebeec91ac16cc1f87c3ec1ffe4c421153e98a9aeb5eea35943a6f015d81f50 002_all_default-relro.patch -02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch -9073a5ae46e46a44a77adba183db301194a3666afca07a8444a4c10dc2c087dd41d6065a051b1024454bb37bee06fabf4361e5fae62dab8d4c9620520924f606 006_as-needed-gold.patch -622fdbcbbf2feb86bd839af627ec3613c6d2c77b14d37d31165b19f73f45b3663a203efff5d224f194edb15eb62d3d5885e32f85d1b584f071e580fea4e12664 011_all_default-warn-format-security.patch -03cddde56b2a355f08716c8efcd5616606d42946c87831d77d55570636c46e351e81a04c7dabd3466d9406c40476bead857cfe1eceaf7f0d86dd2757c8cf4a9e 012_all_default-warn-trampolines.patch -d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch -0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch -a3702c1f642412413d0ffc69f6439a3e101b2b56c16610f94c66556c88e52d01b0b6d1e57bfc5a972668f976c02fbf2fc22bcf707b000867e44744d9eb7b7566 201-ada.patch -152639228a189b211df660b5b7543e3744cf136e80fed7f1ac37a3bc1b692fba3431a0d62337e769ee8f323188acdf11092cb1b2ef5c75fafee9628d13bc4163 202-ibm-ldbl.patch -98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch -9fc745619d2628ec21eed1c8de78780ca8960a0ca41f725991202b212bdeb31eb803d9ea2ad18e0278620c2422a99f253f4d2a20d3a354bf88b87a55fc966d9d 206-arm-unwind-functionise.patch -d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch -600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch -dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch -fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch -35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch -3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch -f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch -8efd028febb962ae100be32f72f7450c4f77d67ad96a5f47072136cdf47043f9d54835a87c7ab5aaa0fa0108c4c7a97ba2d7732d5aaf2efce70fe1f7e1c39d6e 330-gccgo-link-to-ucontext.patch -24c8708f64b9b7945b3f07e9bbecf17ab8bcde2524f49cbd694ca2f6146ccc3f13bb027db282f326525ea79d50a2868fa3fa2b0d688a914b5ea77bbfd7e5cbe4 331-gccgo-use-real-off_t-type.patch -31f9d85faa8648d140834646fc2bc7733eb362bfb87d696c5f375f9c0a3e4c3df41708a9a37c49bc0757513a7704976b9a5e21aa5c2de4b380d47d7e2cbde214 332-gccgo-sysinfo.patch -ef6ff46d571814ce2f6db549bfb9b9f5cc55d46085b197c36627a72e4f355fcbeb41d04fabd3029f3bc536fc48155fe3feab58a7a6ece9dcd19409ea44c17b0b 333-gccgo-signal-ppc64.patch -ab7a19d2702d232c9c1242fbdf9bd782e195d94104c0278e3b9ce435060a169094525ca53b615b3a9e62786db77bba836ecd495d58b544df474b13348432c200 334-gccgo-signal-shell.patch -e755072a3c71ada6cde354dd258fae029919e1116048068368d38411ca28a6ad8856702498d6667b0dcbb1d09fcb3fd66669aa79739a5e574a9cd490bd92ce90 335-gccgo-signal-ppc32.patch -de0cc0f9356c9ee5ea7b0f954441b59115f4a8f8f63573d0c17b6537e6f37641cf137531b496fc192d38035c2c4ba8175d36cbd7da15cbfcf8dc18c049c0f111 336-gccgo-mmap64.patch -c2916948b028e1e990e1953875b884561c0f8dd105c1ec03073795df9a47ec2c627cbc95ca0ec98ab9177bf2b7c8458bf3fd09f780fa6c301995846f6317e366 337-gccgo-signal-sig34.patch -0bdf592ec8444c6e253f1a7626b4e618b2e18e6d0b5a4548f90903f9de80a7cf3ea536750c2743f436a05faa1e7b65e52a391da9732dce51c4b00e23853e5365 338-gccgo-syscall.patch -b32d496a3a04c2357200b75dbf7f667fb57bf5af4f0c68926bc58f6600e4f23caa48aad2eaf073f1408168cacf27e8f11a6062c65bf5bb67458eedef698871d4 339-gccgo-errstr.patch -4db4a00dff1d3cb3ecbc713659316782ac839478ff1fd7166cfa64a2c7cee0ba2a0d3fa23cb858af7d8f59a6ac2bdf40e63a45c307b89eefe2a4e888707f615b 340-gccgo-time64-stat.patch -71ee2ce239c62bedc90d0688a40e3e381e641ba9e322c6319c2f6a4362c17d60a232dcb32fd08f5ff9ed5c058c0a010362197839cb391d85bc4a6446943ad4b2 341-gccgo-libucontext-stack.patch -7bb23955ddd67319c2aaae10bb1545ea299b96e54f429423fa6db4ff9af119312f3c8a876b3912c8811403543fabb50e7c7b94b0d2145a4f4e6ef1959d456128 342-gccgo-more-unwinding.patch +f0bda72a54d2a81c4e7b27cc06347409d9e3be708d51e280ad1130c7e1d2db6e0c4e7b2dd3c606f6a4ec78c1eb293a26f76dda8210124d9f928f351d46be7d7e 0012-static-pie.patch +2cb8f3773897e34d2d194076396d7fc6413d28b5f0546d092f83c22f229936f7e329b3eaaf86a6d22e0f609ae2b66e82b656685e9e9a51ed2f89e9efaa5e9534 002_all_default-relro.patch +879c377122af10a4e444ab67cfe81927cc4e574c63d0a619c20f094e87218ab7961dcc96d93830891af688182a5feafeb787d79b58a5125cf20258baa13c94d0 005_all_default-as-needed.patch +b0a6117aad4f72d62777004fbb0a93cb0ae613d44846162556535f1751be998e6cde61329451026bc539d119ae2d54b42eaff54b92f2f68cb14c2b1384cbc928 007_all_alpha-mieee-default.patch +abf28cf8495ce63eeeb9704a83e889c9b7819cc0394807ba966fe57dadc5f1e04478edc6d28af293330286dc70af4b513376bf53ddf705810c3b721b5089c511 011_all_default-warn-format-security.patch +6fa1f7bb936f8c634579689aa5b36a23a89e1f065514b1c946a410cd0057744135db833bb5cbb86a15738ebac787b5803bba0a2d4d0da628dfbd23d9bcd577b4 012_all_default-warn-trampolines.patch +f20ba1e7a6febf099a79c4b4251e15331e6de13531b787c2e2d14c908e3ff1e0e34a79824e7f6470331adf9c01c3302813dfbd508fec021a7f86f833c806806b 020_all_msgfmt-libstdc++-link.patch +8cadf32d4f9e58ae174640be419478ee709702c1df3faffb2cfc4e48418260b8bbadf6c18fbaf43cc32aacb889f090045265c3f51e9366208837a46cbf68ab6e 050_all_sanitizer-lfs.patch +ec0a6613a21bd8352b73f693ee6055e81e4ef056b8b2b9916aa075649477b0c3f855fcfb37aa53301a559f05e5cfa41661c274f3a3c6cabb44a7adecf239473a 051_all_libiberty-pic.patch +0d505f08842bd75c686b18f50bc988078dce07b69ef8b6caa53e5e3a93e39527ab16f1d32a7f1f132279c3ac430a10b4e1aad7fc0bc2b6560fc33a1b65f6c109 076_all_match.pd-don-t-emit-label-if-not-needed.patch +b3cb3cad951c518b399f4fd0d4be07089ca1abf7a3271aaac4c25d8cd34a9b6d2bd6fa68164cf7f3967813f019db8dcf0ae8746f94ac6a4b85209c4012a8936f 078_all_match.pd-CSE-the-dump-output-check.patch +ce44d0bfa646394114c6e77f70da26ac4879cb2198a3bc4108ce080b7a247d6c0b0213c02b9bacbcd0b477a8e22a831a7dae3691f4f0462eaddecb457cd9eee6 092_all_riscv_PR109760-gstreamer.patch +eade22edbb70b57b06349bbf2f39def90bbe4e3eeb0d121dd2e07e1deaf73407e5247698d05660de67072672534461442b45e314d53daf691a10275f60fdc51c 101-pr115836.patch +ad971ebaa77907a26e4c268feb052d06b2df1530ed39b9c684a49bdf1024ad6b439bb8b28a957327635c83a97dcca3cee0875cfe9836f8fc3e06cdb137281e42 201-ada.patch +80748e1f6a287a0f645eecac54c5181156a20ab0facc826e5b1768fec87df9d4e9fd44362370dbbe5f78b25c3bba3a20a6acfbe6ce25ddd99bd6d085bfc6c112 202-ibm-ldbl.patch +ae30090390e3604e1e508edb36bc3a01283fe28657d63ae6d6238dd9f55cce587552c5a482425673aff0d0ccc9d99a649e24b552573e7b2ea29063fc5c0aa497 205-nopie.patch +ae2c2fe6abe678e34d60cb05e42c60d6b499f206d965066ee8bd26f9cabfbb69cab0f0061731d21b96a5f2ad67bebc4b49dbe39cbdd01dce8b61f829f4b3f708 206-arm-unwind-functionise.patch +3c66bbcde298cdc188bb68dfe16e074bda7355c2307b8263c75cb250e244dd604faf2e4bf782f8f39160892b5a433996615fd0597ce5bd20bd5c1b766bf12d2d libgcc-always-build-gcceh.a.patch +40322bba8b3bfc26f0cd92bc9849c59560a6736dd22941bde4b6a1d9846e798d5acfe4fdc3200aafabbf6168349b08070a9e31d41967a48e84dbc608723cdcf3 gcc-4.9-musl-fortify.patch +7800fd0e1bcb33779c673c2effa8a61c4288979fba7d9dd215777ebec4d2cce5fe42fe72dcbce078bbc2268db58a25b42fc1a7327c1156e2db6a694b9303dbec gcc-6.1-musl-libssp.patch +d8a184ff286516f49629fe97423b5584a7799069de2c3f0d45c2ff25be8e6e8706f9ca0e811f760cd3e0089bd82657091a2fa13139f4c3cc7d5d5dd25f82d5e8 gcc-pure64.patch +eb1d27d501e1c5099bbc476cda27738a13a3c27185d2e4f46c770dda30b7b0e774b58a62afad8ead44298296ce60b409fbab2da08bf114a66fa269f02d4132d7 fix-cxxflags-passing.patch +16d66b34de05a220d43ba0327bc75aabc107b36c629efa4b2f14662f6b1c805d8123aeb0a92e7e908c059b3d910acc2e7e1b50c7ac34a004d8a20b9a140427f4 ada-shared.patch +ce69e4cceb212e7b8e9af72a97b336dc3f38d7a30fc0c656a56ab3b431679a07efd746fd1cc39f913934f603c83085dd9e72a1b516636ba85f43b2cd96568404 330-gccgo-link-to-ucontext.patch +25223ce10dbeb6725834fbd2ea57752c9d7b96f9c1e0d1f46927c7b5236c1bed1361b28869e9830ad39818788e491609ef9a79e9255a565a2b6fb3c56c3bc48d 331-gccgo-use-real-off_t-type.patch +2b833b6bcba8eb8914499f3432679635eb1e186f0ab1b0cd2b0012edfe6c296f89c05097476817c9947a0f17ebe031cc1708335e6baa8d3d211116e10cbc7865 332-gccgo-sysinfo.patch +dc03c7b660f0142aa16e78e4e50581c883f6632f4794131f1131e0dc8fd500ba5d6a0046a36dc621c618a558b69e426a9bd1baea63faa5f64d7663915c062bbe 334-gccgo-signal-shell.patch +00f43d3d3f23c106ff020699397e82cf63ef30820e74ff3f7a82bcf55e5245011bb4a8ef84f0704287201ec8138692c548d4b6dae2d3e2aaf56e40d57ca2873d 335-gccgo-signal-ppc32.patch +3cbe5e879902a73121b22d903be605c7100e607864b0e305d6825a4083502fbe94be9a4166fb833b28e5d18cd7548f317719e28e3579194ea3e1b626450c943b 341-gccgo-libucontext-stack.patch +76d141a9e245595eab66cc4ddbfda57330790e04960de5d1c4e1e97efb52291d18087840f7494c0310afc3f093e1fad8c6070928f489c97201f32782f67559fd 342-gccgo-reflect-underscore.patch +fa59b0fb081d97f8f63506b8793699588a95c602b5d468140eb1e80456597e52e1cc45dc0b234ac8e60e2b0cd606d94d111c8b0ae64c0a2be1bc1b8a184ceb93 libgo-musl-1.2.3.patch 1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch -67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch -65a4d8bf9cefcbc79e86015ef4376b2794492d6cae77065359b35bb4ed630dde6256982cd5e43ed837cbbdab366ea376da9f1c83f80ddf6dc53ab017b378c3cd backport-r267157-posix-conformant-snprintf.patch -fa59b0fb081d97f8f63506b8793699588a95c602b5d468140eb1e80456597e52e1cc45dc0b234ac8e60e2b0cd606d94d111c8b0ae64c0a2be1bc1b8a184ceb93 libgo-musl-1.2.3.patch" +a09b3181002798d1b17b8374eba6bec18e67d4d4f30677311c330b599e231e97cf02c1b9b79c0829952f5027016e01146743b665b19558ed2693c60a567823fb gcc-5.4.0-locale.patch +7fa3f66a9147e13091da7fdf15197aca85e0500756392e1c75eb2e2f77dce6d148277aea2a8cb463770f7b46424a94cb5f60514529a565b4ebb23236dcc7c366 sanitation.patch +f167da2df3c386dd2f4d39e1fef0964d0fbf7ba35b9432675ada61a7fe3213d4825b579ebb577f46b28c5556b2ada78ed6b7b8b6471b9d9a0684514a73650595 risc-san.patch +ff6159633f04d26eadc79895dc24ccb46671a04fdc728cbbac86964a14ce17e2e51cd7668947dfe06b9168bb9b8575a80955012e5f51295ea02f4f3169e07541 match-split.patch +ee626cbe4bdda5b868980c86ca066d33167d06517db676e43d0719c4ad7d11e99b3a0151927f15c93ab89f6c76dd12bd48d402d25771fa3fd175273248824eda insn-split.patch" diff --git a/system/gcc/ada-shared.patch b/system/gcc/ada-shared.patch index 6f1c16aff..22a7dc256 100644 --- a/system/gcc/ada-shared.patch +++ b/system/gcc/ada-shared.patch @@ -2,10 +2,10 @@ Index: b/gcc/ada/link.c =================================================================== --- a/gcc/ada/link.c +++ b/gcc/ada/link.c -@@ -105,9 +105,9 @@ - +@@ -107,9 +107,9 @@ #elif defined (__FreeBSD__) const char *__gnat_object_file_option = "-Wl,@"; + const char *__gnat_run_path_option = ""; -const char *__gnat_run_path_option = "-Wl,-rpath,"; -char __gnat_shared_libgnat_default = STATIC; -char __gnat_shared_libgcc_default = STATIC; @@ -15,10 +15,10 @@ Index: b/gcc/ada/link.c int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; const char *__gnat_object_library_extension = ".a"; -@@ -127,9 +127,9 @@ - +@@ -129,9 +129,9 @@ #elif defined (linux) || defined(__GLIBC__) const char *__gnat_object_file_option = "-Wl,@"; + const char *__gnat_run_path_option = ""; -const char *__gnat_run_path_option = "-Wl,-rpath,"; -char __gnat_shared_libgnat_default = STATIC; -char __gnat_shared_libgcc_default = STATIC; diff --git a/system/gcc/backport-r267157-posix-conformant-snprintf.patch b/system/gcc/backport-r267157-posix-conformant-snprintf.patch deleted file mode 100644 index adedf0ce9..000000000 --- a/system/gcc/backport-r267157-posix-conformant-snprintf.patch +++ /dev/null @@ -1,80 +0,0 @@ -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87096 - -GCC's "optimised" snprintf is not POSIX conformant - ---- trunk/gcc/gimple-ssa-sprintf.c 2018/12/07 17:02:11 266897 -+++ trunk/gcc/gimple-ssa-sprintf.c 2018/12/14 22:38:08 267157 -@@ -3899,6 +3899,7 @@ - /* True when the destination size is constant as opposed to the lower - or upper bound of a range. */ - bool dstsize_cst_p = true; -+ bool posunder4k = true; - - if (idx_dstsize == HOST_WIDE_INT_M1U) - { -@@ -3931,11 +3932,20 @@ - "specified bound %wu exceeds maximum object size " - "%wu", - dstsize, target_size_max () / 2); -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Even though not all POSIX implementations -+ conform to the requirement, avoid folding in this case. */ -+ posunder4k = false; - } - else if (dstsize > target_int_max ()) -- warning_at (gimple_location (info.callstmt), info.warnopt (), -- "specified bound %wu exceeds %<INT_MAX%>", -- dstsize); -+ { -+ warning_at (gimple_location (info.callstmt), info.warnopt (), -+ "specified bound %wu exceeds %<INT_MAX%>", -+ dstsize); -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Avoid folding in that case. */ -+ posunder4k = false; -+ } - } - else if (TREE_CODE (size) == SSA_NAME) - { -@@ -3944,9 +3954,29 @@ - if (vr->type == VR_RANGE - && TREE_CODE (vr->min) == INTEGER_CST - && TREE_CODE (vr->max) == INTEGER_CST) -- dstsize = (warn_level < 2 -- ? TREE_INT_CST_LOW (vr->max) -- : TREE_INT_CST_LOW (vr->min)); -+ { -+ unsigned HOST_WIDE_INT minsize = TREE_INT_CST_LOW (vr->min); -+ unsigned HOST_WIDE_INT maxsize = TREE_INT_CST_LOW (vr->max); -+ dstsize = warn_level < 2 ? maxsize : minsize; -+ -+ if (minsize > target_int_max ()) -+ warning_at (gimple_location (info.callstmt), info.warnopt (), -+ "specified bound range [%wu, %wu] exceeds " -+ "%<INT_MAX%>", -+ minsize, maxsize); -+ -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Avoid folding if that's possible. */ -+ if (maxsize > target_int_max ()) -+ posunder4k = false; -+ } -+ else if (vr->type == VR_VARYING) -+ { -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Since SIZE's range is unknown, avoid -+ folding. */ -+ posunder4k = false; -+ } - - /* The destination size is not constant. If the function is - bounded (e.g., snprintf) a lower bound of zero doesn't -@@ -4033,7 +4073,7 @@ - the call. Avoid this optimization when -frounding-math is in effect - and the format string contains a floating point directive. */ - bool call_removed = false; -- if (success && optimize > 0) -+ if (!posunder4k && success && optimize > 0) - { - /* Save a copy of the iterator pointing at the call. The iterator - may change to point past the call in try_substitute_return_value diff --git a/system/gcc/fix-cxxflags-passing.patch b/system/gcc/fix-cxxflags-passing.patch index 8eb1de77d..ec98ba275 100644 --- a/system/gcc/fix-cxxflags-passing.patch +++ b/system/gcc/fix-cxxflags-passing.patch @@ -1,6 +1,6 @@ --- gcc-4.8.1/Makefile.in.orig +++ gcc-4.8.1/Makefile.in -@@ -169,6 +169,7 @@ +@@ -178,6 +178,7 @@ # built for the build system to override those in BASE_FLAGS_TO_PASSS. EXTRA_BUILD_FLAGS = \ CFLAGS="$(CFLAGS_FOR_BUILD)" \ diff --git a/system/gcc/gcc-4.9-musl-fortify.patch b/system/gcc/gcc-4.9-musl-fortify.patch index daae954c8..fba37f257 100644 --- a/system/gcc/gcc-4.9-musl-fortify.patch +++ b/system/gcc/gcc-4.9-musl-fortify.patch @@ -1,6 +1,6 @@ --- gcc-4.9.2/gcc/config/linux.h.orig 2015-03-09 13:27:13.289736710 +0000 +++ gcc-4.9.2/gcc/config/linux.h 2015-03-09 13:29:32.295625046 +0000 -@@ -146,6 +146,8 @@ +@@ -159,6 +159,8 @@ #ifdef NATIVE_SYSTEM_HEADER_DIR #define INCLUDE_DEFAULTS_MUSL_NATIVE \ diff --git a/system/gcc/gcc-5.4.0-locale.patch b/system/gcc/gcc-5.4.0-locale.patch index dca3ba9e8..e1b398b7f 100644 --- a/system/gcc/gcc-5.4.0-locale.patch +++ b/system/gcc/gcc-5.4.0-locale.patch @@ -1,7 +1,7 @@ diff --git gcc-5.4.0/libstdc++-v3/config/locale/generic/c_locale.cc.orig gcc-5.4.0/libstdc++-v3/config/locale/generic/c_locale.cc --- gcc-5.4.0/libstdc++-v3/config/locale/generic/c_locale.cc.orig +++ gcc-5.4.0/libstdc++-v3/config/locale/generic/c_locale.cc -@@ -213,9 +213,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION +@@ -242,9 +242,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Currently, the generic model only supports the "C" locale. // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html __cloc = 0; diff --git a/system/gcc/gcc-6.1-musl-libssp.patch b/system/gcc/gcc-6.1-musl-libssp.patch index fe5c61434..05a9cf8bf 100644 --- a/system/gcc/gcc-6.1-musl-libssp.patch +++ b/system/gcc/gcc-6.1-musl-libssp.patch @@ -1,4 +1,5 @@ -Author: Timo Teräs <timo.teras@iki.fi> +Gentoo: https://bugs.gentoo.org/706210, https://bugs.gentoo.org/747346 +Alpine Author: Timo Teräs <timo.teras@iki.fi> Alpine musl package provides libssp_nonshared.a. We link to it unconditionally, as otherwise we get link failures if some objects are -fstack-protector built @@ -6,9 +7,11 @@ and final link happens with -fno-stack-protector. This seems to be the common case when bootstrapping gcc, the piepatches do not seem to fully fix the crosstoolchain and bootstrap sequence wrt. stack-protector flag usage. ---- gcc-6.1.0/gcc/gcc.c.orig -+++ gcc-6.1.0/gcc/gcc.c -@@ -870,8 +870,7 @@ +This is done by Gentoo and us (Adélie) as well. + +--- gcc-6.1.0/gcc/gcc.cc ++++ gcc-6.1.0/gcc/gcc.cc +@@ -988,8 +988,7 @@ #ifndef LINK_SSP_SPEC #ifdef TARGET_LIBC_PROVIDES_SSP diff --git a/system/gcc/gcc-pure64.patch b/system/gcc/gcc-pure64.patch index 2c350fe5a..d55c04c85 100644 --- a/system/gcc/gcc-pure64.patch +++ b/system/gcc/gcc-pure64.patch @@ -1,16 +1,8 @@ ---- ./gcc/config/i386/t-linux64.orig 2013-01-14 16:32:37.000000000 +0000 -+++ ./gcc/config/i386/t-linux64 2013-04-22 06:12:32.984439677 +0000 -@@ -34,6 +34,6 @@ - comma=, - MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) - MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) --MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) --MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) -+MULTILIB_OSDIRNAMES = m64=../lib -+MULTILIB_OSDIRNAMES+= m32=../lib32 - MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) ---- ./gcc/config/aarch64/t-aarch64-linux.orig -+++ ./gcc/config/aarch64/t-aarch64-linux +https://bugs.gentoo.org/675954 +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90077 + +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux @@ -22,7 +22,7 @@ LIB1ASMFUNCS = _aarch64_sync_cache_range @@ -19,19 +11,21 @@ +MULTILIB_OSDIRNAMES = mabi.lp64=../lib MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) - MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32 ---- ./gcc/config/s390/t-linux64.orig -+++ ./gcc/config/s390/t-linux64 -@@ -7,5 +7,5 @@ - MULTILIB_OPTIONS = m64/m31 - MULTILIB_DIRNAMES = 64 32 --MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu) --MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu) + MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -33,6 +33,6 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) +-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 - ---- ./gcc/config/rs6000/t-linux.orig -+++ ./gcc/config/rs6000/t-linux ++MULTILIB_OSDIRNAMES+= mx32=../libx32 +--- a/gcc/config/rs6000/t-linux ++++ b/gcc/config/rs6000/t-linux @@ -2,7 +2,8 @@ # or soft-float. ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float))) @@ -40,9 +34,9 @@ +MULTILIB_OSDIRNAMES := m64=../lib +MULTILIB_OSDIRNAMES += m32=../lib32 else - ifneq (,$(findstring spe,$(target))) - MULTIARCH_DIRNAME := powerpc-linux-gnuspe$(if $(findstring 8548,$(with_cpu)),,v1) -@@ -14,7 +15,8 @@ + MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu) + endif +@@ -10,7 +11,8 @@ MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) endif ifneq (,$(findstring powerpc64le,$(target))) @@ -52,8 +46,8 @@ endif endif ---- ./gcc/config/rs6000/t-linux64.orig -+++ ./gcc/config/rs6000/t-linux64 +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 @@ -28,8 +28,8 @@ MULTILIB_OPTIONS := m64/m32 MULTILIB_DIRNAMES := 64 32 @@ -65,8 +59,8 @@ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c $(COMPILE) $< ---- ./gcc/config/rs6000/t-linux64bele.orig -+++ ./gcc/config/rs6000/t-linux64bele +--- a/gcc/config/rs6000/t-linux64bele ++++ b/gcc/config/rs6000/t-linux64bele @@ -2,6 +2,6 @@ MULTILIB_OPTIONS += mlittle @@ -76,8 +70,8 @@ +MULTILIB_OSDIRNAMES = m64=../lib +MULTILIB_OSDIRNAMES+= m32=../lib32 MULTILIB_MATCHES := ${MULTILIB_MATCHES_ENDIAN} ---- ./gcc/config/rs6000/t-linux64lebe.orig -+++ ./gcc/config/rs6000/t-linux64lebe +--- a/gcc/config/rs6000/t-linux64lebe ++++ b/gcc/config/rs6000/t-linux64lebe @@ -2,6 +2,6 @@ MULTILIB_OPTIONS += mbig diff --git a/system/gcc/insn-split.patch b/system/gcc/insn-split.patch new file mode 100644 index 000000000..3b7ce8767 --- /dev/null +++ b/system/gcc/insn-split.patch @@ -0,0 +1,1404 @@ +https://gcc.gnu.org/PR54179 +https://inbox.sourceware.org/gcc-patches/de0f7bdc-d236-4f5b-9504-d5bfb215d023@gmail.com/ + +From d63f858f41e2bb0e159d15ed8ee41bf303325ee7 Mon Sep 17 00:00:00 2001 +From: Robin Dapp <rdapp.gcc@gmail.com> +Date: Fri, 27 Oct 2023 21:04:25 +0200 +Subject: [PATCH 13/15] genemit: Split insn-emit.cc into ten files. + +After working with Sam off-list (thanks) I managed to get hppa to +build. Initially it looked as if hppa just had a very small number of +instruction patterns so we wouldn't generate all 10 output files. +However, the actual issue (which we will only hit with a low +pattern count) was with counting all the patterns vs only counting +the patterns that will be output. A wrong pattern count lead to +prematurely stopping to write output files. + +With that corrected, hppa "just works" until I hit linker errors +due to relocations - most likely unrelated: + +bin/ld: unwind-dw2-fde-dip_s.o(.data.rel.ro+0): cannot handle +R_PARISC_FPTR64 for __pthread_key_create@@GLIBC_2.34 + +Attached is v3 that has been bootstrapped and tested on x86 and power10, +aarch64 bootstrap was ok, testsuite is still running. A riscv build and +testsuite run was successful as well. + +Regards + Robin + +>From 248744c328440bff9cc339d2bf622852cbaac343 Mon Sep 17 00:00:00 2001 +From: Robin Dapp <rdapp@ventanamicro.com> +Date: Thu, 12 Oct 2023 11:23:26 +0200 +Subject: [PATCH v3] genemit: Split insn-emit.cc into several partitions. + +On riscv insn-emit.cc has grown to over 1.2 mio lines of code and +compiling it takes considerable time. +Therefore, this patch adjust genemit to create several partitions +(insn-emit-1.cc to insn-emit-n.cc). The available patterns are +written to the given files in a sequential fashion. + +Similar to match.pd a configure option --with-emitinsn-partitions=num +is introduced that makes the number of partition configurable. + +gcc/ChangeLog: + + PR bootstrap/84402 + PR target/111600 + + * Makefile.in: Handle split insn-emit.cc. + * configure: Regenerate. + * configure.ac: Add --with-insnemit-partitions. + * genemit.cc (output_peephole2_scratches): Print to file instead + of stdout. + (print_code): Ditto. + (gen_rtx_scratch): Ditto. + (gen_exp): Ditto. + (gen_emit_seq): Ditto. + (emit_c_code): Ditto. + (gen_insn): Ditto. + (gen_expand): Ditto. + (gen_split): Ditto. + (output_add_clobbers): Ditto. + (output_added_clobbers_hard_reg_p): Ditto. + (print_overload_arguments): Ditto. + (print_overload_test): Ditto. + (handle_overloaded_code_for): Ditto. + (handle_overloaded_gen): Ditto. + (print_header): New function. + (handle_arg): New function. + (main): Split output into 10 files. + * gensupport.cc (count_patterns): New function. + * gensupport.h (count_patterns): Define. + * read-md.cc (md_reader::print_md_ptr_loc): Add file argument. + * read-md.h (class md_reader): Change definition. +--- + gcc/Makefile.in | 36 ++- + gcc/configure | 24 +- + gcc/configure.ac | 13 ++ + gcc/genemit.cc | 542 +++++++++++++++++++++++++--------------------- + gcc/gensupport.cc | 55 +++++ + gcc/gensupport.h | 1 + + gcc/read-md.cc | 4 +- + gcc/read-md.h | 2 +- + 8 files changed, 422 insertions(+), 255 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 2c16b14ad0f3..b0c118e6d189 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -232,6 +232,13 @@ GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-match-%.o, $(MATCH_SPLITS_SEQ)) + GENERIC_MATCH_PD_SEQ_SRC = $(patsubst %, generic-match-%.cc, $(MATCH_SPLITS_SEQ)) + GENERIC_MATCH_PD_SEQ_O = $(patsubst %, generic-match-%.o, $(MATCH_SPLITS_SEQ)) + ++# The number of splits to be made for the insn-emit files. ++NUM_INSNEMIT_SPLITS = @DEFAULT_INSNEMIT_PARTITIONS@ ++INSNEMIT_SPLITS_SEQ = $(wordlist 1,$(NUM_INSNEMIT_SPLITS),$(one_to_9999)) ++INSNEMIT_SEQ_SRC = $(patsubst %, insn-emit-%.cc, $(INSNEMIT_SPLITS_SEQ)) ++INSNEMIT_SEQ_TMP = $(patsubst %, tmp-emit-%.cc, $(INSNEMIT_SPLITS_SEQ)) ++INSNEMIT_SEQ_O = $(patsubst %, insn-emit-%.o, $(INSNEMIT_SPLITS_SEQ)) ++ + # These files are to have specific diagnostics suppressed, or are not to + # be subject to -Werror: + # flex output may yield harmless "no previous prototype" warnings +@@ -1334,7 +1341,7 @@ OBJS = \ + insn-attrtab.o \ + insn-automata.o \ + insn-dfatab.o \ +- insn-emit.o \ ++ $(INSNEMIT_SEQ_O) \ + insn-extract.o \ + insn-latencytab.o \ + insn-modes.o \ +@@ -1820,7 +1827,8 @@ TREECHECKING = @TREECHECKING@ + FULL_DRIVER_NAME=$(target_noncanonical)-gcc-$(version)$(exeext) + + MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ +- insn-output.cc insn-recog.cc insn-emit.cc insn-extract.cc insn-peep.cc \ ++ insn-output.cc insn-recog.cc $(INSNEMIT_SEQ_SRC) \ ++ insn-extract.cc insn-peep.cc \ + insn-attr.h insn-attr-common.h insn-attrtab.cc insn-dfatab.cc \ + insn-latencytab.cc insn-opinit.cc insn-opinit.h insn-preds.cc insn-constants.h \ + tm-preds.h tm-constrs.h checksum-options $(GIMPLE_MATCH_PD_SEQ_SRC) \ +@@ -2437,11 +2445,11 @@ $(common_out_object_file): $(common_out_file) + # and compile them. + + .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \ +- insn-emit.cc insn-recog.cc insn-extract.cc insn-output.cc insn-peep.cc \ +- insn-attr.h insn-attr-common.h insn-attrtab.cc insn-dfatab.cc \ +- insn-latencytab.cc insn-preds.cc $(GIMPLE_MATCH_PD_SEQ_SRC) \ +- $(GENERIC_MATCH_PD_SEQ_SRC) gimple-match-auto.h generic-match-auto.h \ +- insn-target-def.h ++ $(INSNEMIT_SEQ_SRC) insn-recog.cc insn-extract.cc insn-output.cc \ ++ insn-peep.cc insn-attr.h insn-attr-common.h insn-attrtab.cc \ ++ insn-dfatab.cc insn-latencytab.cc insn-preds.cc \ ++ $(GIMPLE_MATCH_PD_SEQ_SRC) $(GENERIC_MATCH_PD_SEQ_SRC) \ ++ gimple-match-auto.h generic-match-auto.h insn-target-def.h + + # Dependencies for the md file. The first time through, we just assume + # the md file itself and the generated dependency file (in order to get +@@ -2464,7 +2472,7 @@ s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext) + simple_rtl_generated_h = insn-attr.h insn-attr-common.h insn-codes.h \ + insn-config.h insn-flags.h insn-target-def.h + +-simple_rtl_generated_c = insn-automata.cc insn-emit.cc \ ++simple_rtl_generated_c = insn-automata.cc \ + insn-extract.cc insn-output.cc \ + insn-peep.cc insn-recog.cc + +@@ -2493,8 +2501,20 @@ $(simple_generated_c:insn-%.cc=s-%): s-%: build/gen%$(build_exeext) + $(SHELL) $(srcdir)/../move-if-change tmp-$*.cc insn-$*.cc + $(STAMP) s-$* + ++# genemit splits its output into different files and doesn't write to ++# stdout. (but rather to tmp-emit-01.cc..tmp-emit-10.cc) ++$(INSNEMIT_SEQ_SRC): s-tmp-emit; @true ++s-tmp-emit: build/genemit$(build_exeext) $(MD_DEPS) insn-conditions.md ++ $(RUN_GEN) build/genemit$(build_exeext) $(md_file) insn-conditions.md \ ++ $(addprefix -O,${INSNEMIT_SEQ_TMP}) ++ $(foreach id, $(INSNEMIT_SPLITS_SEQ), \ ++ $(SHELL) $(srcdir)/../move-if-change tmp-emit-$(id).cc \ ++ insn-emit-$(id).cc;) ++ $(STAMP) s-tmp-emit ++ + # gencheck doesn't read the machine description, and the file produced + # doesn't use the insn-* convention. ++ + tree-check.h: s-check ; @true + s-check : build/gencheck$(build_exeext) + $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h +diff --git a/gcc/configure b/gcc/configure +index cc8247037569..c98088bea90d 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -838,6 +838,7 @@ enable_gcov + enable_shared + enable_fixed_point + enable_decimal_float ++DEFAULT_INSNEMIT_PARTITIONS + DEFAULT_MATCHPD_PARTITIONS + with_float + with_cpu +@@ -967,6 +968,7 @@ enable_multilib + enable_multiarch + with_stack_clash_protection_guard_size + with_matchpd_partitions ++with_insnemit_partitions + enable___cxa_atexit + enable_decimal_float + enable_fixed_point +@@ -1837,6 +1839,9 @@ Optional Packages: + --with-matchpd-partitions=num + Set the number of partitions to make for gimple and + generic when splitting match.pd. [default=10] ++ --with-insnemit-partitions=num ++ Set the number of partitions of insn-emit.cc for ++ genemit to create. [default=10] + --with-dwarf2 force the default debug format to be DWARF 2 (or + later) + --with-specs=SPECS add SPECS to driver command-line processing +@@ -7938,6 +7943,21 @@ fi + + + ++# Specify the number of splits of insn-emit.cc to generate. ++ ++# Check whether --with-insnemit-partitions was given. ++if test "${with_insnemit_partitions+set}" = set; then : ++ withval=$with_insnemit_partitions; DEFAULT_INSNEMIT_PARTITIONS="$with_insnemit_partitions" ++else ++ DEFAULT_INSNEMIT_PARTITIONS=10 ++fi ++ ++if (test $DEFAULT_INSNEMIT_PARTITIONS -lt 1); then ++ as_fn_error $? "Invalid value $DEFAULT_INSNEMIT_PARTITIONS for --with-insnemit-partitions. Cannot be negative." "$LINENO" 5 ++fi ++ ++ ++ + # Enable __cxa_atexit for C++. + # Check whether --enable-__cxa_atexit was given. + if test "${enable___cxa_atexit+set}" = set; then : +@@ -19891,7 +19911,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 19894 "configure" ++#line 19914 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -19997,7 +20017,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 20000 "configure" ++#line 20020 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/gcc/configure.ac b/gcc/configure.ac +index d02ffc22a3a3..7021f95da3ee 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -956,6 +956,19 @@ fi + + AC_SUBST(DEFAULT_MATCHPD_PARTITIONS) + ++# Specify the number of splits of insn-emit.cc to generate. ++AC_ARG_WITH(insnemit-partitions, ++[AS_HELP_STRING([--with-insnemit-partitions=num], ++[Set the number of partitions of insn-emit.cc for genemit to create. [default=10]])], ++[DEFAULT_INSNEMIT_PARTITIONS="$with_insnemit_partitions"], [DEFAULT_INSNEMIT_PARTITIONS=10]) ++if (test $DEFAULT_INSNEMIT_PARTITIONS -lt 1); then ++ AC_MSG_ERROR(m4_normalize([ ++ Invalid value $DEFAULT_INSNEMIT_PARTITIONS for --with-insnemit-partitions. \ ++ Cannot be negative.])) ++fi ++ ++AC_SUBST(DEFAULT_INSNEMIT_PARTITIONS) ++ + # Enable __cxa_atexit for C++. + AC_ARG_ENABLE(__cxa_atexit, + [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])], +diff --git a/gcc/genemit.cc b/gcc/genemit.cc +index 33c9ec05d6fc..18c95e3f6412 100644 +--- a/gcc/genemit.cc ++++ b/gcc/genemit.cc +@@ -49,29 +49,29 @@ struct clobber_ent + struct clobber_ent *next; + }; + +-static void output_peephole2_scratches (rtx); ++static void output_peephole2_scratches (rtx, FILE*); + + /* True for <X>_optab if that optab isn't allowed to fail. */ + static bool nofail_optabs[NUM_OPTABS]; + + static void +-print_code (RTX_CODE code) ++print_code (RTX_CODE code, FILE *file) + { + const char *p1; + for (p1 = GET_RTX_NAME (code); *p1; p1++) +- putchar (TOUPPER (*p1)); ++ fprintf (file, "%c", TOUPPER (*p1)); + } + + static void +-gen_rtx_scratch (rtx x, enum rtx_code subroutine_type) ++gen_rtx_scratch (rtx x, enum rtx_code subroutine_type, FILE *file) + { + if (subroutine_type == DEFINE_PEEPHOLE2) + { +- printf ("operand%d", XINT (x, 0)); ++ fprintf (file, "operand%d", XINT (x, 0)); + } + else + { +- printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x))); ++ fprintf (file, "gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x))); + } + } + +@@ -79,7 +79,8 @@ gen_rtx_scratch (rtx x, enum rtx_code subroutine_type) + substituting any operand references appearing within. */ + + static void +-gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) ++gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info, ++ FILE *file) + { + RTX_CODE code; + int i; +@@ -89,7 +90,7 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + + if (x == 0) + { +- printf ("NULL_RTX"); ++ fprintf (file, "NULL_RTX"); + return; + } + +@@ -103,67 +104,67 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + { + if (used[XINT (x, 0)]) + { +- printf ("copy_rtx (operand%d)", XINT (x, 0)); ++ fprintf (file, "copy_rtx (operand%d)", XINT (x, 0)); + return; + } + used[XINT (x, 0)] = 1; + } +- printf ("operand%d", XINT (x, 0)); ++ fprintf (file, "operand%d", XINT (x, 0)); + return; + + case MATCH_OP_DUP: +- printf ("gen_rtx_fmt_"); ++ fprintf (file, "gen_rtx_fmt_"); + for (i = 0; i < XVECLEN (x, 1); i++) +- printf ("e"); +- printf (" (GET_CODE (operand%d), ", XINT (x, 0)); ++ fprintf (file, "e"); ++ fprintf (file, " (GET_CODE (operand%d), ", XINT (x, 0)); + if (GET_MODE (x) == VOIDmode) +- printf ("GET_MODE (operand%d)", XINT (x, 0)); ++ fprintf (file, "GET_MODE (operand%d)", XINT (x, 0)); + else +- printf ("%smode", GET_MODE_NAME (GET_MODE (x))); ++ fprintf (file, "%smode", GET_MODE_NAME (GET_MODE (x))); + for (i = 0; i < XVECLEN (x, 1); i++) + { +- printf (",\n\t\t"); +- gen_exp (XVECEXP (x, 1, i), subroutine_type, used, info); ++ fprintf (file, ",\n\t\t"); ++ gen_exp (XVECEXP (x, 1, i), subroutine_type, used, info, file); + } +- printf (")"); ++ fprintf (file, ")"); + return; + + case MATCH_OPERATOR: +- printf ("gen_rtx_fmt_"); ++ fprintf (file, "gen_rtx_fmt_"); + for (i = 0; i < XVECLEN (x, 2); i++) +- printf ("e"); +- printf (" (GET_CODE (operand%d)", XINT (x, 0)); +- printf (", %smode", GET_MODE_NAME (GET_MODE (x))); ++ fprintf (file, "e"); ++ fprintf (file, " (GET_CODE (operand%d)", XINT (x, 0)); ++ fprintf (file, ", %smode", GET_MODE_NAME (GET_MODE (x))); + for (i = 0; i < XVECLEN (x, 2); i++) + { +- printf (",\n\t\t"); +- gen_exp (XVECEXP (x, 2, i), subroutine_type, used, info); ++ fprintf (file, ",\n\t\t"); ++ gen_exp (XVECEXP (x, 2, i), subroutine_type, used, info, file); + } +- printf (")"); ++ fprintf (file, ")"); + return; + + case MATCH_PARALLEL: + case MATCH_PAR_DUP: +- printf ("operand%d", XINT (x, 0)); ++ fprintf (file, "operand%d", XINT (x, 0)); + return; + + case MATCH_SCRATCH: +- gen_rtx_scratch (x, subroutine_type); ++ gen_rtx_scratch (x, subroutine_type, file); + return; + + case PC: +- printf ("pc_rtx"); ++ fprintf (file, "pc_rtx"); + return; + case RETURN: +- printf ("ret_rtx"); ++ fprintf (file, "ret_rtx"); + return; + case SIMPLE_RETURN: +- printf ("simple_return_rtx"); ++ fprintf (file, "simple_return_rtx"); + return; + case CLOBBER: + if (REG_P (XEXP (x, 0))) + { +- printf ("gen_hard_reg_clobber (%smode, %i)", ++ fprintf (file, "gen_hard_reg_clobber (%smode, %i)", + GET_MODE_NAME (GET_MODE (XEXP (x, 0))), + REGNO (XEXP (x, 0))); + return; +@@ -172,22 +173,22 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + + case CONST_INT: + if (INTVAL (x) == 0) +- printf ("const0_rtx"); ++ fprintf (file, "const0_rtx"); + else if (INTVAL (x) == 1) +- printf ("const1_rtx"); ++ fprintf (file, "const1_rtx"); + else if (INTVAL (x) == -1) +- printf ("constm1_rtx"); ++ fprintf (file, "constm1_rtx"); + else if (-MAX_SAVED_CONST_INT <= INTVAL (x) + && INTVAL (x) <= MAX_SAVED_CONST_INT) +- printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", ++ fprintf (file, "const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", + (int) INTVAL (x)); + else if (INTVAL (x) == STORE_FLAG_VALUE) +- printf ("const_true_rtx"); ++ fprintf (file, "const_true_rtx"); + else + { +- printf ("GEN_INT ("); +- printf (HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x)); +- printf (")"); ++ fprintf (file, "GEN_INT ("); ++ fprintf (file, HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x)); ++ fprintf (file, ")"); + } + return; + +@@ -195,7 +196,7 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + /* Handle `const_double_zero' rtx. */ + if (CONST_DOUBLE_REAL_VALUE (x)->cl == rvc_zero) + { +- printf ("CONST_DOUBLE_ATOF (\"0\", %smode)", ++ fprintf (file, "CONST_DOUBLE_ATOF (\"0\", %smode)", + GET_MODE_NAME (GET_MODE (x))); + return; + } +@@ -210,12 +211,12 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + break; + } + +- printf ("gen_rtx_"); +- print_code (code); +- printf (" ("); ++ fprintf (file, "gen_rtx_"); ++ print_code (code, file); ++ fprintf (file, " ("); + if (!always_void_p (code)) + { +- printf ("%smode", GET_MODE_NAME (GET_MODE (x))); ++ fprintf (file, "%smode", GET_MODE_NAME (GET_MODE (x))); + sep = ",\n\t"; + } + +@@ -225,41 +226,41 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + { + if (fmt[i] == '0') + break; +- fputs (sep, stdout); ++ fputs (sep, file); + switch (fmt[i]) + { + case 'e': case 'u': +- gen_exp (XEXP (x, i), subroutine_type, used, info); ++ gen_exp (XEXP (x, i), subroutine_type, used, info, file); + break; + + case 'i': +- printf ("%u", XINT (x, i)); ++ fprintf (file, "%u", XINT (x, i)); + break; + + case 'r': +- printf ("%u", REGNO (x)); ++ fprintf (file, "%u", REGNO (x)); + break; + + case 'p': + /* We don't have a way of parsing polynomial offsets yet, + and hopefully never will. */ +- printf ("%d", SUBREG_BYTE (x).to_constant ()); ++ fprintf (file, "%d", SUBREG_BYTE (x).to_constant ()); + break; + + case 's': +- printf ("\"%s\"", XSTR (x, i)); ++ fprintf (file, "\"%s\"", XSTR (x, i)); + break; + + case 'E': + { + int j; +- printf ("gen_rtvec (%d", XVECLEN (x, i)); ++ fprintf (file, "gen_rtvec (%d", XVECLEN (x, i)); + for (j = 0; j < XVECLEN (x, i); j++) + { +- printf (",\n\t\t"); +- gen_exp (XVECEXP (x, i, j), subroutine_type, used, info); ++ fprintf (file, ",\n\t\t"); ++ gen_exp (XVECEXP (x, i, j), subroutine_type, used, info, file); + } +- printf (")"); ++ fprintf (file, ")"); + break; + } + +@@ -268,14 +269,14 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info) + } + sep = ",\n\t"; + } +- printf (")"); ++ fprintf (file, ")"); + } + + /* Output code to emit the instruction patterns in VEC, with each element + becoming a separate instruction. USED is as for gen_exp. */ + + static void +-gen_emit_seq (rtvec vec, char *used, md_rtx_info *info) ++gen_emit_seq (rtvec vec, char *used, md_rtx_info *info, FILE *file) + { + for (int i = 0, len = GET_NUM_ELEM (vec); i < len; ++i) + { +@@ -283,17 +284,17 @@ gen_emit_seq (rtvec vec, char *used, md_rtx_info *info) + rtx next = RTVEC_ELT (vec, i); + if (const char *name = get_emit_function (next)) + { +- printf (" %s (", name); +- gen_exp (next, DEFINE_EXPAND, used, info); +- printf (");\n"); ++ fprintf (file, " %s (", name); ++ gen_exp (next, DEFINE_EXPAND, used, info, file); ++ fprintf (file, ");\n"); + if (!last_p && needs_barrier_p (next)) +- printf (" emit_barrier ();"); ++ fprintf (file, " emit_barrier ();"); + } + else + { +- printf (" emit ("); +- gen_exp (next, DEFINE_EXPAND, used, info); +- printf (", %s);\n", last_p ? "false" : "true"); ++ fprintf (file, " emit ("); ++ gen_exp (next, DEFINE_EXPAND, used, info, file); ++ fprintf (file, ", %s);\n", last_p ? "false" : "true"); + } + } + } +@@ -303,27 +304,27 @@ gen_emit_seq (rtvec vec, char *used, md_rtx_info *info) + for use in error messages. */ + + static void +-emit_c_code (const char *code, bool can_fail_p, const char *name) ++emit_c_code (const char *code, bool can_fail_p, const char *name, FILE *file) + { + if (can_fail_p) +- printf ("#define FAIL return (end_sequence (), _val)\n"); ++ fprintf (file, "#define FAIL return (end_sequence (), _val)\n"); + else +- printf ("#define FAIL _Pragma (\"GCC error \\\"%s cannot FAIL\\\"\")" ++ fprintf (file, "#define FAIL _Pragma (\"GCC error \\\"%s cannot FAIL\\\"\")" + " (void)0\n", name); +- printf ("#define DONE return (_val = get_insns (), " ++ fprintf (file, "#define DONE return (_val = get_insns (), " + "end_sequence (), _val)\n"); + +- rtx_reader_ptr->print_md_ptr_loc (code); +- printf ("%s\n", code); ++ rtx_reader_ptr->print_md_ptr_loc (code, file); ++ fprintf (file, "%s\n", code); + +- printf ("#undef DONE\n"); +- printf ("#undef FAIL\n"); ++ fprintf (file, "#undef DONE\n"); ++ fprintf (file, "#undef FAIL\n"); + } + + /* Generate the `gen_...' function for a DEFINE_INSN. */ + + static void +-gen_insn (md_rtx_info *info) ++gen_insn (md_rtx_info *info, FILE *file) + { + struct pattern_stats stats; + int i; +@@ -409,7 +410,7 @@ gen_insn (md_rtx_info *info) + if (XSTR (insn, 0)[0] == 0 || XSTR (insn, 0)[0] == '*') + return; + +- printf ("/* %s:%d */\n", info->loc.filename, info->loc.lineno); ++ fprintf (file, "/* %s:%d */\n", info->loc.filename, info->loc.lineno); + + /* Find out how many operands this function has. */ + get_pattern_stats (&stats, XVEC (insn, 1)); +@@ -417,17 +418,17 @@ gen_insn (md_rtx_info *info) + fatal_at (info->loc, "match_dup operand number has no match_operand"); + + /* Output the function name and argument declarations. */ +- printf ("rtx\ngen_%s (", XSTR (insn, 0)); ++ fprintf (file, "rtx\ngen_%s (", XSTR (insn, 0)); + if (stats.num_generator_args) + for (i = 0; i < stats.num_generator_args; i++) + if (i) +- printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i); ++ fprintf (file, ",\n\trtx operand%d ATTRIBUTE_UNUSED", i); + else +- printf ("rtx operand%d ATTRIBUTE_UNUSED", i); ++ fprintf (file, "rtx operand%d ATTRIBUTE_UNUSED", i); + else +- printf ("void"); +- printf (")\n"); +- printf ("{\n"); ++ fprintf (file, "void"); ++ fprintf (file, ")\n"); ++ fprintf (file, "{\n"); + + /* Output code to construct and return the rtl for the instruction body. */ + +@@ -436,16 +437,16 @@ gen_insn (md_rtx_info *info) + char *used = (XVECLEN (insn, 1) == 1 + ? NULL + : XCNEWVEC (char, stats.num_generator_args)); +- printf (" return "); +- gen_exp (pattern, DEFINE_INSN, used, info); +- printf (";\n}\n\n"); ++ fprintf (file, " return "); ++ gen_exp (pattern, DEFINE_INSN, used, info, file); ++ fprintf (file, ";\n}\n\n"); + XDELETEVEC (used); + } + + /* Generate the `gen_...' function for a DEFINE_EXPAND. */ + + static void +-gen_expand (md_rtx_info *info) ++gen_expand (md_rtx_info *info, FILE *file) + { + struct pattern_stats stats; + int i; +@@ -466,17 +467,17 @@ gen_expand (md_rtx_info *info) + "numbers above all other operands", XSTR (expand, 0)); + + /* Output the function name and argument declarations. */ +- printf ("rtx\ngen_%s (", XSTR (expand, 0)); ++ fprintf (file, "rtx\ngen_%s (", XSTR (expand, 0)); + if (stats.num_generator_args) + for (i = 0; i < stats.num_generator_args; i++) + if (i) +- printf (",\n\trtx operand%d", i); ++ fprintf (file, ",\n\trtx operand%d", i); + else +- printf ("rtx operand%d", i); ++ fprintf (file, "rtx operand%d", i); + else +- printf ("void"); +- printf (")\n"); +- printf ("{\n"); ++ fprintf (file, "void"); ++ fprintf (file, ")\n"); ++ fprintf (file, "{\n"); + + /* If we don't have any C code to write, only one insn is being written, + and no MATCH_DUPs are present, we can just return the desired insn +@@ -485,18 +486,18 @@ gen_expand (md_rtx_info *info) + && stats.max_opno >= stats.max_dup_opno + && XVECLEN (expand, 1) == 1) + { +- printf (" return "); +- gen_exp (XVECEXP (expand, 1, 0), DEFINE_EXPAND, NULL, info); +- printf (";\n}\n\n"); ++ fprintf (file, " return "); ++ gen_exp (XVECEXP (expand, 1, 0), DEFINE_EXPAND, NULL, info, file); ++ fprintf (file, ";\n}\n\n"); + return; + } + + /* For each operand referred to only with MATCH_DUPs, + make a local variable. */ + for (i = stats.num_generator_args; i <= stats.max_dup_opno; i++) +- printf (" rtx operand%d;\n", i); +- printf (" rtx_insn *_val = 0;\n"); +- printf (" start_sequence ();\n"); ++ fprintf (file, " rtx operand%d;\n", i); ++ fprintf (file, " rtx_insn *_val = 0;\n"); ++ fprintf (file, " start_sequence ();\n"); + + /* The fourth operand of DEFINE_EXPAND is some code to be executed + before the actual construction. +@@ -506,13 +507,13 @@ gen_expand (md_rtx_info *info) + So copy the operand values there before executing it. */ + if (XSTR (expand, 3) && *XSTR (expand, 3)) + { +- printf (" {\n"); ++ fprintf (file, " {\n"); + if (stats.num_operand_vars > 0) +- printf (" rtx operands[%d];\n", stats.num_operand_vars); ++ fprintf (file, " rtx operands[%d];\n", stats.num_operand_vars); + + /* Output code to copy the arguments into `operands'. */ + for (i = 0; i < stats.num_generator_args; i++) +- printf (" operands[%d] = operand%d;\n", i, i); ++ fprintf (file, " operands[%d] = operand%d;\n", i, i); + + /* Output the special code to be executed before the sequence + is generated. */ +@@ -524,7 +525,7 @@ gen_expand (md_rtx_info *info) + if (nofail_optabs[p.op]) + can_fail_p = false; + } +- emit_c_code (XSTR (expand, 3), can_fail_p, XSTR (expand, 0)); ++ emit_c_code (XSTR (expand, 3), can_fail_p, XSTR (expand, 0), file); + + /* Output code to copy the arguments back out of `operands' + (unless we aren't going to use them at all). */ +@@ -532,29 +533,29 @@ gen_expand (md_rtx_info *info) + { + for (i = 0; i <= MAX (stats.max_opno, stats.max_dup_opno); i++) + { +- printf (" operand%d = operands[%d];\n", i, i); +- printf (" (void) operand%d;\n", i); ++ fprintf (file, " operand%d = operands[%d];\n", i, i); ++ fprintf (file, " (void) operand%d;\n", i); + } + } +- printf (" }\n"); ++ fprintf (file, " }\n"); + } + + used = XCNEWVEC (char, stats.num_operand_vars); +- gen_emit_seq (XVEC (expand, 1), used, info); ++ gen_emit_seq (XVEC (expand, 1), used, info, file); + XDELETEVEC (used); + + /* Call `get_insns' to extract the list of all the + insns emitted within this gen_... function. */ + +- printf (" _val = get_insns ();\n"); +- printf (" end_sequence ();\n"); +- printf (" return _val;\n}\n\n"); ++ fprintf (file, " _val = get_insns ();\n"); ++ fprintf (file, " end_sequence ();\n"); ++ fprintf (file, " return _val;\n}\n\n"); + } + + /* Like gen_expand, but generates insns resulting from splitting SPLIT. */ + + static void +-gen_split (md_rtx_info *info) ++gen_split (md_rtx_info *info, FILE *file) + { + struct pattern_stats stats; + int i; +@@ -580,62 +581,62 @@ gen_split (md_rtx_info *info) + /* Output the prototype, function name and argument declarations. */ + if (GET_CODE (split) == DEFINE_PEEPHOLE2) + { +- printf ("extern rtx_insn *gen_%s_%d (rtx_insn *, rtx *);\n", ++ fprintf (file, "extern rtx_insn *gen_%s_%d (rtx_insn *, rtx *);\n", + name, info->index); +- printf ("rtx_insn *\ngen_%s_%d (rtx_insn *curr_insn ATTRIBUTE_UNUSED," ++ fprintf (file, "rtx_insn *\ngen_%s_%d (rtx_insn *curr_insn ATTRIBUTE_UNUSED," + " rtx *operands%s)\n", + name, info->index, unused); + } + else + { +- printf ("extern rtx_insn *gen_split_%d (rtx_insn *, rtx *);\n", ++ fprintf (file, "extern rtx_insn *gen_split_%d (rtx_insn *, rtx *);\n", + info->index); +- printf ("rtx_insn *\ngen_split_%d " ++ fprintf (file, "rtx_insn *\ngen_split_%d " + "(rtx_insn *curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n", + info->index, unused); + } +- printf ("{\n"); ++ fprintf (file, "{\n"); + + /* Declare all local variables. */ + for (i = 0; i < stats.num_operand_vars; i++) +- printf (" rtx operand%d;\n", i); +- printf (" rtx_insn *_val = NULL;\n"); ++ fprintf (file, " rtx operand%d;\n", i); ++ fprintf (file, " rtx_insn *_val = NULL;\n"); + + if (GET_CODE (split) == DEFINE_PEEPHOLE2) +- output_peephole2_scratches (split); ++ output_peephole2_scratches (split, file); + + const char *fn = info->loc.filename; + for (const char *p = fn; *p; p++) + if (*p == '/') + fn = p + 1; + +- printf (" if (dump_file)\n"); +- printf (" fprintf (dump_file, \"Splitting with gen_%s_%d (%s:%d)\\n\");\n", ++ fprintf (file, " if (dump_file)\n"); ++ fprintf (file, " fprintf (dump_file, \"Splitting with gen_%s_%d (%s:%d)\\n\");\n", + name, info->index, fn, info->loc.lineno); + +- printf (" start_sequence ();\n"); ++ fprintf (file, " start_sequence ();\n"); + + /* The fourth operand of DEFINE_SPLIT is some code to be executed + before the actual construction. */ + + if (XSTR (split, 3)) +- emit_c_code (XSTR (split, 3), true, name); ++ emit_c_code (XSTR (split, 3), true, name, file); + + /* Output code to copy the arguments back out of `operands' */ + for (i = 0; i < stats.num_operand_vars; i++) + { +- printf (" operand%d = operands[%d];\n", i, i); +- printf (" (void) operand%d;\n", i); ++ fprintf (file, " operand%d = operands[%d];\n", i, i); ++ fprintf (file, " (void) operand%d;\n", i); + } + +- gen_emit_seq (XVEC (split, 2), used, info); ++ gen_emit_seq (XVEC (split, 2), used, info, file); + + /* Call `get_insns' to make a list of all the + insns emitted within this gen_... function. */ + +- printf (" _val = get_insns ();\n"); +- printf (" end_sequence ();\n"); +- printf (" return _val;\n}\n\n"); ++ fprintf (file, " _val = get_insns ();\n"); ++ fprintf (file, " end_sequence ();\n"); ++ fprintf (file, " return _val;\n}\n\n"); + + free (used); + } +@@ -645,37 +646,37 @@ gen_split (md_rtx_info *info) + the end of the vector. */ + + static void +-output_add_clobbers (md_rtx_info *info) ++output_add_clobbers (md_rtx_info *info, FILE *file) + { + struct clobber_pat *clobber; + struct clobber_ent *ent; + int i; + +- printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n"); +- printf ("{\n"); +- printf (" switch (insn_code_number)\n"); +- printf (" {\n"); ++ fprintf (file, "\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n"); ++ fprintf (file, "{\n"); ++ fprintf (file, " switch (insn_code_number)\n"); ++ fprintf (file, " {\n"); + + for (clobber = clobber_list; clobber; clobber = clobber->next) + { + for (ent = clobber->insns; ent; ent = ent->next) +- printf (" case %d:\n", ent->code_number); ++ fprintf (file, " case %d:\n", ent->code_number); + + for (i = clobber->first_clobber; i < XVECLEN (clobber->pattern, 1); i++) + { +- printf (" XVECEXP (pattern, 0, %d) = ", i); ++ fprintf (file, " XVECEXP (pattern, 0, %d) = ", i); + gen_exp (XVECEXP (clobber->pattern, 1, i), +- GET_CODE (clobber->pattern), NULL, info); +- printf (";\n"); ++ GET_CODE (clobber->pattern), NULL, info, file); ++ fprintf (file, ";\n"); + } + +- printf (" break;\n\n"); ++ fprintf (file, " break;\n\n"); + } + +- printf (" default:\n"); +- printf (" gcc_unreachable ();\n"); +- printf (" }\n"); +- printf ("}\n"); ++ fprintf (file, " default:\n"); ++ fprintf (file, " gcc_unreachable ();\n"); ++ fprintf (file, " }\n"); ++ fprintf (file, "}\n"); + } + + /* Write a function, `added_clobbers_hard_reg_p' that is given an insn_code +@@ -684,16 +685,16 @@ output_add_clobbers (md_rtx_info *info) + SCRATCH. */ + + static void +-output_added_clobbers_hard_reg_p (void) ++output_added_clobbers_hard_reg_p (FILE *file) + { + struct clobber_pat *clobber; + struct clobber_ent *ent; + int clobber_p, used; + +- printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n"); +- printf ("{\n"); +- printf (" switch (insn_code_number)\n"); +- printf (" {\n"); ++ fprintf (file, "\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n"); ++ fprintf (file, "{\n"); ++ fprintf (file, " switch (insn_code_number)\n"); ++ fprintf (file, " {\n"); + + for (clobber_p = 0; clobber_p <= 1; clobber_p++) + { +@@ -702,25 +703,25 @@ output_added_clobbers_hard_reg_p (void) + if (clobber->has_hard_reg == clobber_p) + for (ent = clobber->insns; ent; ent = ent->next) + { +- printf (" case %d:\n", ent->code_number); ++ fprintf (file, " case %d:\n", ent->code_number); + used++; + } + + if (used) +- printf (" return %d;\n\n", clobber_p); ++ fprintf (file, " return %d;\n\n", clobber_p); + } + +- printf (" default:\n"); +- printf (" gcc_unreachable ();\n"); +- printf (" }\n"); +- printf ("}\n"); ++ fprintf (file, " default:\n"); ++ fprintf (file, " gcc_unreachable ();\n"); ++ fprintf (file, " }\n"); ++ fprintf (file, "}\n"); + } + + /* Generate code to invoke find_free_register () as needed for the + scratch registers used by the peephole2 pattern in SPLIT. */ + + static void +-output_peephole2_scratches (rtx split) ++output_peephole2_scratches (rtx split, FILE *file) + { + int i; + int insn_nr = 0; +@@ -745,12 +746,12 @@ output_peephole2_scratches (rtx split) + + if (first) + { +- printf (" HARD_REG_SET _regs_allocated;\n"); +- printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n"); ++ fprintf (file, " HARD_REG_SET _regs_allocated;\n"); ++ fprintf (file, " CLEAR_HARD_REG_SET (_regs_allocated);\n"); + first = false; + } + +- printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\ ++ fprintf (file, " if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\ + return NULL;\n", + XINT (elt, 0), + insn_nr, last_insn_nr, +@@ -766,50 +767,50 @@ output_peephole2_scratches (rtx split) + /* Print "arg<N>" parameter declarations for each argument N of ONAME. */ + + static void +-print_overload_arguments (overloaded_name *oname) ++print_overload_arguments (overloaded_name *oname, FILE *file) + { + for (unsigned int i = 0; i < oname->arg_types.length (); ++i) +- printf ("%s%s arg%d", i == 0 ? "" : ", ", oname->arg_types[i], i); ++ fprintf (file, "%s%s arg%d", i == 0 ? "" : ", ", oname->arg_types[i], i); + } + + /* Print code to test whether INSTANCE should be chosen, given that + argument N of the overload is available as "arg<N>". */ + + static void +-print_overload_test (overloaded_instance *instance) ++print_overload_test (overloaded_instance *instance, FILE *file) + { + for (unsigned int i = 0; i < instance->arg_values.length (); ++i) +- printf ("%sarg%d == %s", i == 0 ? " if (" : "\n && ", ++ fprintf (file, "%sarg%d == %s", i == 0 ? " if (" : "\n && ", + i, instance->arg_values[i]); +- printf (")\n"); ++ fprintf (file, ")\n"); + } + + /* Emit a maybe_code_for_* function for ONAME. */ + + static void +-handle_overloaded_code_for (overloaded_name *oname) ++handle_overloaded_code_for (overloaded_name *oname, FILE *file) + { + /* Print the function prototype. */ +- printf ("\ninsn_code\nmaybe_code_for_%s (", oname->name); +- print_overload_arguments (oname); +- printf (")\n{\n"); ++ fprintf (file, "\ninsn_code\nmaybe_code_for_%s (", oname->name); ++ print_overload_arguments (oname, file); ++ fprintf (file, ")\n{\n"); + + /* Use a sequence of "if" statements for each instance. */ + for (overloaded_instance *instance = oname->first_instance; + instance; instance = instance->next) + { +- print_overload_test (instance); +- printf (" return CODE_FOR_%s;\n", instance->name); ++ print_overload_test (instance, file); ++ fprintf (file, " return CODE_FOR_%s;\n", instance->name); + } + + /* Return null if no match was found. */ +- printf (" return CODE_FOR_nothing;\n}\n"); ++ fprintf (file, " return CODE_FOR_nothing;\n}\n"); + } + + /* Emit a maybe_gen_* function for ONAME. */ + + static void +-handle_overloaded_gen (overloaded_name *oname) ++handle_overloaded_gen (overloaded_name *oname, FILE *file) + { + unsigned HOST_WIDE_INT seen = 0; + /* All patterns must have the same number of operands. */ +@@ -826,25 +827,25 @@ handle_overloaded_gen (overloaded_name *oname) + seen |= mask; + + /* Print the function prototype. */ +- printf ("\nrtx\nmaybe_gen_%s (", oname->name); +- print_overload_arguments (oname); ++ fprintf (file, "\nrtx\nmaybe_gen_%s (", oname->name); ++ print_overload_arguments (oname, file); + for (int i = 0; i < stats.num_generator_args; ++i) +- printf (", rtx x%d", i); +- printf (")\n{\n"); ++ fprintf (file, ", rtx x%d", i); ++ fprintf (file, ")\n{\n"); + + /* Use maybe_code_for_*, instead of duplicating the selection + logic here. */ +- printf (" insn_code code = maybe_code_for_%s (", oname->name); ++ fprintf (file, " insn_code code = maybe_code_for_%s (", oname->name); + for (unsigned int i = 0; i < oname->arg_types.length (); ++i) +- printf ("%sarg%d", i == 0 ? "" : ", ", i); +- printf (");\n" ++ fprintf (file, "%sarg%d", i == 0 ? "" : ", ", i); ++ fprintf (file, ");\n" + " if (code != CODE_FOR_nothing)\n" + " {\n" + " gcc_assert (insn_data[code].n_generator_args == %d);\n" + " return GEN_FCN (code) (", stats.num_generator_args); + for (int i = 0; i < stats.num_generator_args; ++i) +- printf ("%sx%d", i == 0 ? "" : ", ", i); +- printf (");\n" ++ fprintf (file, "%sx%d", i == 0 ? "" : ", ", i); ++ fprintf (file, ");\n" + " }\n" + " else\n" + " return NULL_RTX;\n" +@@ -852,12 +853,68 @@ handle_overloaded_gen (overloaded_name *oname) + } + } + ++void ++print_header (FILE *file) ++{ ++ fprintf (file, "/* Generated automatically by the program `genemit'\n\ ++from the machine description file `md'. */\n\n"); ++ ++ fprintf (file, "#define IN_TARGET_CODE 1\n"); ++ fprintf (file, "#include \"config.h\"\n"); ++ fprintf (file, "#include \"system.h\"\n"); ++ fprintf (file, "#include \"coretypes.h\"\n"); ++ fprintf (file, "#include \"backend.h\"\n"); ++ fprintf (file, "#include \"predict.h\"\n"); ++ fprintf (file, "#include \"tree.h\"\n"); ++ fprintf (file, "#include \"rtl.h\"\n"); ++ fprintf (file, "#include \"alias.h\"\n"); ++ fprintf (file, "#include \"varasm.h\"\n"); ++ fprintf (file, "#include \"stor-layout.h\"\n"); ++ fprintf (file, "#include \"calls.h\"\n"); ++ fprintf (file, "#include \"memmodel.h\"\n"); ++ fprintf (file, "#include \"tm_p.h\"\n"); ++ fprintf (file, "#include \"flags.h\"\n"); ++ fprintf (file, "#include \"insn-config.h\"\n"); ++ fprintf (file, "#include \"expmed.h\"\n"); ++ fprintf (file, "#include \"dojump.h\"\n"); ++ fprintf (file, "#include \"explow.h\"\n"); ++ fprintf (file, "#include \"emit-rtl.h\"\n"); ++ fprintf (file, "#include \"stmt.h\"\n"); ++ fprintf (file, "#include \"expr.h\"\n"); ++ fprintf (file, "#include \"insn-codes.h\"\n"); ++ fprintf (file, "#include \"optabs.h\"\n"); ++ fprintf (file, "#include \"dfp.h\"\n"); ++ fprintf (file, "#include \"output.h\"\n"); ++ fprintf (file, "#include \"recog.h\"\n"); ++ fprintf (file, "#include \"df.h\"\n"); ++ fprintf (file, "#include \"resource.h\"\n"); ++ fprintf (file, "#include \"reload.h\"\n"); ++ fprintf (file, "#include \"diagnostic-core.h\"\n"); ++ fprintf (file, "#include \"regs.h\"\n"); ++ fprintf (file, "#include \"tm-constrs.h\"\n"); ++ fprintf (file, "#include \"ggc.h\"\n"); ++ fprintf (file, "#include \"target.h\"\n\n"); ++} ++ ++auto_vec<const char *, 10> output_files; ++ ++static bool ++handle_arg (const char *arg) ++{ ++ if (arg[1] == 'O') ++ { ++ output_files.safe_push (&arg[2]); ++ return true; ++ } ++ return false; ++} ++ + int + main (int argc, const char **argv) + { + progname = "genemit"; + +- if (!init_rtx_reader_args (argc, argv)) ++ if (!init_rtx_reader_args_cb (argc, argv, handle_arg)) + return (FATAL_EXIT_CODE); + + #define DEF_INTERNAL_OPTAB_FN(NAME, FLAGS, OPTAB, TYPE) \ +@@ -867,86 +924,87 @@ main (int argc, const char **argv) + /* Assign sequential codes to all entries in the machine description + in parallel with the tables in insn-output.cc. */ + +- printf ("/* Generated automatically by the program `genemit'\n\ +-from the machine description file `md'. */\n\n"); ++ int npatterns = count_patterns (); ++ md_rtx_info info; ++ ++ bool to_stdout = false; ++ int npatterns_per_file = npatterns; ++ if (!output_files.is_empty ()) ++ npatterns_per_file = npatterns / output_files.length () + 1; ++ else ++ to_stdout = true; + +- printf ("#define IN_TARGET_CODE 1\n"); +- printf ("#include \"config.h\"\n"); +- printf ("#include \"system.h\"\n"); +- printf ("#include \"coretypes.h\"\n"); +- printf ("#include \"backend.h\"\n"); +- printf ("#include \"predict.h\"\n"); +- printf ("#include \"tree.h\"\n"); +- printf ("#include \"rtl.h\"\n"); +- printf ("#include \"alias.h\"\n"); +- printf ("#include \"varasm.h\"\n"); +- printf ("#include \"stor-layout.h\"\n"); +- printf ("#include \"calls.h\"\n"); +- printf ("#include \"memmodel.h\"\n"); +- printf ("#include \"tm_p.h\"\n"); +- printf ("#include \"flags.h\"\n"); +- printf ("#include \"insn-config.h\"\n"); +- printf ("#include \"expmed.h\"\n"); +- printf ("#include \"dojump.h\"\n"); +- printf ("#include \"explow.h\"\n"); +- printf ("#include \"emit-rtl.h\"\n"); +- printf ("#include \"stmt.h\"\n"); +- printf ("#include \"expr.h\"\n"); +- printf ("#include \"insn-codes.h\"\n"); +- printf ("#include \"optabs.h\"\n"); +- printf ("#include \"dfp.h\"\n"); +- printf ("#include \"output.h\"\n"); +- printf ("#include \"recog.h\"\n"); +- printf ("#include \"df.h\"\n"); +- printf ("#include \"resource.h\"\n"); +- printf ("#include \"reload.h\"\n"); +- printf ("#include \"diagnostic-core.h\"\n"); +- printf ("#include \"regs.h\"\n"); +- printf ("#include \"tm-constrs.h\"\n"); +- printf ("#include \"ggc.h\"\n"); +- printf ("#include \"target.h\"\n\n"); ++ gcc_assert (npatterns_per_file > 1); + +- /* Read the machine description. */ ++ /* Reverse so we can pop the first-added element. */ ++ output_files.reverse (); + +- md_rtx_info info; ++ int count = 0; ++ FILE *file = NULL; ++ ++ /* Read the machine description. */ + while (read_md_rtx (&info)) +- switch (GET_CODE (info.def)) +- { +- case DEFINE_INSN: +- gen_insn (&info); +- break; ++ { ++ if (count == 0 || count == npatterns_per_file) ++ { ++ bool is_last = !to_stdout && output_files.is_empty (); ++ if (file && !is_last) ++ if (fclose (file) != 0) ++ return FATAL_EXIT_CODE; + +- case DEFINE_EXPAND: +- printf ("/* %s:%d */\n", info.loc.filename, info.loc.lineno); +- gen_expand (&info); +- break; ++ if (!output_files.is_empty ()) ++ { ++ const char *const filename = output_files.pop (); ++ file = fopen (filename, "w"); ++ } ++ else if (to_stdout) ++ file = stdout; ++ else ++ break; + +- case DEFINE_SPLIT: +- printf ("/* %s:%d */\n", info.loc.filename, info.loc.lineno); +- gen_split (&info); +- break; ++ print_header (file); ++ count = 0; ++ } + +- case DEFINE_PEEPHOLE2: +- printf ("/* %s:%d */\n", info.loc.filename, info.loc.lineno); +- gen_split (&info); +- break; ++ switch (GET_CODE (info.def)) ++ { ++ case DEFINE_INSN: ++ gen_insn (&info, file); ++ break; + +- default: +- break; +- } ++ case DEFINE_EXPAND: ++ fprintf (file, "/* %s:%d */\n", info.loc.filename, info.loc.lineno); ++ gen_expand (&info, file); ++ break; ++ ++ case DEFINE_SPLIT: ++ fprintf (file, "/* %s:%d */\n", info.loc.filename, info.loc.lineno); ++ gen_split (&info, file); ++ break; ++ ++ case DEFINE_PEEPHOLE2: ++ fprintf (file, "/* %s:%d */\n", info.loc.filename, info.loc.lineno); ++ gen_split (&info, file); ++ break; ++ ++ default: ++ break; ++ } ++ ++ count++; ++ } + + /* Write out the routines to add CLOBBERs to a pattern and say whether they + clobber a hard reg. */ +- output_add_clobbers (&info); +- output_added_clobbers_hard_reg_p (); ++ output_add_clobbers (&info, file); ++ output_added_clobbers_hard_reg_p (file); + + for (overloaded_name *oname = rtx_reader_ptr->get_overloads (); + oname; oname = oname->next) + { +- handle_overloaded_code_for (oname); +- handle_overloaded_gen (oname); ++ handle_overloaded_code_for (oname, file); ++ handle_overloaded_gen (oname, file); + } + +- fflush (stdout); +- return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); ++ return (fclose (file) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + } +diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc +index f9efc6eb7572..f941f76a739f 100644 +--- a/gcc/gensupport.cc ++++ b/gcc/gensupport.cc +@@ -2631,6 +2631,61 @@ init_rtx_reader_args (int argc, const char **argv) + return init_rtx_reader_args_cb (argc, argv, 0); + } + ++/* Count the number of patterns in all queues and return the count. */ ++int ++count_patterns () ++{ ++ int count = 0, truth = 1; ++ rtx def; ++ class queue_elem *cur = define_attr_queue; ++ while (cur) ++ { ++ def = cur->data; ++ ++ truth = maybe_eval_c_test (get_c_test (def)); ++ if (truth || !insn_elision) ++ count++; ++ cur = cur->next; ++ } ++ ++ cur = define_pred_queue; ++ while (cur) ++ { ++ def = cur->data; ++ ++ truth = maybe_eval_c_test (get_c_test (def)); ++ if (truth || !insn_elision) ++ count++; ++ cur = cur->next; ++ } ++ ++ cur = define_insn_queue; ++ truth = 1; ++ while (cur) ++ { ++ def = cur->data; ++ ++ truth = maybe_eval_c_test (get_c_test (def)); ++ if (truth || !insn_elision) ++ count++; ++ cur = cur->next; ++ } ++ ++ cur = other_queue; ++ truth = 1; ++ while (cur) ++ { ++ def = cur->data; ++ ++ truth = maybe_eval_c_test (get_c_test (def)); ++ if (truth || !insn_elision) ++ count++; ++ cur = cur->next; ++ } ++ ++ return count; ++} ++ + /* Try to read a single rtx from the file. Return true on success, + describing it in *INFO. */ + +diff --git a/gcc/gensupport.h b/gcc/gensupport.h +index a1edfbd71908..510ba19405e4 100644 +--- a/gcc/gensupport.h ++++ b/gcc/gensupport.h +@@ -129,6 +129,7 @@ extern rtx add_implicit_parallel (rtvec); + extern rtx_reader *init_rtx_reader_args_cb (int, const char **, + bool (*)(const char *)); + extern rtx_reader *init_rtx_reader_args (int, const char **); ++extern int count_patterns (); + extern bool read_md_rtx (md_rtx_info *); + extern unsigned int get_num_insn_codes (); + +diff --git a/gcc/read-md.cc b/gcc/read-md.cc +index fd38818e3a3e..46ab9065e3e4 100644 +--- a/gcc/read-md.cc ++++ b/gcc/read-md.cc +@@ -132,9 +132,9 @@ md_reader::fprint_md_ptr_loc (FILE *outf, const void *ptr) + + /* Special fprint_md_ptr_loc for writing to STDOUT. */ + void +-md_reader::print_md_ptr_loc (const void *ptr) ++md_reader::print_md_ptr_loc (const void *ptr, FILE *file) + { +- fprint_md_ptr_loc (stdout, ptr); ++ fprint_md_ptr_loc (file, ptr); + } + + /* Return a condition that satisfies both COND1 and COND2. Either string +diff --git a/gcc/read-md.h b/gcc/read-md.h +index b309c9c3deb6..2adcb58478fe 100644 +--- a/gcc/read-md.h ++++ b/gcc/read-md.h +@@ -194,7 +194,7 @@ class md_reader + const struct ptr_loc *get_md_ptr_loc (const void *ptr); + void copy_md_ptr_loc (const void *new_ptr, const void *old_ptr); + void fprint_md_ptr_loc (FILE *outf, const void *ptr); +- void print_md_ptr_loc (const void *ptr); ++ void print_md_ptr_loc (const void *ptr, FILE * = stdout); + + struct enum_type *lookup_enum_type (const char *name); + void traverse_enum_types (htab_trav callback, void *info); +-- +2.44.0 + diff --git a/system/gcc/libgcc-always-build-gcceh.a.patch b/system/gcc/libgcc-always-build-gcceh.a.patch index 74ae89730..fd19fb350 100644 --- a/system/gcc/libgcc-always-build-gcceh.a.patch +++ b/system/gcc/libgcc-always-build-gcceh.a.patch @@ -4,7 +4,7 @@ Highly inspired by: diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in --- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100 +++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200 -@@ -772,8 +772,9 @@ +@@ -960,8 +960,9 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) endif @@ -15,7 +15,7 @@ diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) endif -@@ -950,10 +951,6 @@ +@@ -1163,10 +1164,6 @@ install-shared: $(mkinstalldirs) $(DESTDIR)$(inst_libdir) @@ -26,7 +26,7 @@ diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in $(subst @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_base_name@,libgcc_s,$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) -@@ -968,6 +965,10 @@ +@@ -1183,6 +1180,10 @@ chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a diff --git a/system/gcc/match-split.patch b/system/gcc/match-split.patch new file mode 100644 index 000000000..afb357b1d --- /dev/null +++ b/system/gcc/match-split.patch @@ -0,0 +1,3583 @@ +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21 + +From 49ed8cead428b48bf46afbbb37a4d043d00702d6 Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Fri, 5 May 2023 13:37:49 +0100 +Subject: [PATCH 04/15] genmatch: split shared code to gimple-match-exports.cc + +In preparation for automatically splitting match.pd files I split off the +non-static helper functions that are shared between the match.pd functions off +to another file. + +This file can be compiled in parallel and also allows us to later avoid +duplicate symbols errors. + +gcc/ChangeLog: + + PR bootstrap/84402 + * Makefile.in (OBJS): Add gimple-match-exports.o. + * genmatch.cc (decision_tree::gen): Export gimple_gimplify helpers. + * gimple-match-head.cc (gimple_simplify, gimple_resimplify1, + gimple_resimplify2, gimple_resimplify3, gimple_resimplify4, + gimple_resimplify5, constant_for_folding, convert_conditional_op, + maybe_resimplify_conditional_op, gimple_match_op::resimplify, + maybe_build_generic_op, build_call_internal, maybe_push_res_to_seq, + do_valueize, try_conditional_simplification, gimple_extract, + gimple_extract_op, canonicalize_code, commutative_binary_op_p, + commutative_ternary_op_p, first_commutative_argument, + associative_binary_op_p, directly_supported_p, + get_conditional_internal_fn): Moved to gimple-match-exports.cc + * gimple-match-exports.cc: New file. + +(cherry picked from commit 27fcf994c5515e1bbf2ff03d28fd2fa927c7e7b5) +--- + gcc/Makefile.in | 4 +- + gcc/genmatch.cc | 4 +- + gcc/gimple-match-exports.cc | 1253 +++++++++++++++++++++++++++++++++++ + gcc/gimple-match-head.cc | 1192 +-------------------------------- + 4 files changed, 1260 insertions(+), 1193 deletions(-) + create mode 100644 gcc/gimple-match-exports.cc + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 06d192fa9ed8..406856acde1c 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -223,6 +223,7 @@ libgcov-util.o-warn = -Wno-error + libgcov-driver-tool.o-warn = -Wno-error + libgcov-merge-tool.o-warn = -Wno-error + gimple-match.o-warn = -Wno-unused ++gimple-match-exports.o-warn = -Wno-unused + generic-match.o-warn = -Wno-unused + dfp.o-warn = -Wno-strict-aliasing + +@@ -1312,6 +1313,7 @@ ANALYZER_OBJS = \ + # the last objects to finish building. + OBJS = \ + gimple-match.o \ ++ gimple-match-exports.o \ + generic-match.o \ + insn-attrtab.o \ + insn-automata.o \ +@@ -2663,7 +2665,7 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in + false; \ + fi + +-gimple-match.cc: s-match gimple-match-head.cc ; @true ++gimple-match.cc: s-match gimple-match-head.cc gimple-match-exports.cc ; @true + generic-match.cc: s-match generic-match-head.cc ; @true + + s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd +diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc +index a17ef8a23ed5..665d7e2106ff 100644 +--- a/gcc/genmatch.cc ++++ b/gcc/genmatch.cc +@@ -3957,7 +3957,7 @@ decision_tree::gen (FILE *f, bool gimple) + if (! has_kids_p) + { + if (gimple) +- fprintf (f, "\nstatic bool\n" ++ fprintf (f, "\nbool\n" + "gimple_simplify (gimple_match_op*, gimple_seq*,\n" + " tree (*)(tree), code_helper,\n" + " const tree"); +@@ -3980,7 +3980,7 @@ decision_tree::gen (FILE *f, bool gimple) + /* Then generate the main entry with the outermost switch and + tail-calls to the split-out functions. */ + if (gimple) +- fprintf (f, "\nstatic bool\n" ++ fprintf (f, "\nbool\n" + "gimple_simplify (gimple_match_op *res_op, gimple_seq *seq,\n" + " tree (*valueize)(tree) ATTRIBUTE_UNUSED,\n" + " code_helper code, const tree type"); +diff --git a/gcc/gimple-match-exports.cc b/gcc/gimple-match-exports.cc +new file mode 100644 +index 000000000000..7aeb4ddb1524 +--- /dev/null ++++ b/gcc/gimple-match-exports.cc +@@ -0,0 +1,1253 @@ ++/* Helpers for the autogenerated gimple-match.cc file. ++ Copyright (C) 2023 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 3, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++<http://www.gnu.org/licenses/>. */ ++ ++#include "config.h" ++#include "system.h" ++#include "coretypes.h" ++#include "backend.h" ++#include "target.h" ++#include "rtl.h" ++#include "tree.h" ++#include "gimple.h" ++#include "ssa.h" ++#include "cgraph.h" ++#include "vec-perm-indices.h" ++#include "fold-const.h" ++#include "fold-const-call.h" ++#include "stor-layout.h" ++#include "gimple-iterator.h" ++#include "gimple-fold.h" ++#include "calls.h" ++#include "tree-dfa.h" ++#include "builtins.h" ++#include "gimple-match.h" ++#include "tree-pass.h" ++#include "internal-fn.h" ++#include "case-cfn-macros.h" ++#include "gimplify.h" ++#include "optabs-tree.h" ++#include "tree-eh.h" ++#include "dbgcnt.h" ++#include "tm.h" ++#include "gimple-range.h" ++#include "langhooks.h" ++ ++tree (*mprts_hook) (gimple_match_op *); ++ ++extern bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), ++ code_helper, tree, tree); ++extern bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), ++ code_helper, tree, tree, tree); ++extern bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), ++ code_helper, tree, tree, tree, tree); ++extern bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), ++ code_helper, tree, tree, tree, tree, tree); ++extern bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), ++ code_helper, tree, tree, tree, tree, tree, tree); ++ ++/* Functions that are needed by gimple-match but that are exported and used in ++ other places in the compiler. */ ++ ++tree gimple_simplify (enum tree_code, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++tree gimple_simplify (enum tree_code, tree, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++tree gimple_simplify (enum tree_code, tree, tree, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++tree gimple_simplify (combined_fn, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++tree gimple_simplify (combined_fn, tree, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++tree gimple_simplify (combined_fn, tree, tree, tree, tree, gimple_seq *, ++ tree (*)(tree)); ++ ++tree do_valueize (tree, tree (*)(tree), bool &); ++tree do_valueize (tree (*)(tree), tree); ++ ++/* Forward declarations of the private auto-generated matchers. ++ They expect valueized operands in canonical order and do not ++ perform simplification of all-constant operands. */ ++ ++static bool gimple_resimplify1 (gimple_seq *, gimple_match_op *, tree (*)(tree)); ++static bool gimple_resimplify2 (gimple_seq *, gimple_match_op *, tree (*)(tree)); ++static bool gimple_resimplify3 (gimple_seq *, gimple_match_op *, tree (*)(tree)); ++static bool gimple_resimplify4 (gimple_seq *, gimple_match_op *, tree (*)(tree)); ++static bool gimple_resimplify5 (gimple_seq *, gimple_match_op *, tree (*)(tree)); ++ ++/* Match and simplify the toplevel valueized operation THIS. ++ Replaces THIS with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++bool ++gimple_match_op::resimplify (gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ switch (num_ops) ++ { ++ case 1: ++ return gimple_resimplify1 (seq, this, valueize); ++ case 2: ++ return gimple_resimplify2 (seq, this, valueize); ++ case 3: ++ return gimple_resimplify3 (seq, this, valueize); ++ case 4: ++ return gimple_resimplify4 (seq, this, valueize); ++ case 5: ++ return gimple_resimplify5 (seq, this, valueize); ++ default: ++ gcc_unreachable (); ++ } ++} ++ ++/* Return whether T is a constant that we'll dispatch to fold to ++ evaluate fully constant expressions. */ ++ ++static inline bool ++constant_for_folding (tree t) ++{ ++ return (CONSTANT_CLASS_P (t) ++ /* The following is only interesting to string builtins. */ ++ || (TREE_CODE (t) == ADDR_EXPR ++ && TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST)); ++} ++ ++/* Try to convert conditional operation ORIG_OP into an IFN_COND_* ++ operation. Return true on success, storing the new operation in NEW_OP. */ ++ ++static bool ++convert_conditional_op (gimple_match_op *orig_op, ++ gimple_match_op *new_op) ++{ ++ internal_fn ifn; ++ if (orig_op->code.is_tree_code ()) ++ ifn = get_conditional_internal_fn ((tree_code) orig_op->code); ++ else ++ { ++ auto cfn = combined_fn (orig_op->code); ++ if (!internal_fn_p (cfn)) ++ return false; ++ ifn = get_conditional_internal_fn (as_internal_fn (cfn)); ++ } ++ if (ifn == IFN_LAST) ++ return false; ++ unsigned int num_ops = orig_op->num_ops; ++ new_op->set_op (as_combined_fn (ifn), orig_op->type, num_ops + 2); ++ new_op->ops[0] = orig_op->cond.cond; ++ for (unsigned int i = 0; i < num_ops; ++i) ++ new_op->ops[i + 1] = orig_op->ops[i]; ++ tree else_value = orig_op->cond.else_value; ++ if (!else_value) ++ else_value = targetm.preferred_else_value (ifn, orig_op->type, ++ num_ops, orig_op->ops); ++ new_op->ops[num_ops + 1] = else_value; ++ return true; ++} ++/* Helper for gimple_simplify valueizing OP using VALUEIZE and setting ++ VALUEIZED to true if valueization changed OP. */ ++ ++inline tree ++do_valueize (tree op, tree (*valueize)(tree), bool &valueized) ++{ ++ if (valueize && TREE_CODE (op) == SSA_NAME) ++ { ++ tree tem = valueize (op); ++ if (tem && tem != op) ++ { ++ op = tem; ++ valueized = true; ++ } ++ } ++ return op; ++} ++ ++/* If in GIMPLE the operation described by RES_OP should be single-rhs, ++ build a GENERIC tree for that expression and update RES_OP accordingly. */ ++ ++void ++maybe_build_generic_op (gimple_match_op *res_op) ++{ ++ tree_code code = (tree_code) res_op->code; ++ tree val; ++ switch (code) ++ { ++ case REALPART_EXPR: ++ case IMAGPART_EXPR: ++ case VIEW_CONVERT_EXPR: ++ val = build1 (code, res_op->type, res_op->ops[0]); ++ res_op->set_value (val); ++ break; ++ case BIT_FIELD_REF: ++ val = build3 (code, res_op->type, res_op->ops[0], res_op->ops[1], ++ res_op->ops[2]); ++ REF_REVERSE_STORAGE_ORDER (val) = res_op->reverse; ++ res_op->set_value (val); ++ break; ++ default:; ++ } ++} ++ ++/* Try to build RES_OP, which is known to be a call to FN. Return null ++ if the target doesn't support the function. */ ++ ++static gcall * ++build_call_internal (internal_fn fn, gimple_match_op *res_op) ++{ ++ if (direct_internal_fn_p (fn)) ++ { ++ tree_pair types = direct_internal_fn_types (fn, res_op->type, ++ res_op->ops); ++ if (!direct_internal_fn_supported_p (fn, types, OPTIMIZE_FOR_BOTH)) ++ return NULL; ++ } ++ return gimple_build_call_internal (fn, res_op->num_ops, ++ res_op->op_or_null (0), ++ res_op->op_or_null (1), ++ res_op->op_or_null (2), ++ res_op->op_or_null (3), ++ res_op->op_or_null (4)); ++} ++ ++/* RES_OP is the result of a simplification. If it is conditional, ++ try to replace it with the equivalent UNCOND form, such as an ++ IFN_COND_* call or a VEC_COND_EXPR. Also try to resimplify the ++ result of the replacement if appropriate, adding any new statements to ++ SEQ and using VALUEIZE as the valueization function. Return true if ++ this resimplification occurred and resulted in at least one change. */ ++ ++static bool ++maybe_resimplify_conditional_op (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize) (tree)) ++{ ++ if (!res_op->cond.cond) ++ return false; ++ ++ if (!res_op->cond.else_value ++ && res_op->code.is_tree_code ()) ++ { ++ /* The "else" value doesn't matter. If the "then" value is a ++ gimple value, just use it unconditionally. This isn't a ++ simplification in itself, since there was no operation to ++ build in the first place. */ ++ if (gimple_simplified_result_is_gimple_val (res_op)) ++ { ++ res_op->cond.cond = NULL_TREE; ++ return false; ++ } ++ ++ /* Likewise if the operation would not trap. */ ++ bool honor_trapv = (INTEGRAL_TYPE_P (res_op->type) ++ && TYPE_OVERFLOW_TRAPS (res_op->type)); ++ tree_code op_code = (tree_code) res_op->code; ++ bool op_could_trap; ++ ++ /* COND_EXPR will trap if, and only if, the condition ++ traps and hence we have to check this. For all other operations, we ++ don't need to consider the operands. */ ++ if (op_code == COND_EXPR) ++ op_could_trap = generic_expr_could_trap_p (res_op->ops[0]); ++ else ++ op_could_trap = operation_could_trap_p ((tree_code) res_op->code, ++ FLOAT_TYPE_P (res_op->type), ++ honor_trapv, ++ res_op->op_or_null (1)); ++ ++ if (!op_could_trap) ++ { ++ res_op->cond.cond = NULL_TREE; ++ return false; ++ } ++ } ++ ++ /* If the "then" value is a gimple value and the "else" value matters, ++ create a VEC_COND_EXPR between them, then see if it can be further ++ simplified. */ ++ gimple_match_op new_op; ++ if (res_op->cond.else_value ++ && VECTOR_TYPE_P (res_op->type) ++ && gimple_simplified_result_is_gimple_val (res_op)) ++ { ++ new_op.set_op (VEC_COND_EXPR, res_op->type, ++ res_op->cond.cond, res_op->ops[0], ++ res_op->cond.else_value); ++ *res_op = new_op; ++ return gimple_resimplify3 (seq, res_op, valueize); ++ } ++ ++ /* Otherwise try rewriting the operation as an IFN_COND_* call. ++ Again, this isn't a simplification in itself, since it's what ++ RES_OP already described. */ ++ if (convert_conditional_op (res_op, &new_op)) ++ *res_op = new_op; ++ ++ return false; ++} ++ ++/* If RES_OP is a call to a conditional internal function, try simplifying ++ the associated unconditional operation and using the result to build ++ a new conditional operation. For example, if RES_OP is: ++ ++ IFN_COND_ADD (COND, A, B, ELSE) ++ ++ try simplifying (plus A B) and using the result to build a replacement ++ for the whole IFN_COND_ADD. ++ ++ Return true if this approach led to a simplification, otherwise leave ++ RES_OP unchanged (and so suitable for other simplifications). When ++ returning true, add any new statements to SEQ and use VALUEIZE as the ++ valueization function. ++ ++ RES_OP is known to be a call to IFN. */ ++ ++static bool ++try_conditional_simplification (internal_fn ifn, gimple_match_op *res_op, ++ gimple_seq *seq, tree (*valueize) (tree)) ++{ ++ code_helper op; ++ tree_code code = conditional_internal_fn_code (ifn); ++ if (code != ERROR_MARK) ++ op = code; ++ else ++ { ++ ifn = get_unconditional_internal_fn (ifn); ++ if (ifn == IFN_LAST) ++ return false; ++ op = as_combined_fn (ifn); ++ } ++ ++ unsigned int num_ops = res_op->num_ops; ++ gimple_match_op cond_op (gimple_match_cond (res_op->ops[0], ++ res_op->ops[num_ops - 1]), ++ op, res_op->type, num_ops - 2); ++ ++ memcpy (cond_op.ops, res_op->ops + 1, (num_ops - 1) * sizeof *cond_op.ops); ++ switch (num_ops - 2) ++ { ++ case 1: ++ if (!gimple_resimplify1 (seq, &cond_op, valueize)) ++ return false; ++ break; ++ case 2: ++ if (!gimple_resimplify2 (seq, &cond_op, valueize)) ++ return false; ++ break; ++ case 3: ++ if (!gimple_resimplify3 (seq, &cond_op, valueize)) ++ return false; ++ break; ++ default: ++ gcc_unreachable (); ++ } ++ *res_op = cond_op; ++ maybe_resimplify_conditional_op (seq, res_op, valueize); ++ return true; ++} ++ ++/* Helper for the autogenerated code, valueize OP. */ ++ ++tree ++do_valueize (tree (*valueize)(tree), tree op) ++{ ++ if (valueize && TREE_CODE (op) == SSA_NAME) ++ { ++ tree tem = valueize (op); ++ if (tem) ++ return tem; ++ } ++ return op; ++} ++ ++/* Push the exploded expression described by RES_OP as a statement to ++ SEQ if necessary and return a gimple value denoting the value of the ++ expression. If RES is not NULL then the result will be always RES ++ and even gimple values are pushed to SEQ. */ ++ ++tree ++maybe_push_res_to_seq (gimple_match_op *res_op, gimple_seq *seq, tree res) ++{ ++ tree *ops = res_op->ops; ++ unsigned num_ops = res_op->num_ops; ++ ++ /* The caller should have converted conditional operations into an UNCOND ++ form and resimplified as appropriate. The conditional form only ++ survives this far if that conversion failed. */ ++ if (res_op->cond.cond) ++ return NULL_TREE; ++ ++ if (res_op->code.is_tree_code ()) ++ { ++ if (!res ++ && gimple_simplified_result_is_gimple_val (res_op)) ++ return ops[0]; ++ if (mprts_hook) ++ { ++ tree tem = mprts_hook (res_op); ++ if (tem) ++ return tem; ++ } ++ } ++ ++ if (!seq) ++ return NULL_TREE; ++ ++ /* Play safe and do not allow abnormals to be mentioned in ++ newly created statements. */ ++ for (unsigned int i = 0; i < num_ops; ++i) ++ if (TREE_CODE (ops[i]) == SSA_NAME ++ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ops[i])) ++ return NULL_TREE; ++ ++ if (num_ops > 0 && COMPARISON_CLASS_P (ops[0])) ++ for (unsigned int i = 0; i < 2; ++i) ++ if (TREE_CODE (TREE_OPERAND (ops[0], i)) == SSA_NAME ++ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (ops[0], i))) ++ return NULL_TREE; ++ ++ if (res_op->code.is_tree_code ()) ++ { ++ auto code = tree_code (res_op->code); ++ if (!res) ++ { ++ if (gimple_in_ssa_p (cfun)) ++ res = make_ssa_name (res_op->type); ++ else ++ res = create_tmp_reg (res_op->type); ++ } ++ maybe_build_generic_op (res_op); ++ gimple *new_stmt = gimple_build_assign (res, code, ++ res_op->op_or_null (0), ++ res_op->op_or_null (1), ++ res_op->op_or_null (2)); ++ gimple_seq_add_stmt_without_update (seq, new_stmt); ++ return res; ++ } ++ else ++ { ++ gcc_assert (num_ops != 0); ++ auto fn = combined_fn (res_op->code); ++ gcall *new_stmt = NULL; ++ if (internal_fn_p (fn)) ++ { ++ /* Generate the given function if we can. */ ++ internal_fn ifn = as_internal_fn (fn); ++ new_stmt = build_call_internal (ifn, res_op); ++ if (!new_stmt) ++ return NULL_TREE; ++ } ++ else ++ { ++ /* Find the function we want to call. */ ++ tree decl = builtin_decl_implicit (as_builtin_fn (fn)); ++ if (!decl) ++ return NULL; ++ ++ /* We can't and should not emit calls to non-const functions. */ ++ if (!(flags_from_decl_or_type (decl) & ECF_CONST)) ++ return NULL; ++ ++ new_stmt = gimple_build_call (decl, num_ops, ++ res_op->op_or_null (0), ++ res_op->op_or_null (1), ++ res_op->op_or_null (2), ++ res_op->op_or_null (3), ++ res_op->op_or_null (4)); ++ } ++ if (!res) ++ { ++ if (gimple_in_ssa_p (cfun)) ++ res = make_ssa_name (res_op->type); ++ else ++ res = create_tmp_reg (res_op->type); ++ } ++ gimple_call_set_lhs (new_stmt, res); ++ gimple_seq_add_stmt_without_update (seq, new_stmt); ++ return res; ++ } ++} ++ ++ ++/* Public API overloads follow for operation being tree_code or ++ built_in_function and for one to three operands or arguments. ++ They return NULL_TREE if nothing could be simplified or ++ the resulting simplified value with parts pushed to SEQ. ++ If SEQ is NULL then if the simplification needs to create ++ new stmts it will fail. If VALUEIZE is non-NULL then all ++ SSA names will be valueized using that hook prior to ++ applying simplifications. */ ++ ++/* Unary ops. */ ++ ++tree ++gimple_simplify (enum tree_code code, tree type, ++ tree op0, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (op0)) ++ { ++ tree res = const_unop (code, type, op0); ++ if (res != NULL_TREE ++ && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, code, type, op0)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Binary ops. */ ++ ++tree ++gimple_simplify (enum tree_code code, tree type, ++ tree op0, tree op1, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (op0) && constant_for_folding (op1)) ++ { ++ tree res = const_binop (code, type, op0, op1); ++ if (res != NULL_TREE ++ && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ /* Canonicalize operand order both for matching and fallback stmt ++ generation. */ ++ if ((commutative_tree_code (code) ++ || TREE_CODE_CLASS (code) == tcc_comparison) ++ && tree_swap_operands_p (op0, op1)) ++ { ++ std::swap (op0, op1); ++ if (TREE_CODE_CLASS (code) == tcc_comparison) ++ code = swap_tree_comparison (code); ++ } ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, code, type, op0, op1)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Ternary ops. */ ++ ++tree ++gimple_simplify (enum tree_code code, tree type, ++ tree op0, tree op1, tree op2, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (op0) && constant_for_folding (op1) ++ && constant_for_folding (op2)) ++ { ++ tree res = fold_ternary/*_to_constant */ (code, type, op0, op1, op2); ++ if (res != NULL_TREE ++ && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ /* Canonicalize operand order both for matching and fallback stmt ++ generation. */ ++ if (commutative_ternary_tree_code (code) ++ && tree_swap_operands_p (op0, op1)) ++ std::swap (op0, op1); ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, code, type, op0, op1, op2)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Builtin or internal function with one argument. */ ++ ++tree ++gimple_simplify (combined_fn fn, tree type, ++ tree arg0, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (arg0)) ++ { ++ tree res = fold_const_call (fn, type, arg0); ++ if (res && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Builtin or internal function with two arguments. */ ++ ++tree ++gimple_simplify (combined_fn fn, tree type, ++ tree arg0, tree arg1, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (arg0) ++ && constant_for_folding (arg1)) ++ { ++ tree res = fold_const_call (fn, type, arg0, arg1); ++ if (res && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0, arg1)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Builtin or internal function with three arguments. */ ++ ++tree ++gimple_simplify (combined_fn fn, tree type, ++ tree arg0, tree arg1, tree arg2, ++ gimple_seq *seq, tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (arg0) ++ && constant_for_folding (arg1) ++ && constant_for_folding (arg2)) ++ { ++ tree res = fold_const_call (fn, type, arg0, arg1, arg2); ++ if (res && CONSTANT_CLASS_P (res)) ++ return res; ++ } ++ ++ gimple_match_op res_op; ++ if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0, arg1, arg2)) ++ return NULL_TREE; ++ return maybe_push_res_to_seq (&res_op, seq); ++} ++ ++/* Common subroutine of gimple_extract_op and gimple_simplify. Try to ++ describe STMT in RES_OP, returning true on success. Before recording ++ an operand, call: ++ ++ - VALUEIZE_CONDITION for a COND_EXPR condition ++ - VALUEIZE_OP for every other top-level operand ++ ++ Both routines take a tree argument and returns a tree. */ ++ ++template<typename ValueizeOp, typename ValueizeCondition> ++inline bool ++gimple_extract (gimple *stmt, gimple_match_op *res_op, ++ ValueizeOp valueize_op, ++ ValueizeCondition valueize_condition) ++{ ++ switch (gimple_code (stmt)) ++ { ++ case GIMPLE_ASSIGN: ++ { ++ enum tree_code code = gimple_assign_rhs_code (stmt); ++ tree type = TREE_TYPE (gimple_assign_lhs (stmt)); ++ switch (gimple_assign_rhs_class (stmt)) ++ { ++ case GIMPLE_SINGLE_RHS: ++ if (code == REALPART_EXPR ++ || code == IMAGPART_EXPR ++ || code == VIEW_CONVERT_EXPR) ++ { ++ tree op0 = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0); ++ res_op->set_op (code, type, valueize_op (op0)); ++ return true; ++ } ++ else if (code == BIT_FIELD_REF) ++ { ++ tree rhs1 = gimple_assign_rhs1 (stmt); ++ tree op0 = valueize_op (TREE_OPERAND (rhs1, 0)); ++ res_op->set_op (code, type, op0, ++ TREE_OPERAND (rhs1, 1), ++ TREE_OPERAND (rhs1, 2), ++ REF_REVERSE_STORAGE_ORDER (rhs1)); ++ return true; ++ } ++ else if (code == SSA_NAME) ++ { ++ tree op0 = gimple_assign_rhs1 (stmt); ++ res_op->set_op (TREE_CODE (op0), type, valueize_op (op0)); ++ return true; ++ } ++ break; ++ case GIMPLE_UNARY_RHS: ++ { ++ tree rhs1 = gimple_assign_rhs1 (stmt); ++ res_op->set_op (code, type, valueize_op (rhs1)); ++ return true; ++ } ++ case GIMPLE_BINARY_RHS: ++ { ++ tree rhs1 = valueize_op (gimple_assign_rhs1 (stmt)); ++ tree rhs2 = valueize_op (gimple_assign_rhs2 (stmt)); ++ res_op->set_op (code, type, rhs1, rhs2); ++ return true; ++ } ++ case GIMPLE_TERNARY_RHS: ++ { ++ tree rhs1 = gimple_assign_rhs1 (stmt); ++ if (code == COND_EXPR && COMPARISON_CLASS_P (rhs1)) ++ rhs1 = valueize_condition (rhs1); ++ else ++ rhs1 = valueize_op (rhs1); ++ tree rhs2 = valueize_op (gimple_assign_rhs2 (stmt)); ++ tree rhs3 = valueize_op (gimple_assign_rhs3 (stmt)); ++ res_op->set_op (code, type, rhs1, rhs2, rhs3); ++ return true; ++ } ++ default: ++ gcc_unreachable (); ++ } ++ break; ++ } ++ ++ case GIMPLE_CALL: ++ /* ??? This way we can't simplify calls with side-effects. */ ++ if (gimple_call_lhs (stmt) != NULL_TREE ++ && gimple_call_num_args (stmt) >= 1 ++ && gimple_call_num_args (stmt) <= 5) ++ { ++ combined_fn cfn; ++ if (gimple_call_internal_p (stmt)) ++ cfn = as_combined_fn (gimple_call_internal_fn (stmt)); ++ else ++ { ++ tree fn = gimple_call_fn (stmt); ++ if (!fn) ++ return false; ++ ++ fn = valueize_op (fn); ++ if (TREE_CODE (fn) != ADDR_EXPR ++ || TREE_CODE (TREE_OPERAND (fn, 0)) != FUNCTION_DECL) ++ return false; ++ ++ tree decl = TREE_OPERAND (fn, 0); ++ if (DECL_BUILT_IN_CLASS (decl) != BUILT_IN_NORMAL ++ || !gimple_builtin_call_types_compatible_p (stmt, decl)) ++ return false; ++ ++ cfn = as_combined_fn (DECL_FUNCTION_CODE (decl)); ++ } ++ ++ unsigned int num_args = gimple_call_num_args (stmt); ++ res_op->set_op (cfn, TREE_TYPE (gimple_call_lhs (stmt)), num_args); ++ for (unsigned i = 0; i < num_args; ++i) ++ res_op->ops[i] = valueize_op (gimple_call_arg (stmt, i)); ++ return true; ++ } ++ break; ++ ++ case GIMPLE_COND: ++ { ++ tree lhs = valueize_op (gimple_cond_lhs (stmt)); ++ tree rhs = valueize_op (gimple_cond_rhs (stmt)); ++ res_op->set_op (gimple_cond_code (stmt), boolean_type_node, lhs, rhs); ++ return true; ++ } ++ ++ default: ++ break; ++ } ++ ++ return false; ++} ++ ++/* Try to describe STMT in RES_OP, returning true on success. ++ For GIMPLE_CONDs, describe the condition that is being tested. ++ For GIMPLE_ASSIGNs, describe the rhs of the assignment. ++ For GIMPLE_CALLs, describe the call. */ ++ ++bool ++gimple_extract_op (gimple *stmt, gimple_match_op *res_op) ++{ ++ auto nop = [](tree op) { return op; }; ++ return gimple_extract (stmt, res_op, nop, nop); ++} ++ ++/* The main STMT based simplification entry. It is used by the fold_stmt ++ and the fold_stmt_to_constant APIs. */ ++ ++bool ++gimple_simplify (gimple *stmt, gimple_match_op *res_op, gimple_seq *seq, ++ tree (*valueize)(tree), tree (*top_valueize)(tree)) ++{ ++ bool valueized = false; ++ auto valueize_op = [&](tree op) ++ { ++ return do_valueize (op, top_valueize, valueized); ++ }; ++ auto valueize_condition = [&](tree op) -> tree ++ { ++ bool cond_valueized = false; ++ tree lhs = do_valueize (TREE_OPERAND (op, 0), top_valueize, ++ cond_valueized); ++ tree rhs = do_valueize (TREE_OPERAND (op, 1), top_valueize, ++ cond_valueized); ++ gimple_match_op res_op2 (res_op->cond, TREE_CODE (op), ++ TREE_TYPE (op), lhs, rhs); ++ if ((gimple_resimplify2 (seq, &res_op2, valueize) ++ || cond_valueized) ++ && res_op2.code.is_tree_code ()) ++ { ++ auto code = tree_code (res_op2.code); ++ if (TREE_CODE_CLASS (code) == tcc_comparison) ++ { ++ valueized = true; ++ return build2 (code, TREE_TYPE (op), ++ res_op2.ops[0], res_op2.ops[1]); ++ } ++ else if (code == SSA_NAME ++ || code == INTEGER_CST ++ || code == VECTOR_CST) ++ { ++ valueized = true; ++ return res_op2.ops[0]; ++ } ++ } ++ return valueize_op (op); ++ }; ++ ++ if (!gimple_extract (stmt, res_op, valueize_op, valueize_condition)) ++ return false; ++ ++ if (res_op->code.is_internal_fn ()) ++ { ++ internal_fn ifn = internal_fn (res_op->code); ++ if (try_conditional_simplification (ifn, res_op, seq, valueize)) ++ return true; ++ } ++ ++ if (!res_op->reverse ++ && res_op->num_ops ++ && res_op->resimplify (seq, valueize)) ++ return true; ++ ++ return valueized; ++} ++ ++/* Helper that matches and simplifies the toplevel result from ++ a gimple_simplify run (where we don't want to build ++ a stmt in case it's used in in-place folding). Replaces ++ RES_OP with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++static bool ++gimple_resimplify1 (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (res_op->ops[0])) ++ { ++ tree tem = NULL_TREE; ++ if (res_op->code.is_tree_code ()) ++ { ++ auto code = tree_code (res_op->code); ++ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) ++ && TREE_CODE_LENGTH (code) == 1) ++ tem = const_unop (code, res_op->type, res_op->ops[0]); ++ } ++ else ++ tem = fold_const_call (combined_fn (res_op->code), res_op->type, ++ res_op->ops[0]); ++ if (tem != NULL_TREE ++ && CONSTANT_CLASS_P (tem)) ++ { ++ if (TREE_OVERFLOW_P (tem)) ++ tem = drop_tree_overflow (tem); ++ res_op->set_value (tem); ++ maybe_resimplify_conditional_op (seq, res_op, valueize); ++ return true; ++ } ++ } ++ ++ /* Limit recursion, there are cases like PR80887 and others, for ++ example when value-numbering presents us with unfolded expressions ++ that we are really not prepared to handle without eventual ++ oscillation like ((_50 + 0) + 8) where _50 gets mapped to _50 ++ itself as available expression. */ ++ static unsigned depth; ++ if (depth > 10) ++ { ++ if (dump_file && (dump_flags & TDF_FOLDING)) ++ fprintf (dump_file, "Aborting expression simplification due to " ++ "deep recursion\n"); ++ return false; ++ } ++ ++ ++depth; ++ gimple_match_op res_op2 (*res_op); ++ if (gimple_simplify (&res_op2, seq, valueize, ++ res_op->code, res_op->type, res_op->ops[0])) ++ { ++ --depth; ++ *res_op = res_op2; ++ return true; ++ } ++ --depth; ++ ++ if (maybe_resimplify_conditional_op (seq, res_op, valueize)) ++ return true; ++ ++ return false; ++} ++ ++/* Helper that matches and simplifies the toplevel result from ++ a gimple_simplify run (where we don't want to build ++ a stmt in case it's used in in-place folding). Replaces ++ RES_OP with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++static bool ++gimple_resimplify2 (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (res_op->ops[0]) ++ && constant_for_folding (res_op->ops[1])) ++ { ++ tree tem = NULL_TREE; ++ if (res_op->code.is_tree_code ()) ++ { ++ auto code = tree_code (res_op->code); ++ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) ++ && TREE_CODE_LENGTH (code) == 2) ++ tem = const_binop (code, res_op->type, ++ res_op->ops[0], res_op->ops[1]); ++ } ++ else ++ tem = fold_const_call (combined_fn (res_op->code), res_op->type, ++ res_op->ops[0], res_op->ops[1]); ++ if (tem != NULL_TREE ++ && CONSTANT_CLASS_P (tem)) ++ { ++ if (TREE_OVERFLOW_P (tem)) ++ tem = drop_tree_overflow (tem); ++ res_op->set_value (tem); ++ maybe_resimplify_conditional_op (seq, res_op, valueize); ++ return true; ++ } ++ } ++ ++ /* Canonicalize operand order. */ ++ bool canonicalized = false; ++ bool is_comparison ++ = (res_op->code.is_tree_code () ++ && TREE_CODE_CLASS (tree_code (res_op->code)) == tcc_comparison); ++ if ((is_comparison || commutative_binary_op_p (res_op->code, res_op->type)) ++ && tree_swap_operands_p (res_op->ops[0], res_op->ops[1])) ++ { ++ std::swap (res_op->ops[0], res_op->ops[1]); ++ if (is_comparison) ++ res_op->code = swap_tree_comparison (tree_code (res_op->code)); ++ canonicalized = true; ++ } ++ ++ /* Limit recursion, see gimple_resimplify1. */ ++ static unsigned depth; ++ if (depth > 10) ++ { ++ if (dump_file && (dump_flags & TDF_FOLDING)) ++ fprintf (dump_file, "Aborting expression simplification due to " ++ "deep recursion\n"); ++ return false; ++ } ++ ++ ++depth; ++ gimple_match_op res_op2 (*res_op); ++ if (gimple_simplify (&res_op2, seq, valueize, ++ res_op->code, res_op->type, ++ res_op->ops[0], res_op->ops[1])) ++ { ++ --depth; ++ *res_op = res_op2; ++ return true; ++ } ++ --depth; ++ ++ if (maybe_resimplify_conditional_op (seq, res_op, valueize)) ++ return true; ++ ++ return canonicalized; ++} ++ ++/* Helper that matches and simplifies the toplevel result from ++ a gimple_simplify run (where we don't want to build ++ a stmt in case it's used in in-place folding). Replaces ++ RES_OP with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++static bool ++gimple_resimplify3 (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize)(tree)) ++{ ++ if (constant_for_folding (res_op->ops[0]) ++ && constant_for_folding (res_op->ops[1]) ++ && constant_for_folding (res_op->ops[2])) ++ { ++ tree tem = NULL_TREE; ++ if (res_op->code.is_tree_code ()) ++ { ++ auto code = tree_code (res_op->code); ++ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) ++ && TREE_CODE_LENGTH (code) == 3) ++ tem = fold_ternary/*_to_constant*/ (code, res_op->type, ++ res_op->ops[0], res_op->ops[1], ++ res_op->ops[2]); ++ } ++ else ++ tem = fold_const_call (combined_fn (res_op->code), res_op->type, ++ res_op->ops[0], res_op->ops[1], res_op->ops[2]); ++ if (tem != NULL_TREE ++ && CONSTANT_CLASS_P (tem)) ++ { ++ if (TREE_OVERFLOW_P (tem)) ++ tem = drop_tree_overflow (tem); ++ res_op->set_value (tem); ++ maybe_resimplify_conditional_op (seq, res_op, valueize); ++ return true; ++ } ++ } ++ ++ /* Canonicalize operand order. */ ++ bool canonicalized = false; ++ int argno = first_commutative_argument (res_op->code, res_op->type); ++ if (argno >= 0 ++ && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) ++ { ++ std::swap (res_op->ops[argno], res_op->ops[argno + 1]); ++ canonicalized = true; ++ } ++ ++ /* Limit recursion, see gimple_resimplify1. */ ++ static unsigned depth; ++ if (depth > 10) ++ { ++ if (dump_file && (dump_flags & TDF_FOLDING)) ++ fprintf (dump_file, "Aborting expression simplification due to " ++ "deep recursion\n"); ++ return false; ++ } ++ ++ ++depth; ++ gimple_match_op res_op2 (*res_op); ++ if (gimple_simplify (&res_op2, seq, valueize, ++ res_op->code, res_op->type, ++ res_op->ops[0], res_op->ops[1], res_op->ops[2])) ++ { ++ --depth; ++ *res_op = res_op2; ++ return true; ++ } ++ --depth; ++ ++ if (maybe_resimplify_conditional_op (seq, res_op, valueize)) ++ return true; ++ ++ return canonicalized; ++} ++ ++/* Helper that matches and simplifies the toplevel result from ++ a gimple_simplify run (where we don't want to build ++ a stmt in case it's used in in-place folding). Replaces ++ RES_OP with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++static bool ++gimple_resimplify4 (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize)(tree)) ++{ ++ /* No constant folding is defined for four-operand functions. */ ++ ++ /* Canonicalize operand order. */ ++ bool canonicalized = false; ++ int argno = first_commutative_argument (res_op->code, res_op->type); ++ if (argno >= 0 ++ && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) ++ { ++ std::swap (res_op->ops[argno], res_op->ops[argno + 1]); ++ canonicalized = true; ++ } ++ ++ /* Limit recursion, see gimple_resimplify1. */ ++ static unsigned depth; ++ if (depth > 10) ++ { ++ if (dump_file && (dump_flags & TDF_FOLDING)) ++ fprintf (dump_file, "Aborting expression simplification due to " ++ "deep recursion\n"); ++ return false; ++ } ++ ++ ++depth; ++ gimple_match_op res_op2 (*res_op); ++ if (gimple_simplify (&res_op2, seq, valueize, ++ res_op->code, res_op->type, ++ res_op->ops[0], res_op->ops[1], res_op->ops[2], ++ res_op->ops[3])) ++ { ++ --depth; ++ *res_op = res_op2; ++ return true; ++ } ++ --depth; ++ ++ if (maybe_resimplify_conditional_op (seq, res_op, valueize)) ++ return true; ++ ++ return canonicalized; ++} ++ ++/* Helper that matches and simplifies the toplevel result from ++ a gimple_simplify run (where we don't want to build ++ a stmt in case it's used in in-place folding). Replaces ++ RES_OP with a simplified and/or canonicalized result and ++ returns whether any change was made. */ ++ ++static bool ++gimple_resimplify5 (gimple_seq *seq, gimple_match_op *res_op, ++ tree (*valueize)(tree)) ++{ ++ /* No constant folding is defined for five-operand functions. */ ++ ++ /* Canonicalize operand order. */ ++ bool canonicalized = false; ++ int argno = first_commutative_argument (res_op->code, res_op->type); ++ if (argno >= 0 ++ && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) ++ { ++ std::swap (res_op->ops[argno], res_op->ops[argno + 1]); ++ canonicalized = true; ++ } ++ ++ gimple_match_op res_op2 (*res_op); ++ if (gimple_simplify (&res_op2, seq, valueize, ++ res_op->code, res_op->type, ++ res_op->ops[0], res_op->ops[1], res_op->ops[2], ++ res_op->ops[3], res_op->ops[4])) ++ { ++ *res_op = res_op2; ++ return true; ++ } ++ ++ if (maybe_resimplify_conditional_op (seq, res_op, valueize)) ++ return true; ++ ++ return canonicalized; ++} ++ ++/* Return a canonical form for CODE when operating on TYPE. The idea ++ is to remove redundant ways of representing the same operation so ++ that code_helpers can be hashed and compared for equality. ++ ++ The only current canonicalization is to replace built-in functions ++ with internal functions, in cases where internal-fn.def defines ++ such an internal function. ++ ++ Note that the new code_helper cannot necessarily be used in place of ++ the original code_helper. For example, the new code_helper might be ++ an internal function that the target does not support. */ ++ ++code_helper ++canonicalize_code (code_helper code, tree type) ++{ ++ if (code.is_fn_code ()) ++ return associated_internal_fn (combined_fn (code), type); ++ return code; ++} ++ ++/* Return true if CODE is a binary operation and if CODE is commutative when ++ operating on type TYPE. */ ++ ++bool ++commutative_binary_op_p (code_helper code, tree type) ++{ ++ if (code.is_tree_code ()) ++ return commutative_tree_code (tree_code (code)); ++ auto cfn = combined_fn (code); ++ return commutative_binary_fn_p (associated_internal_fn (cfn, type)); ++} ++ ++/* Return true if CODE represents a ternary operation and if the first two ++ operands are commutative when CODE is operating on TYPE. */ ++ ++bool ++commutative_ternary_op_p (code_helper code, tree type) ++{ ++ if (code.is_tree_code ()) ++ return commutative_ternary_tree_code (tree_code (code)); ++ auto cfn = combined_fn (code); ++ return commutative_ternary_fn_p (associated_internal_fn (cfn, type)); ++} ++ ++/* If CODE is commutative in two consecutive operands, return the ++ index of the first, otherwise return -1. */ ++ ++int ++first_commutative_argument (code_helper code, tree type) ++{ ++ if (code.is_tree_code ()) ++ { ++ auto tcode = tree_code (code); ++ if (commutative_tree_code (tcode) ++ || commutative_ternary_tree_code (tcode)) ++ return 0; ++ return -1; ++ } ++ auto cfn = combined_fn (code); ++ return first_commutative_argument (associated_internal_fn (cfn, type)); ++} ++ ++/* Return true if CODE is a binary operation that is associative when ++ operating on type TYPE. */ ++ ++bool ++associative_binary_op_p (code_helper code, tree type) ++{ ++ if (code.is_tree_code ()) ++ return associative_tree_code (tree_code (code)); ++ auto cfn = combined_fn (code); ++ return associative_binary_fn_p (associated_internal_fn (cfn, type)); ++} ++ ++/* Return true if the target directly supports operation CODE on type TYPE. ++ QUERY_TYPE acts as for optab_for_tree_code. */ ++ ++bool ++directly_supported_p (code_helper code, tree type, optab_subtype query_type) ++{ ++ if (code.is_tree_code ()) ++ { ++ direct_optab optab = optab_for_tree_code (tree_code (code), type, ++ query_type); ++ return (optab != unknown_optab ++ && optab_handler (optab, TYPE_MODE (type)) != CODE_FOR_nothing); ++ } ++ gcc_assert (query_type == optab_default ++ || (query_type == optab_vector && VECTOR_TYPE_P (type)) ++ || (query_type == optab_scalar && !VECTOR_TYPE_P (type))); ++ internal_fn ifn = associated_internal_fn (combined_fn (code), type); ++ return (direct_internal_fn_p (ifn) ++ && direct_internal_fn_supported_p (ifn, type, OPTIMIZE_FOR_SPEED)); ++} ++ ++/* A wrapper around the internal-fn.cc versions of get_conditional_internal_fn ++ for a code_helper CODE operating on type TYPE. */ ++ ++internal_fn ++get_conditional_internal_fn (code_helper code, tree type) ++{ ++ if (code.is_tree_code ()) ++ return get_conditional_internal_fn (tree_code (code)); ++ auto cfn = combined_fn (code); ++ return get_conditional_internal_fn (associated_internal_fn (cfn, type)); ++} +diff --git a/gcc/gimple-match-head.cc b/gcc/gimple-match-head.cc +index 21843d7870b3..3069ff5cb6e1 100644 +--- a/gcc/gimple-match-head.cc ++++ b/gcc/gimple-match-head.cc +@@ -50,1089 +50,8 @@ along with GCC; see the file COPYING3. If not see + #include "attribs.h" + #include "asan.h" + +-/* Forward declarations of the private auto-generated matchers. +- They expect valueized operands in canonical order and do not +- perform simplification of all-constant operands. */ +-static bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), +- code_helper, tree, tree); +-static bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), +- code_helper, tree, tree, tree); +-static bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), +- code_helper, tree, tree, tree, tree); +-static bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), +- code_helper, tree, tree, tree, tree, tree); +-static bool gimple_simplify (gimple_match_op *, gimple_seq *, tree (*)(tree), +- code_helper, tree, tree, tree, tree, tree, tree); +-static bool gimple_resimplify1 (gimple_seq *, gimple_match_op *, +- tree (*)(tree)); +-static bool gimple_resimplify2 (gimple_seq *, gimple_match_op *, +- tree (*)(tree)); +-static bool gimple_resimplify3 (gimple_seq *, gimple_match_op *, +- tree (*)(tree)); +-static bool gimple_resimplify4 (gimple_seq *, gimple_match_op *, +- tree (*)(tree)); +-static bool gimple_resimplify5 (gimple_seq *, gimple_match_op *, +- tree (*)(tree)); +- +-const unsigned int gimple_match_op::MAX_NUM_OPS; +- +-/* Return whether T is a constant that we'll dispatch to fold to +- evaluate fully constant expressions. */ +- +-static inline bool +-constant_for_folding (tree t) +-{ +- return (CONSTANT_CLASS_P (t) +- /* The following is only interesting to string builtins. */ +- || (TREE_CODE (t) == ADDR_EXPR +- && TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST)); +-} +- +-/* Try to convert conditional operation ORIG_OP into an IFN_COND_* +- operation. Return true on success, storing the new operation in NEW_OP. */ +- +-static bool +-convert_conditional_op (gimple_match_op *orig_op, +- gimple_match_op *new_op) +-{ +- internal_fn ifn; +- if (orig_op->code.is_tree_code ()) +- ifn = get_conditional_internal_fn ((tree_code) orig_op->code); +- else +- { +- auto cfn = combined_fn (orig_op->code); +- if (!internal_fn_p (cfn)) +- return false; +- ifn = get_conditional_internal_fn (as_internal_fn (cfn)); +- } +- if (ifn == IFN_LAST) +- return false; +- unsigned int num_ops = orig_op->num_ops; +- new_op->set_op (as_combined_fn (ifn), orig_op->type, num_ops + 2); +- new_op->ops[0] = orig_op->cond.cond; +- for (unsigned int i = 0; i < num_ops; ++i) +- new_op->ops[i + 1] = orig_op->ops[i]; +- tree else_value = orig_op->cond.else_value; +- if (!else_value) +- else_value = targetm.preferred_else_value (ifn, orig_op->type, +- num_ops, orig_op->ops); +- new_op->ops[num_ops + 1] = else_value; +- return true; +-} +- +-/* RES_OP is the result of a simplification. If it is conditional, +- try to replace it with the equivalent UNCOND form, such as an +- IFN_COND_* call or a VEC_COND_EXPR. Also try to resimplify the +- result of the replacement if appropriate, adding any new statements to +- SEQ and using VALUEIZE as the valueization function. Return true if +- this resimplification occurred and resulted in at least one change. */ +- +-static bool +-maybe_resimplify_conditional_op (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize) (tree)) +-{ +- if (!res_op->cond.cond) +- return false; +- +- if (!res_op->cond.else_value +- && res_op->code.is_tree_code ()) +- { +- /* The "else" value doesn't matter. If the "then" value is a +- gimple value, just use it unconditionally. This isn't a +- simplification in itself, since there was no operation to +- build in the first place. */ +- if (gimple_simplified_result_is_gimple_val (res_op)) +- { +- res_op->cond.cond = NULL_TREE; +- return false; +- } +- +- /* Likewise if the operation would not trap. */ +- bool honor_trapv = (INTEGRAL_TYPE_P (res_op->type) +- && TYPE_OVERFLOW_TRAPS (res_op->type)); +- tree_code op_code = (tree_code) res_op->code; +- bool op_could_trap; +- +- /* COND_EXPR will trap if, and only if, the condition +- traps and hence we have to check this. For all other operations, we +- don't need to consider the operands. */ +- if (op_code == COND_EXPR) +- op_could_trap = generic_expr_could_trap_p (res_op->ops[0]); +- else +- op_could_trap = operation_could_trap_p ((tree_code) res_op->code, +- FLOAT_TYPE_P (res_op->type), +- honor_trapv, +- res_op->op_or_null (1)); +- +- if (!op_could_trap) +- { +- res_op->cond.cond = NULL_TREE; +- return false; +- } +- } +- +- /* If the "then" value is a gimple value and the "else" value matters, +- create a VEC_COND_EXPR between them, then see if it can be further +- simplified. */ +- gimple_match_op new_op; +- if (res_op->cond.else_value +- && VECTOR_TYPE_P (res_op->type) +- && gimple_simplified_result_is_gimple_val (res_op)) +- { +- new_op.set_op (VEC_COND_EXPR, res_op->type, +- res_op->cond.cond, res_op->ops[0], +- res_op->cond.else_value); +- *res_op = new_op; +- return gimple_resimplify3 (seq, res_op, valueize); +- } +- +- /* Otherwise try rewriting the operation as an IFN_COND_* call. +- Again, this isn't a simplification in itself, since it's what +- RES_OP already described. */ +- if (convert_conditional_op (res_op, &new_op)) +- *res_op = new_op; +- +- return false; +-} +- +-/* Helper that matches and simplifies the toplevel result from +- a gimple_simplify run (where we don't want to build +- a stmt in case it's used in in-place folding). Replaces +- RES_OP with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-static bool +-gimple_resimplify1 (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize)(tree)) +-{ +- if (constant_for_folding (res_op->ops[0])) +- { +- tree tem = NULL_TREE; +- if (res_op->code.is_tree_code ()) +- { +- auto code = tree_code (res_op->code); +- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) +- && TREE_CODE_LENGTH (code) == 1) +- tem = const_unop (code, res_op->type, res_op->ops[0]); +- } +- else +- tem = fold_const_call (combined_fn (res_op->code), res_op->type, +- res_op->ops[0]); +- if (tem != NULL_TREE +- && CONSTANT_CLASS_P (tem)) +- { +- if (TREE_OVERFLOW_P (tem)) +- tem = drop_tree_overflow (tem); +- res_op->set_value (tem); +- maybe_resimplify_conditional_op (seq, res_op, valueize); +- return true; +- } +- } +- +- /* Limit recursion, there are cases like PR80887 and others, for +- example when value-numbering presents us with unfolded expressions +- that we are really not prepared to handle without eventual +- oscillation like ((_50 + 0) + 8) where _50 gets mapped to _50 +- itself as available expression. */ +- static unsigned depth; +- if (depth > 10) +- { +- if (dump_file && (dump_flags & TDF_FOLDING)) +- fprintf (dump_file, "Aborting expression simplification due to " +- "deep recursion\n"); +- return false; +- } +- +- ++depth; +- gimple_match_op res_op2 (*res_op); +- if (gimple_simplify (&res_op2, seq, valueize, +- res_op->code, res_op->type, res_op->ops[0])) +- { +- --depth; +- *res_op = res_op2; +- return true; +- } +- --depth; +- +- if (maybe_resimplify_conditional_op (seq, res_op, valueize)) +- return true; +- +- return false; +-} +- +-/* Helper that matches and simplifies the toplevel result from +- a gimple_simplify run (where we don't want to build +- a stmt in case it's used in in-place folding). Replaces +- RES_OP with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-static bool +-gimple_resimplify2 (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize)(tree)) +-{ +- if (constant_for_folding (res_op->ops[0]) +- && constant_for_folding (res_op->ops[1])) +- { +- tree tem = NULL_TREE; +- if (res_op->code.is_tree_code ()) +- { +- auto code = tree_code (res_op->code); +- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) +- && TREE_CODE_LENGTH (code) == 2) +- tem = const_binop (code, res_op->type, +- res_op->ops[0], res_op->ops[1]); +- } +- else +- tem = fold_const_call (combined_fn (res_op->code), res_op->type, +- res_op->ops[0], res_op->ops[1]); +- if (tem != NULL_TREE +- && CONSTANT_CLASS_P (tem)) +- { +- if (TREE_OVERFLOW_P (tem)) +- tem = drop_tree_overflow (tem); +- res_op->set_value (tem); +- maybe_resimplify_conditional_op (seq, res_op, valueize); +- return true; +- } +- } +- +- /* Canonicalize operand order. */ +- bool canonicalized = false; +- bool is_comparison +- = (res_op->code.is_tree_code () +- && TREE_CODE_CLASS (tree_code (res_op->code)) == tcc_comparison); +- if ((is_comparison || commutative_binary_op_p (res_op->code, res_op->type)) +- && tree_swap_operands_p (res_op->ops[0], res_op->ops[1])) +- { +- std::swap (res_op->ops[0], res_op->ops[1]); +- if (is_comparison) +- res_op->code = swap_tree_comparison (tree_code (res_op->code)); +- canonicalized = true; +- } +- +- /* Limit recursion, see gimple_resimplify1. */ +- static unsigned depth; +- if (depth > 10) +- { +- if (dump_file && (dump_flags & TDF_FOLDING)) +- fprintf (dump_file, "Aborting expression simplification due to " +- "deep recursion\n"); +- return false; +- } +- +- ++depth; +- gimple_match_op res_op2 (*res_op); +- if (gimple_simplify (&res_op2, seq, valueize, +- res_op->code, res_op->type, +- res_op->ops[0], res_op->ops[1])) +- { +- --depth; +- *res_op = res_op2; +- return true; +- } +- --depth; +- +- if (maybe_resimplify_conditional_op (seq, res_op, valueize)) +- return true; +- +- return canonicalized; +-} +- +-/* Helper that matches and simplifies the toplevel result from +- a gimple_simplify run (where we don't want to build +- a stmt in case it's used in in-place folding). Replaces +- RES_OP with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-static bool +-gimple_resimplify3 (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize)(tree)) +-{ +- if (constant_for_folding (res_op->ops[0]) +- && constant_for_folding (res_op->ops[1]) +- && constant_for_folding (res_op->ops[2])) +- { +- tree tem = NULL_TREE; +- if (res_op->code.is_tree_code ()) +- { +- auto code = tree_code (res_op->code); +- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)) +- && TREE_CODE_LENGTH (code) == 3) +- tem = fold_ternary/*_to_constant*/ (code, res_op->type, +- res_op->ops[0], res_op->ops[1], +- res_op->ops[2]); +- } +- else +- tem = fold_const_call (combined_fn (res_op->code), res_op->type, +- res_op->ops[0], res_op->ops[1], res_op->ops[2]); +- if (tem != NULL_TREE +- && CONSTANT_CLASS_P (tem)) +- { +- if (TREE_OVERFLOW_P (tem)) +- tem = drop_tree_overflow (tem); +- res_op->set_value (tem); +- maybe_resimplify_conditional_op (seq, res_op, valueize); +- return true; +- } +- } +- +- /* Canonicalize operand order. */ +- bool canonicalized = false; +- int argno = first_commutative_argument (res_op->code, res_op->type); +- if (argno >= 0 +- && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) +- { +- std::swap (res_op->ops[argno], res_op->ops[argno + 1]); +- canonicalized = true; +- } +- +- /* Limit recursion, see gimple_resimplify1. */ +- static unsigned depth; +- if (depth > 10) +- { +- if (dump_file && (dump_flags & TDF_FOLDING)) +- fprintf (dump_file, "Aborting expression simplification due to " +- "deep recursion\n"); +- return false; +- } +- +- ++depth; +- gimple_match_op res_op2 (*res_op); +- if (gimple_simplify (&res_op2, seq, valueize, +- res_op->code, res_op->type, +- res_op->ops[0], res_op->ops[1], res_op->ops[2])) +- { +- --depth; +- *res_op = res_op2; +- return true; +- } +- --depth; +- +- if (maybe_resimplify_conditional_op (seq, res_op, valueize)) +- return true; +- +- return canonicalized; +-} +- +-/* Helper that matches and simplifies the toplevel result from +- a gimple_simplify run (where we don't want to build +- a stmt in case it's used in in-place folding). Replaces +- RES_OP with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-static bool +-gimple_resimplify4 (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize)(tree)) +-{ +- /* No constant folding is defined for four-operand functions. */ +- +- /* Canonicalize operand order. */ +- bool canonicalized = false; +- int argno = first_commutative_argument (res_op->code, res_op->type); +- if (argno >= 0 +- && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) +- { +- std::swap (res_op->ops[argno], res_op->ops[argno + 1]); +- canonicalized = true; +- } +- +- /* Limit recursion, see gimple_resimplify1. */ +- static unsigned depth; +- if (depth > 10) +- { +- if (dump_file && (dump_flags & TDF_FOLDING)) +- fprintf (dump_file, "Aborting expression simplification due to " +- "deep recursion\n"); +- return false; +- } +- +- ++depth; +- gimple_match_op res_op2 (*res_op); +- if (gimple_simplify (&res_op2, seq, valueize, +- res_op->code, res_op->type, +- res_op->ops[0], res_op->ops[1], res_op->ops[2], +- res_op->ops[3])) +- { +- --depth; +- *res_op = res_op2; +- return true; +- } +- --depth; +- +- if (maybe_resimplify_conditional_op (seq, res_op, valueize)) +- return true; +- +- return canonicalized; +-} +- +-/* Helper that matches and simplifies the toplevel result from +- a gimple_simplify run (where we don't want to build +- a stmt in case it's used in in-place folding). Replaces +- RES_OP with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-static bool +-gimple_resimplify5 (gimple_seq *seq, gimple_match_op *res_op, +- tree (*valueize)(tree)) +-{ +- /* No constant folding is defined for five-operand functions. */ +- +- /* Canonicalize operand order. */ +- bool canonicalized = false; +- int argno = first_commutative_argument (res_op->code, res_op->type); +- if (argno >= 0 +- && tree_swap_operands_p (res_op->ops[argno], res_op->ops[argno + 1])) +- { +- std::swap (res_op->ops[argno], res_op->ops[argno + 1]); +- canonicalized = true; +- } +- +- gimple_match_op res_op2 (*res_op); +- if (gimple_simplify (&res_op2, seq, valueize, +- res_op->code, res_op->type, +- res_op->ops[0], res_op->ops[1], res_op->ops[2], +- res_op->ops[3], res_op->ops[4])) +- { +- *res_op = res_op2; +- return true; +- } +- +- if (maybe_resimplify_conditional_op (seq, res_op, valueize)) +- return true; +- +- return canonicalized; +-} +- +-/* Match and simplify the toplevel valueized operation THIS. +- Replaces THIS with a simplified and/or canonicalized result and +- returns whether any change was made. */ +- +-bool +-gimple_match_op::resimplify (gimple_seq *seq, tree (*valueize)(tree)) +-{ +- switch (num_ops) +- { +- case 1: +- return gimple_resimplify1 (seq, this, valueize); +- case 2: +- return gimple_resimplify2 (seq, this, valueize); +- case 3: +- return gimple_resimplify3 (seq, this, valueize); +- case 4: +- return gimple_resimplify4 (seq, this, valueize); +- case 5: +- return gimple_resimplify5 (seq, this, valueize); +- default: +- gcc_unreachable (); +- } +-} +- +-/* If in GIMPLE the operation described by RES_OP should be single-rhs, +- build a GENERIC tree for that expression and update RES_OP accordingly. */ +- +-void +-maybe_build_generic_op (gimple_match_op *res_op) +-{ +- tree_code code = (tree_code) res_op->code; +- tree val; +- switch (code) +- { +- case REALPART_EXPR: +- case IMAGPART_EXPR: +- case VIEW_CONVERT_EXPR: +- val = build1 (code, res_op->type, res_op->ops[0]); +- res_op->set_value (val); +- break; +- case BIT_FIELD_REF: +- val = build3 (code, res_op->type, res_op->ops[0], res_op->ops[1], +- res_op->ops[2]); +- REF_REVERSE_STORAGE_ORDER (val) = res_op->reverse; +- res_op->set_value (val); +- break; +- default:; +- } +-} +- +-tree (*mprts_hook) (gimple_match_op *); +- +-/* Try to build RES_OP, which is known to be a call to FN. Return null +- if the target doesn't support the function. */ +- +-static gcall * +-build_call_internal (internal_fn fn, gimple_match_op *res_op) +-{ +- if (direct_internal_fn_p (fn)) +- { +- tree_pair types = direct_internal_fn_types (fn, res_op->type, +- res_op->ops); +- if (!direct_internal_fn_supported_p (fn, types, OPTIMIZE_FOR_BOTH)) +- return NULL; +- } +- return gimple_build_call_internal (fn, res_op->num_ops, +- res_op->op_or_null (0), +- res_op->op_or_null (1), +- res_op->op_or_null (2), +- res_op->op_or_null (3), +- res_op->op_or_null (4)); +-} +- +-/* Push the exploded expression described by RES_OP as a statement to +- SEQ if necessary and return a gimple value denoting the value of the +- expression. If RES is not NULL then the result will be always RES +- and even gimple values are pushed to SEQ. */ +- +-tree +-maybe_push_res_to_seq (gimple_match_op *res_op, gimple_seq *seq, tree res) +-{ +- tree *ops = res_op->ops; +- unsigned num_ops = res_op->num_ops; +- +- /* The caller should have converted conditional operations into an UNCOND +- form and resimplified as appropriate. The conditional form only +- survives this far if that conversion failed. */ +- if (res_op->cond.cond) +- return NULL_TREE; +- +- if (res_op->code.is_tree_code ()) +- { +- if (!res +- && gimple_simplified_result_is_gimple_val (res_op)) +- return ops[0]; +- if (mprts_hook) +- { +- tree tem = mprts_hook (res_op); +- if (tem) +- return tem; +- } +- } +- +- if (!seq) +- return NULL_TREE; +- +- /* Play safe and do not allow abnormals to be mentioned in +- newly created statements. */ +- for (unsigned int i = 0; i < num_ops; ++i) +- if (TREE_CODE (ops[i]) == SSA_NAME +- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ops[i])) +- return NULL_TREE; +- +- if (num_ops > 0 && COMPARISON_CLASS_P (ops[0])) +- for (unsigned int i = 0; i < 2; ++i) +- if (TREE_CODE (TREE_OPERAND (ops[0], i)) == SSA_NAME +- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (ops[0], i))) +- return NULL_TREE; +- +- if (res_op->code.is_tree_code ()) +- { +- auto code = tree_code (res_op->code); +- if (!res) +- { +- if (gimple_in_ssa_p (cfun)) +- res = make_ssa_name (res_op->type); +- else +- res = create_tmp_reg (res_op->type); +- } +- maybe_build_generic_op (res_op); +- gimple *new_stmt = gimple_build_assign (res, code, +- res_op->op_or_null (0), +- res_op->op_or_null (1), +- res_op->op_or_null (2)); +- gimple_seq_add_stmt_without_update (seq, new_stmt); +- return res; +- } +- else +- { +- gcc_assert (num_ops != 0); +- auto fn = combined_fn (res_op->code); +- gcall *new_stmt = NULL; +- if (internal_fn_p (fn)) +- { +- /* Generate the given function if we can. */ +- internal_fn ifn = as_internal_fn (fn); +- new_stmt = build_call_internal (ifn, res_op); +- if (!new_stmt) +- return NULL_TREE; +- } +- else +- { +- /* Find the function we want to call. */ +- tree decl = builtin_decl_implicit (as_builtin_fn (fn)); +- if (!decl) +- return NULL; +- +- /* We can't and should not emit calls to non-const functions. */ +- if (!(flags_from_decl_or_type (decl) & ECF_CONST)) +- return NULL; +- +- new_stmt = gimple_build_call (decl, num_ops, +- res_op->op_or_null (0), +- res_op->op_or_null (1), +- res_op->op_or_null (2), +- res_op->op_or_null (3), +- res_op->op_or_null (4)); +- } +- if (!res) +- { +- if (gimple_in_ssa_p (cfun)) +- res = make_ssa_name (res_op->type); +- else +- res = create_tmp_reg (res_op->type); +- } +- gimple_call_set_lhs (new_stmt, res); +- gimple_seq_add_stmt_without_update (seq, new_stmt); +- return res; +- } +-} +- +- +-/* Public API overloads follow for operation being tree_code or +- built_in_function and for one to three operands or arguments. +- They return NULL_TREE if nothing could be simplified or +- the resulting simplified value with parts pushed to SEQ. +- If SEQ is NULL then if the simplification needs to create +- new stmts it will fail. If VALUEIZE is non-NULL then all +- SSA names will be valueized using that hook prior to +- applying simplifications. */ +- +-/* Unary ops. */ +- +-tree +-gimple_simplify (enum tree_code code, tree type, +- tree op0, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (op0)) +- { +- tree res = const_unop (code, type, op0); +- if (res != NULL_TREE +- && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, code, type, op0)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Binary ops. */ +- +-tree +-gimple_simplify (enum tree_code code, tree type, +- tree op0, tree op1, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (op0) && constant_for_folding (op1)) +- { +- tree res = const_binop (code, type, op0, op1); +- if (res != NULL_TREE +- && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- /* Canonicalize operand order both for matching and fallback stmt +- generation. */ +- if ((commutative_tree_code (code) +- || TREE_CODE_CLASS (code) == tcc_comparison) +- && tree_swap_operands_p (op0, op1)) +- { +- std::swap (op0, op1); +- if (TREE_CODE_CLASS (code) == tcc_comparison) +- code = swap_tree_comparison (code); +- } +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, code, type, op0, op1)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Ternary ops. */ +- +-tree +-gimple_simplify (enum tree_code code, tree type, +- tree op0, tree op1, tree op2, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (op0) && constant_for_folding (op1) +- && constant_for_folding (op2)) +- { +- tree res = fold_ternary/*_to_constant */ (code, type, op0, op1, op2); +- if (res != NULL_TREE +- && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- /* Canonicalize operand order both for matching and fallback stmt +- generation. */ +- if (commutative_ternary_tree_code (code) +- && tree_swap_operands_p (op0, op1)) +- std::swap (op0, op1); +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, code, type, op0, op1, op2)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Builtin or internal function with one argument. */ +- +-tree +-gimple_simplify (combined_fn fn, tree type, +- tree arg0, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (arg0)) +- { +- tree res = fold_const_call (fn, type, arg0); +- if (res && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Builtin or internal function with two arguments. */ +- +-tree +-gimple_simplify (combined_fn fn, tree type, +- tree arg0, tree arg1, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (arg0) +- && constant_for_folding (arg1)) +- { +- tree res = fold_const_call (fn, type, arg0, arg1); +- if (res && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0, arg1)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Builtin or internal function with three arguments. */ +- +-tree +-gimple_simplify (combined_fn fn, tree type, +- tree arg0, tree arg1, tree arg2, +- gimple_seq *seq, tree (*valueize)(tree)) +-{ +- if (constant_for_folding (arg0) +- && constant_for_folding (arg1) +- && constant_for_folding (arg2)) +- { +- tree res = fold_const_call (fn, type, arg0, arg1, arg2); +- if (res && CONSTANT_CLASS_P (res)) +- return res; +- } +- +- gimple_match_op res_op; +- if (!gimple_simplify (&res_op, seq, valueize, fn, type, arg0, arg1, arg2)) +- return NULL_TREE; +- return maybe_push_res_to_seq (&res_op, seq); +-} +- +-/* Helper for gimple_simplify valueizing OP using VALUEIZE and setting +- VALUEIZED to true if valueization changed OP. */ +- +-static inline tree +-do_valueize (tree op, tree (*valueize)(tree), bool &valueized) +-{ +- if (valueize && TREE_CODE (op) == SSA_NAME) +- { +- tree tem = valueize (op); +- if (tem && tem != op) +- { +- op = tem; +- valueized = true; +- } +- } +- return op; +-} +- +-/* If RES_OP is a call to a conditional internal function, try simplifying +- the associated unconditional operation and using the result to build +- a new conditional operation. For example, if RES_OP is: +- +- IFN_COND_ADD (COND, A, B, ELSE) +- +- try simplifying (plus A B) and using the result to build a replacement +- for the whole IFN_COND_ADD. +- +- Return true if this approach led to a simplification, otherwise leave +- RES_OP unchanged (and so suitable for other simplifications). When +- returning true, add any new statements to SEQ and use VALUEIZE as the +- valueization function. +- +- RES_OP is known to be a call to IFN. */ +- +-static bool +-try_conditional_simplification (internal_fn ifn, gimple_match_op *res_op, +- gimple_seq *seq, tree (*valueize) (tree)) +-{ +- code_helper op; +- tree_code code = conditional_internal_fn_code (ifn); +- if (code != ERROR_MARK) +- op = code; +- else +- { +- ifn = get_unconditional_internal_fn (ifn); +- if (ifn == IFN_LAST) +- return false; +- op = as_combined_fn (ifn); +- } +- +- unsigned int num_ops = res_op->num_ops; +- gimple_match_op cond_op (gimple_match_cond (res_op->ops[0], +- res_op->ops[num_ops - 1]), +- op, res_op->type, num_ops - 2); +- +- memcpy (cond_op.ops, res_op->ops + 1, (num_ops - 1) * sizeof *cond_op.ops); +- switch (num_ops - 2) +- { +- case 1: +- if (!gimple_resimplify1 (seq, &cond_op, valueize)) +- return false; +- break; +- case 2: +- if (!gimple_resimplify2 (seq, &cond_op, valueize)) +- return false; +- break; +- case 3: +- if (!gimple_resimplify3 (seq, &cond_op, valueize)) +- return false; +- break; +- default: +- gcc_unreachable (); +- } +- *res_op = cond_op; +- maybe_resimplify_conditional_op (seq, res_op, valueize); +- return true; +-} +- +-/* Common subroutine of gimple_extract_op and gimple_simplify. Try to +- describe STMT in RES_OP, returning true on success. Before recording +- an operand, call: +- +- - VALUEIZE_CONDITION for a COND_EXPR condition +- - VALUEIZE_OP for every other top-level operand +- +- Both routines take a tree argument and returns a tree. */ +- +-template<typename ValueizeOp, typename ValueizeCondition> +-inline bool +-gimple_extract (gimple *stmt, gimple_match_op *res_op, +- ValueizeOp valueize_op, +- ValueizeCondition valueize_condition) +-{ +- switch (gimple_code (stmt)) +- { +- case GIMPLE_ASSIGN: +- { +- enum tree_code code = gimple_assign_rhs_code (stmt); +- tree type = TREE_TYPE (gimple_assign_lhs (stmt)); +- switch (gimple_assign_rhs_class (stmt)) +- { +- case GIMPLE_SINGLE_RHS: +- if (code == REALPART_EXPR +- || code == IMAGPART_EXPR +- || code == VIEW_CONVERT_EXPR) +- { +- tree op0 = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0); +- res_op->set_op (code, type, valueize_op (op0)); +- return true; +- } +- else if (code == BIT_FIELD_REF) +- { +- tree rhs1 = gimple_assign_rhs1 (stmt); +- tree op0 = valueize_op (TREE_OPERAND (rhs1, 0)); +- res_op->set_op (code, type, op0, +- TREE_OPERAND (rhs1, 1), +- TREE_OPERAND (rhs1, 2), +- REF_REVERSE_STORAGE_ORDER (rhs1)); +- return true; +- } +- else if (code == SSA_NAME) +- { +- tree op0 = gimple_assign_rhs1 (stmt); +- res_op->set_op (TREE_CODE (op0), type, valueize_op (op0)); +- return true; +- } +- break; +- case GIMPLE_UNARY_RHS: +- { +- tree rhs1 = gimple_assign_rhs1 (stmt); +- res_op->set_op (code, type, valueize_op (rhs1)); +- return true; +- } +- case GIMPLE_BINARY_RHS: +- { +- tree rhs1 = valueize_op (gimple_assign_rhs1 (stmt)); +- tree rhs2 = valueize_op (gimple_assign_rhs2 (stmt)); +- res_op->set_op (code, type, rhs1, rhs2); +- return true; +- } +- case GIMPLE_TERNARY_RHS: +- { +- tree rhs1 = gimple_assign_rhs1 (stmt); +- if (code == COND_EXPR && COMPARISON_CLASS_P (rhs1)) +- rhs1 = valueize_condition (rhs1); +- else +- rhs1 = valueize_op (rhs1); +- tree rhs2 = valueize_op (gimple_assign_rhs2 (stmt)); +- tree rhs3 = valueize_op (gimple_assign_rhs3 (stmt)); +- res_op->set_op (code, type, rhs1, rhs2, rhs3); +- return true; +- } +- default: +- gcc_unreachable (); +- } +- break; +- } +- +- case GIMPLE_CALL: +- /* ??? This way we can't simplify calls with side-effects. */ +- if (gimple_call_lhs (stmt) != NULL_TREE +- && gimple_call_num_args (stmt) >= 1 +- && gimple_call_num_args (stmt) <= 5) +- { +- combined_fn cfn; +- if (gimple_call_internal_p (stmt)) +- cfn = as_combined_fn (gimple_call_internal_fn (stmt)); +- else +- { +- tree fn = gimple_call_fn (stmt); +- if (!fn) +- return false; +- +- fn = valueize_op (fn); +- if (TREE_CODE (fn) != ADDR_EXPR +- || TREE_CODE (TREE_OPERAND (fn, 0)) != FUNCTION_DECL) +- return false; +- +- tree decl = TREE_OPERAND (fn, 0); +- if (DECL_BUILT_IN_CLASS (decl) != BUILT_IN_NORMAL +- || !gimple_builtin_call_types_compatible_p (stmt, decl)) +- return false; +- +- cfn = as_combined_fn (DECL_FUNCTION_CODE (decl)); +- } +- +- unsigned int num_args = gimple_call_num_args (stmt); +- res_op->set_op (cfn, TREE_TYPE (gimple_call_lhs (stmt)), num_args); +- for (unsigned i = 0; i < num_args; ++i) +- res_op->ops[i] = valueize_op (gimple_call_arg (stmt, i)); +- return true; +- } +- break; +- +- case GIMPLE_COND: +- { +- tree lhs = valueize_op (gimple_cond_lhs (stmt)); +- tree rhs = valueize_op (gimple_cond_rhs (stmt)); +- res_op->set_op (gimple_cond_code (stmt), boolean_type_node, lhs, rhs); +- return true; +- } +- +- default: +- break; +- } +- +- return false; +-} +- +-/* Try to describe STMT in RES_OP, returning true on success. +- For GIMPLE_CONDs, describe the condition that is being tested. +- For GIMPLE_ASSIGNs, describe the rhs of the assignment. +- For GIMPLE_CALLs, describe the call. */ +- +-bool +-gimple_extract_op (gimple *stmt, gimple_match_op *res_op) +-{ +- auto nop = [](tree op) { return op; }; +- return gimple_extract (stmt, res_op, nop, nop); +-} +- +-/* The main STMT based simplification entry. It is used by the fold_stmt +- and the fold_stmt_to_constant APIs. */ +- +-bool +-gimple_simplify (gimple *stmt, gimple_match_op *res_op, gimple_seq *seq, +- tree (*valueize)(tree), tree (*top_valueize)(tree)) +-{ +- bool valueized = false; +- auto valueize_op = [&](tree op) +- { +- return do_valueize (op, top_valueize, valueized); +- }; +- auto valueize_condition = [&](tree op) -> tree +- { +- bool cond_valueized = false; +- tree lhs = do_valueize (TREE_OPERAND (op, 0), top_valueize, +- cond_valueized); +- tree rhs = do_valueize (TREE_OPERAND (op, 1), top_valueize, +- cond_valueized); +- gimple_match_op res_op2 (res_op->cond, TREE_CODE (op), +- TREE_TYPE (op), lhs, rhs); +- if ((gimple_resimplify2 (seq, &res_op2, valueize) +- || cond_valueized) +- && res_op2.code.is_tree_code ()) +- { +- auto code = tree_code (res_op2.code); +- if (TREE_CODE_CLASS (code) == tcc_comparison) +- { +- valueized = true; +- return build2 (code, TREE_TYPE (op), +- res_op2.ops[0], res_op2.ops[1]); +- } +- else if (code == SSA_NAME +- || code == INTEGER_CST +- || code == VECTOR_CST) +- { +- valueized = true; +- return res_op2.ops[0]; +- } +- } +- return valueize_op (op); +- }; +- +- if (!gimple_extract (stmt, res_op, valueize_op, valueize_condition)) +- return false; +- +- if (res_op->code.is_internal_fn ()) +- { +- internal_fn ifn = internal_fn (res_op->code); +- if (try_conditional_simplification (ifn, res_op, seq, valueize)) +- return true; +- } +- +- if (!res_op->reverse +- && res_op->num_ops +- && res_op->resimplify (seq, valueize)) +- return true; +- +- return valueized; +-} +- +-/* Helper for the autogenerated code, valueize OP. */ +- +-inline tree +-do_valueize (tree (*valueize)(tree), tree op) +-{ +- if (valueize && TREE_CODE (op) == SSA_NAME) +- { +- tree tem = valueize (op); +- if (tem) +- return tem; +- } +- return op; +-} ++tree do_valueize (tree, tree (*)(tree), bool &); ++tree do_valueize (tree (*)(tree), tree); + + /* Helper for the autogenerated code, get at the definition of NAME when + VALUEIZE allows that. */ +@@ -1307,110 +226,3 @@ optimize_successive_divisions_p (tree divisor, tree inner_div) + } + return true; + } +- +-/* Return a canonical form for CODE when operating on TYPE. The idea +- is to remove redundant ways of representing the same operation so +- that code_helpers can be hashed and compared for equality. +- +- The only current canonicalization is to replace built-in functions +- with internal functions, in cases where internal-fn.def defines +- such an internal function. +- +- Note that the new code_helper cannot necessarily be used in place of +- the original code_helper. For example, the new code_helper might be +- an internal function that the target does not support. */ +- +-code_helper +-canonicalize_code (code_helper code, tree type) +-{ +- if (code.is_fn_code ()) +- return associated_internal_fn (combined_fn (code), type); +- return code; +-} +- +-/* Return true if CODE is a binary operation and if CODE is commutative when +- operating on type TYPE. */ +- +-bool +-commutative_binary_op_p (code_helper code, tree type) +-{ +- if (code.is_tree_code ()) +- return commutative_tree_code (tree_code (code)); +- auto cfn = combined_fn (code); +- return commutative_binary_fn_p (associated_internal_fn (cfn, type)); +-} +- +-/* Return true if CODE represents a ternary operation and if the first two +- operands are commutative when CODE is operating on TYPE. */ +- +-bool +-commutative_ternary_op_p (code_helper code, tree type) +-{ +- if (code.is_tree_code ()) +- return commutative_ternary_tree_code (tree_code (code)); +- auto cfn = combined_fn (code); +- return commutative_ternary_fn_p (associated_internal_fn (cfn, type)); +-} +- +-/* If CODE is commutative in two consecutive operands, return the +- index of the first, otherwise return -1. */ +- +-int +-first_commutative_argument (code_helper code, tree type) +-{ +- if (code.is_tree_code ()) +- { +- auto tcode = tree_code (code); +- if (commutative_tree_code (tcode) +- || commutative_ternary_tree_code (tcode)) +- return 0; +- return -1; +- } +- auto cfn = combined_fn (code); +- return first_commutative_argument (associated_internal_fn (cfn, type)); +-} +- +-/* Return true if CODE is a binary operation that is associative when +- operating on type TYPE. */ +- +-bool +-associative_binary_op_p (code_helper code, tree type) +-{ +- if (code.is_tree_code ()) +- return associative_tree_code (tree_code (code)); +- auto cfn = combined_fn (code); +- return associative_binary_fn_p (associated_internal_fn (cfn, type)); +-} +- +-/* Return true if the target directly supports operation CODE on type TYPE. +- QUERY_TYPE acts as for optab_for_tree_code. */ +- +-bool +-directly_supported_p (code_helper code, tree type, optab_subtype query_type) +-{ +- if (code.is_tree_code ()) +- { +- direct_optab optab = optab_for_tree_code (tree_code (code), type, +- query_type); +- return (optab != unknown_optab +- && optab_handler (optab, TYPE_MODE (type)) != CODE_FOR_nothing); +- } +- gcc_assert (query_type == optab_default +- || (query_type == optab_vector && VECTOR_TYPE_P (type)) +- || (query_type == optab_scalar && !VECTOR_TYPE_P (type))); +- internal_fn ifn = associated_internal_fn (combined_fn (code), type); +- return (direct_internal_fn_p (ifn) +- && direct_internal_fn_supported_p (ifn, type, OPTIMIZE_FOR_SPEED)); +-} +- +-/* A wrapper around the internal-fn.cc versions of get_conditional_internal_fn +- for a code_helper CODE operating on type TYPE. */ +- +-internal_fn +-get_conditional_internal_fn (code_helper code, tree type) +-{ +- if (code.is_tree_code ()) +- return get_conditional_internal_fn (tree_code (code)); +- auto cfn = combined_fn (code); +- return get_conditional_internal_fn (associated_internal_fn (cfn, type)); +-} +-- +2.44.0 + +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21 + +From daac5d2f67656dcf8cc2bbff1c6eaa34f3fb55b9 Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Fri, 5 May 2023 13:38:50 +0100 +Subject: [PATCH 05/15] match.pd: automatically partition *-match.cc files. + +Following on from Richi's RFC[1] this is another attempt to split up match.pd +into multiple gimple-match and generic-match files. This version is fully +automated and requires no human intervention. + +First things first, some perf numbers. The following shows the effect of the +patch on my desktop doing parallel compilation of gimple-match: + ++--------+------------------+--------+------------------+ +| splits | rel. improvement | splits | rel. improvement | ++--------+------------------+--------+------------------+ +| 1 | 0.00% | 33 | 91.03% | +| 2 | 71.77% | 34 | 84.02% | +| 3 | 100.71% | 35 | 83.42% | +| 4 | 143.08% | 36 | 78.80% | +| 5 | 176.18% | 37 | 74.06% | +| 6 | 174.40% | 38 | 55.76% | +| 7 | 176.62% | 39 | 66.90% | +| 8 | 168.35% | 40 | 18.25% | +| 9 | 189.80% | 41 | 16.55% | +| 10 | 171.77% | 42 | 47.02% | +| 11 | 152.82% | 43 | 15.29% | +| 12 | 112.20% | 44 | 21.63% | +| 13 | 158.57% | 45 | 41.53% | +| 14 | 158.57% | 46 | 21.98% | +| 15 | 152.07% | 47 | -42.74% | +| 16 | 151.70% | 48 | -32.62% | +| 17 | 131.52% | 49 | 11.81% | +| 18 | 133.11% | 50 | 34.07% | +| 19 | 137.33% | 51 | 2.71% | +| 20 | 103.83% | 52 | -22.23% | +| 21 | 132.47% | 53 | 32.30% | +| 22 | 116.52% | 54 | 21.45% | +| 23 | 112.73% | 55 | 40.02% | +| 24 | 111.94% | 56 | 42.83% | +| 25 | 112.73% | 57 | -9.98% | +| 26 | 104.07% | 58 | 18.01% | +| 27 | 113.27% | 59 | -4.91% | +| 28 | 96.77% | 60 | 22.94% | +| 29 | 93.42% | 61 | -3.73% | +| 30 | 87.67% | 62 | -27.43% | +| 31 | 89.54% | 63 | -1.05% | +| 32 | 84.42% | 64 | -5.44% | ++--------+------------------+--------+------------------+ + +As can be seen there seems to be a point of diminishing returns in doing splits. +This comes from the fact that these match files consume a sizeable amount of +headers. At a certain point the parsing overhead of the headers dominate and +you start losing in gains. + +As such from this I've made the default 10 splits per file to allow for some +room for growth in the future without needing changes to the split amount. +Since 5-10 show roughly the same gains it means we can afford to double the +file sizes before we need to up the split amount. This can be controlled +by the configure parameter --with-matchpd-partitions=. + +At 10 splits the sizes of the files are: + + 1.2M gimple-match-1.cc + 490K gimple-match-2.cc + 459K gimple-match-3.cc + 462K gimple-match-4.cc + 466K gimple-match-5.cc + 690K gimple-match-6.cc + 517K gimple-match-7.cc + 693K gimple-match-8.cc +1011K gimple-match-9.cc + 490K gimple-match-10.cc + 210K gimple-match-auto.h + +The reason gimple-match-1.cc is so large is because it got allocated a very +large function: gimple_simplify_NE_EXPR. + +Because of these sporadically large functions the allocation to a split happens +based on the amount of data already written to a split instead of just a simple +round robin allocation (though the patch supports that too.). This means that +once gimple_simplify_NE_EXPR is allocated to gimple-match-1.cc nothing uses it +again until the rest of the files catch up. + +To support this split a new header file *-match-auto.h is generated to allow +the individual files to compile separately. + +Lastly for the auto generated files I use pragmas to silence the unused +predicate warnings instead of the previous Makefile way because I couldn't find +a way to set them without knowing the number of split files beforehand. + +Finally with this change, bootstrap time has dropped 8 minutes on AArch64. + +[1] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-04/msg01125.html + +gcc/ChangeLog: + + PR bootstrap/84402 + * genmatch.cc (emit_func, SIZED_BASED_CHUNKS, get_out_file): New. + (decision_tree::gen): Accept list of files instead of single and update + to write function definition to header and main file. + (write_predicate): Likewise. + (write_header): Emit pragmas and new includes. + (main): Create file buffers and cleanup. + (showUsage, write_header_includes): New. + +(cherry picked from commit 703417a030b3d80f55ba1402adc3f1692d3631e5) +--- + gcc/genmatch.cc | 226 ++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 190 insertions(+), 36 deletions(-) + +diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc +index 665d7e2106ff..f80e4b972288 100644 +--- a/gcc/genmatch.cc ++++ b/gcc/genmatch.cc +@@ -183,6 +183,33 @@ fprintf_indent (FILE *f, unsigned int indent, const char *format, ...) + va_end (ap); + } + ++/* Like fprintf, but print to two files, one header one C implementation. */ ++FILE *header_file = NULL; ++ ++static void ++#if GCC_VERSION >= 4001 ++__attribute__((format (printf, 4, 5))) ++#endif ++emit_func (FILE *f, bool open, bool close, const char *format, ...) ++{ ++ va_list ap1, ap2; ++ if (header_file != NULL) ++ { ++ if (open) ++ fprintf (header_file, "extern "); ++ va_start (ap2, format); ++ vfprintf (header_file, format, ap2); ++ va_end (ap2); ++ if (close) ++ fprintf (header_file, ";\n"); ++ } ++ ++ va_start (ap1, format); ++ vfprintf (f, format, ap1); ++ va_end (ap1); ++ fputc ('\n', f); ++} ++ + static void + output_line_directive (FILE *f, location_t location, + bool dumpfile = false, bool fnargs = false) +@@ -217,6 +244,37 @@ output_line_directive (FILE *f, location_t location, + fprintf (f, "/* #line %d \"%s\" */\n", loc.line, loc.file); + } + ++/* Find the file to write into next. We try to evenly distribute the contents ++ over the different files. */ ++ ++#define SIZED_BASED_CHUNKS 1 ++ ++int current_file = 0; ++FILE *get_out_file (vec <FILE *> &parts) ++{ ++#ifdef SIZED_BASED_CHUNKS ++ if (parts.length () == 1) ++ return parts[0]; ++ ++ FILE *f = NULL; ++ long min = 0; ++ /* We've started writing all the files at pos 0, so ftell is equivalent ++ to the size and should be much faster. */ ++ for (unsigned i = 0; i < parts.length (); i++) ++ { ++ long res = ftell (parts[i]); ++ if (!f || res < min) ++ { ++ min = res; ++ f = parts[i]; ++ } ++ } ++ return f; ++#else ++ return parts[current_file++ % parts.length ()]; ++#endif ++} ++ + + /* Pull in tree codes and builtin function codes from their + definition files. */ +@@ -1732,7 +1790,7 @@ public: + dt_node *root; + + void insert (class simplify *, unsigned); +- void gen (FILE *f, bool gimple); ++ void gen (vec <FILE *> &f, bool gimple); + void print (FILE *f = stderr); + + decision_tree () { root = new dt_node (dt_node::DT_NODE, NULL); } +@@ -3832,7 +3890,7 @@ sinfo_hashmap_traits::equal_keys (const key_type &v, + tree. */ + + void +-decision_tree::gen (FILE *f, bool gimple) ++decision_tree::gen (vec <FILE *> &files, bool gimple) + { + sinfo_map_t si; + +@@ -3861,11 +3919,14 @@ decision_tree::gen (FILE *f, bool gimple) + output_line_directive (stderr, s->s->s->result->location); + } + ++ /* Cycle the file buffers. */ ++ FILE *f = get_out_file (files); ++ + /* Generate a split out function with the leaf transform code. */ + s->fname = xasprintf ("%s_simplify_%u", gimple ? "gimple" : "generic", + fcnt++); + if (gimple) +- fprintf (f, "\nstatic bool\n" ++ emit_func (f, true, false, "\nbool\n" + "%s (gimple_match_op *res_op, gimple_seq *seq,\n" + " tree (*valueize)(tree) ATTRIBUTE_UNUSED,\n" + " const tree ARG_UNUSED (type), tree *ARG_UNUSED " +@@ -3873,27 +3934,28 @@ decision_tree::gen (FILE *f, bool gimple) + s->fname); + else + { +- fprintf (f, "\nstatic tree\n" ++ emit_func (f, true, false, "\ntree\n" + "%s (location_t ARG_UNUSED (loc), const tree ARG_UNUSED (type),\n", + (*iter).second->fname); + for (unsigned i = 0; + i < as_a <expr *>(s->s->s->match)->ops.length (); ++i) +- fprintf (f, " tree ARG_UNUSED (_p%d),", i); +- fprintf (f, " tree *captures\n"); ++ emit_func (f, false, false, " tree ARG_UNUSED (_p%d),", i); ++ emit_func (f, false, false, " tree *captures\n"); + } + for (unsigned i = 0; i < s->s->s->for_subst_vec.length (); ++i) + { + if (! s->s->s->for_subst_vec[i].first->used) + continue; + if (is_a <operator_id *> (s->s->s->for_subst_vec[i].second)) +- fprintf (f, ", const enum tree_code ARG_UNUSED (%s)", ++ emit_func (f, false, false, ", const enum tree_code ARG_UNUSED (%s)", + s->s->s->for_subst_vec[i].first->id); + else if (is_a <fn_id *> (s->s->s->for_subst_vec[i].second)) +- fprintf (f, ", const combined_fn ARG_UNUSED (%s)", ++ emit_func (f, false, false, ", const combined_fn ARG_UNUSED (%s)", + s->s->s->for_subst_vec[i].first->id); + } + +- fprintf (f, ")\n{\n"); ++ emit_func (f, false, true, ")"); ++ fprintf (f, "{\n"); + fprintf_indent (f, 2, "const bool debug_dump = " + "dump_file && (dump_flags & TDF_FOLDING);\n"); + s->s->gen_1 (f, 2, gimple, s->s->s->result); +@@ -3923,8 +3985,12 @@ decision_tree::gen (FILE *f, bool gimple) + && e->operation->kind != id_base::CODE)) + continue; + ++ ++ /* Cycle the file buffers. */ ++ FILE *f = get_out_file (files); ++ + if (gimple) +- fprintf (f, "\nstatic bool\n" ++ emit_func (f, true, false,"\nbool\n" + "gimple_simplify_%s (gimple_match_op *res_op," + " gimple_seq *seq,\n" + " tree (*valueize)(tree) " +@@ -3933,13 +3999,13 @@ decision_tree::gen (FILE *f, bool gimple) + "ARG_UNUSED (type)\n", + e->operation->id); + else +- fprintf (f, "\nstatic tree\n" ++ emit_func (f, true, false, "\ntree\n" + "generic_simplify_%s (location_t ARG_UNUSED (loc), enum " + "tree_code ARG_UNUSED (code), const tree ARG_UNUSED (type)", + e->operation->id); + for (unsigned i = 0; i < n; ++i) +- fprintf (f, ", tree _p%d", i); +- fprintf (f, ")\n"); ++ emit_func (f, false, false,", tree _p%d", i); ++ emit_func (f, false, true, ")"); + fprintf (f, "{\n"); + fprintf_indent (f, 2, "const bool debug_dump = " + "dump_file && (dump_flags & TDF_FOLDING);\n"); +@@ -3956,18 +4022,22 @@ decision_tree::gen (FILE *f, bool gimple) + with compiler warnings, by generating a simple stub. */ + if (! has_kids_p) + { ++ ++ /* Cycle the file buffers. */ ++ FILE *f = get_out_file (files); ++ + if (gimple) +- fprintf (f, "\nbool\n" ++ emit_func (f, true, false, "\nbool\n" + "gimple_simplify (gimple_match_op*, gimple_seq*,\n" + " tree (*)(tree), code_helper,\n" + " const tree"); + else +- fprintf (f, "\ntree\n" ++ emit_func (f, true, false,"\ntree\n" + "generic_simplify (location_t, enum tree_code,\n" + " const tree"); + for (unsigned i = 0; i < n; ++i) +- fprintf (f, ", tree"); +- fprintf (f, ")\n"); ++ emit_func (f, false, false, ", tree"); ++ emit_func (f, false, true, ")"); + fprintf (f, "{\n"); + if (gimple) + fprintf (f, " return false;\n"); +@@ -3977,20 +4047,24 @@ decision_tree::gen (FILE *f, bool gimple) + continue; + } + ++ ++ /* Cycle the file buffers. */ ++ FILE *f = get_out_file (files); ++ + /* Then generate the main entry with the outermost switch and + tail-calls to the split-out functions. */ + if (gimple) +- fprintf (f, "\nbool\n" ++ emit_func (f, true, false, "\nbool\n" + "gimple_simplify (gimple_match_op *res_op, gimple_seq *seq,\n" + " tree (*valueize)(tree) ATTRIBUTE_UNUSED,\n" + " code_helper code, const tree type"); + else +- fprintf (f, "\ntree\n" ++ emit_func (f, true, false, "\ntree\n" + "generic_simplify (location_t loc, enum tree_code code, " + "const tree type ATTRIBUTE_UNUSED"); + for (unsigned i = 0; i < n; ++i) +- fprintf (f, ", tree _p%d", i); +- fprintf (f, ")\n"); ++ emit_func (f, false, false, ", tree _p%d", i); ++ emit_func (f, false, true, ")"); + fprintf (f, "{\n"); + + if (gimple) +@@ -4045,11 +4119,11 @@ decision_tree::gen (FILE *f, bool gimple) + void + write_predicate (FILE *f, predicate_id *p, decision_tree &dt, bool gimple) + { +- fprintf (f, "\nbool\n" +- "%s%s (tree t%s%s)\n" +- "{\n", gimple ? "gimple_" : "tree_", p->id, +- p->nargs > 0 ? ", tree *res_ops" : "", +- gimple ? ", tree (*valueize)(tree) ATTRIBUTE_UNUSED" : ""); ++ emit_func (f, true, true, "\nbool\n%s%s (tree t%s%s)", ++ gimple ? "gimple_" : "tree_", p->id, ++ p->nargs > 0 ? ", tree *res_ops" : "", ++ gimple ? ", tree (*valueize)(tree) ATTRIBUTE_UNUSED" : ""); ++ fprintf (f, "{\n"); + /* Conveniently make 'type' available. */ + fprintf_indent (f, 2, "const tree type = TREE_TYPE (t);\n"); + fprintf_indent (f, 2, "const bool debug_dump = " +@@ -4070,9 +4144,13 @@ write_header (FILE *f, const char *head) + { + fprintf (f, "/* Generated automatically by the program `genmatch' from\n"); + fprintf (f, " a IL pattern matching and simplification description. */\n"); ++ fprintf (f, "#pragma GCC diagnostic push\n"); ++ fprintf (f, "#pragma GCC diagnostic ignored \"-Wunused-variable\"\n"); ++ fprintf (f, "#pragma GCC diagnostic ignored \"-Wunused-function\"\n"); + + /* Include the header instead of writing it awkwardly quoted here. */ +- fprintf (f, "\n#include \"%s\"\n", head); ++ if (head) ++ fprintf (f, "\n#include \"%s\"\n", head); + } + + +@@ -5213,6 +5291,30 @@ round_alloc_size (size_t s) + } + + ++/* Construct and display the help menu. */ ++ ++static void ++showUsage () ++{ ++ fprintf (stderr, "Usage: genmatch [--gimple] [--generic] " ++ "[--header=<filename>] [--include=<filename>] [-v[v]] input " ++ "[<outputfile>...]\n"); ++ fprintf (stderr, "\nWhen more then one outputfile is specified --header " ++ "is required.\n"); ++} ++ ++/* Write out the correct include to the match-head fle containing the helper ++ files. */ ++ ++static void ++write_header_includes (bool gimple, FILE *header_file) ++{ ++ if (gimple) ++ fprintf (header_file, "#include \"gimple-match-head.cc\"\n"); ++ else ++ fprintf (header_file, "#include \"generic-match-head.cc\"\n"); ++} ++ + /* The genmatch generator program. It reads from a pattern description + and outputs GIMPLE or GENERIC IL matching and simplification routines. */ + +@@ -5227,25 +5329,44 @@ main (int argc, char **argv) + return 1; + + bool gimple = true; +- char *input = argv[argc-1]; +- for (int i = 1; i < argc - 1; ++i) ++ char *s_header_file = NULL; ++ char *s_include_file = NULL; ++ auto_vec <char *> files; ++ char *input = NULL; ++ int last_file = argc - 1; ++ for (int i = argc - 1; i >= 1; --i) + { + if (strcmp (argv[i], "--gimple") == 0) + gimple = true; + else if (strcmp (argv[i], "--generic") == 0) + gimple = false; ++ else if (strncmp (argv[i], "--header=", 9) == 0) ++ s_header_file = &argv[i][9]; ++ else if (strncmp (argv[i], "--include=", 10) == 0) ++ s_include_file = &argv[i][10]; + else if (strcmp (argv[i], "-v") == 0) + verbose = 1; + else if (strcmp (argv[i], "-vv") == 0) + verbose = 2; ++ else if (strncmp (argv[i], "--", 2) != 0 && last_file-- == i) ++ files.safe_push (argv[i]); + else + { +- fprintf (stderr, "Usage: genmatch " +- "[--gimple] [--generic] [-v[v]] input\n"); ++ showUsage (); + return 1; + } + } + ++ /* Validate if the combinations are valid. */ ++ if ((files.length () > 1 && !s_header_file) || files.is_empty ()) ++ showUsage (); ++ ++ if (!s_include_file) ++ s_include_file = s_header_file; ++ ++ /* Input file is the last in the reverse list. */ ++ input = files.pop (); ++ + line_table = XCNEW (class line_maps); + linemap_init (line_table, 0); + line_table->reallocator = xrealloc; +@@ -5292,10 +5413,28 @@ main (int argc, char **argv) + /* Parse ahead! */ + parser p (r, gimple); + +- if (gimple) +- write_header (stdout, "gimple-match-head.cc"); ++ /* Create file buffers. */ ++ int n_parts = files.is_empty () ? 1 : files.length (); ++ auto_vec <FILE *> parts (n_parts); ++ if (files.is_empty ()) ++ { ++ parts.quick_push (stdout); ++ write_header (stdout, s_include_file); ++ write_header_includes (gimple, stdout); ++ } + else +- write_header (stdout, "generic-match-head.cc"); ++ { ++ for (char *s_file : files) ++ { ++ parts.quick_push (fopen (s_file, "w")); ++ write_header (parts.last (), s_include_file); ++ } ++ ++ header_file = fopen (s_header_file, "w"); ++ fprintf (header_file, "#ifndef GCC_GIMPLE_MATCH_AUTO_H\n" ++ "#define GCC_GIMPLE_MATCH_AUTO_H\n"); ++ write_header_includes (gimple, header_file); ++ } + + /* Go over all predicates defined with patterns and perform + lowering and code generation. */ +@@ -5315,7 +5454,10 @@ main (int argc, char **argv) + if (verbose == 2) + dt.print (stderr); + +- write_predicate (stdout, pred, dt, gimple); ++ /* Cycle the file buffers. */ ++ FILE *f = get_out_file (parts); ++ ++ write_predicate (f, pred, dt, gimple); + } + + /* Lower the main simplifiers and generate code for them. */ +@@ -5332,7 +5474,19 @@ main (int argc, char **argv) + if (verbose == 2) + dt.print (stderr); + +- dt.gen (stdout, gimple); ++ dt.gen (parts, gimple); ++ ++ for (FILE *f : parts) ++ { ++ fprintf (f, "#pragma GCC diagnostic pop\n"); ++ fclose (f); ++ } ++ ++ if (header_file) ++ { ++ fprintf (header_file, "#endif /* GCC_GIMPLE_MATCH_AUTO_H. */\n"); ++ fclose (header_file); ++ } + + /* Finalize. */ + cpp_finish (r, NULL); +-- +2.44.0 + +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21 + +From dcfebe060ee266f364bb60f1cdf0cec58818c4f7 Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Fri, 5 May 2023 13:42:17 +0100 +Subject: [PATCH 06/15] match.pd: Use splits in makefile and make configurable. + +This updates the build system to split up match.pd files into chunks of 10. +This also introduces a new flag --with-matchpd-partitions which can be used to +change the number of partitions. + +For the analysis of why 10 please look at the previous patch in the series. + +gcc/ChangeLog: + + PR bootstrap/84402 + * Makefile.in (NUM_MATCH_SPLITS, MATCH_SPLITS_SEQ, + GIMPLE_MATCH_PD_SEQ_SRC, GIMPLE_MATCH_PD_SEQ_O, + GENERIC_MATCH_PD_SEQ_SRC, GENERIC_MATCH_PD_SEQ_O): New. + (OBJS, MOSTLYCLEANFILES, .PRECIOUS): Use them. + (s-match): Split into s-generic-match and s-gimple-match. + * configure.ac (with-matchpd-partitions, + DEFAULT_MATCHPD_PARTITIONS): New. + * configure: Regenerate. + +(cherry picked from commit 0a85544e1aaeca41133ecfc438cda913dbc0f122) +--- + gcc/Makefile.in | 67 +++++++++++++++++++++++++++++++++--------------- + gcc/config.in | 6 +++++ + gcc/configure | 29 +++++++++++++++++++-- + gcc/configure.ac | 15 +++++++++++ + 4 files changed, 95 insertions(+), 22 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 406856acde1c..f0c34d00ecbc 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -214,6 +214,14 @@ rtl-ssa-warn = $(STRICT_WARN) + GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn) + GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) + ++# The number of splits to be made for the match.pd files. ++NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@ ++MATCH_SPLITS_SEQ = $(shell seq 1 $(NUM_MATCH_SPLITS)) ++GIMPLE_MATCH_PD_SEQ_SRC = $(patsubst %, gimple-match-%.cc, $(MATCH_SPLITS_SEQ)) ++GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-match-%.o, $(MATCH_SPLITS_SEQ)) ++GENERIC_MATCH_PD_SEQ_SRC = $(patsubst %, generic-match-%.cc, $(MATCH_SPLITS_SEQ)) ++GENERIC_MATCH_PD_SEQ_O = $(patsubst %, generic-match-%.o, $(MATCH_SPLITS_SEQ)) ++ + # These files are to have specific diagnostics suppressed, or are not to + # be subject to -Werror: + # flex output may yield harmless "no previous prototype" warnings +@@ -222,9 +230,8 @@ gengtype-lex.o-warn = -Wno-error + libgcov-util.o-warn = -Wno-error + libgcov-driver-tool.o-warn = -Wno-error + libgcov-merge-tool.o-warn = -Wno-error +-gimple-match.o-warn = -Wno-unused ++gimple-match-head.o-warn = -Wno-unused + gimple-match-exports.o-warn = -Wno-unused +-generic-match.o-warn = -Wno-unused + dfp.o-warn = -Wno-strict-aliasing + + # All warnings have to be shut off in stage1 if the compiler used then +@@ -1312,9 +1319,9 @@ ANALYZER_OBJS = \ + # will build them sooner, because they are large and otherwise tend to be + # the last objects to finish building. + OBJS = \ +- gimple-match.o \ ++ $(GIMPLE_MATCH_PD_SEQ_O) \ + gimple-match-exports.o \ +- generic-match.o \ ++ $(GENERIC_MATCH_PD_SEQ_O) \ + insn-attrtab.o \ + insn-automata.o \ + insn-dfatab.o \ +@@ -1807,7 +1814,8 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ + insn-output.cc insn-recog.cc insn-emit.cc insn-extract.cc insn-peep.cc \ + insn-attr.h insn-attr-common.h insn-attrtab.cc insn-dfatab.cc \ + insn-latencytab.cc insn-opinit.cc insn-opinit.h insn-preds.cc insn-constants.h \ +- tm-preds.h tm-constrs.h checksum-options gimple-match.cc generic-match.cc \ ++ tm-preds.h tm-constrs.h checksum-options $(GIMPLE_MATCH_PD_SEQ_SRC) \ ++ $(GENERIC_MATCH_PD_SEQ_SRC) gimple-match-auto.h generic-match-auto.h \ + tree-check.h min-insn-modes.cc insn-modes.cc insn-modes.h insn-modes-inline.h \ + genrtl.h gt-*.h gtype-*.h gtype-desc.cc gtyp-input.list \ + case-cfn-macros.h cfn-operators.pd \ +@@ -2422,7 +2430,8 @@ $(common_out_object_file): $(common_out_file) + .PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \ + insn-emit.cc insn-recog.cc insn-extract.cc insn-output.cc insn-peep.cc \ + insn-attr.h insn-attr-common.h insn-attrtab.cc insn-dfatab.cc \ +- insn-latencytab.cc insn-preds.cc gimple-match.cc generic-match.cc \ ++ insn-latencytab.cc insn-preds.cc $(GIMPLE_MATCH_PD_SEQ_SRC) \ ++ $(GENERIC_MATCH_PD_SEQ_SRC) gimple-match-auto.h generic-match-auto.h \ + insn-target-def.h + + # Dependencies for the md file. The first time through, we just assume +@@ -2665,19 +2674,36 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in + false; \ + fi + +-gimple-match.cc: s-match gimple-match-head.cc gimple-match-exports.cc ; @true +-generic-match.cc: s-match generic-match-head.cc ; @true +- +-s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd +- $(RUN_GEN) build/genmatch$(build_exeext) --gimple $(srcdir)/match.pd \ +- > tmp-gimple-match.cc +- $(RUN_GEN) build/genmatch$(build_exeext) --generic $(srcdir)/match.pd \ +- > tmp-generic-match.cc +- $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match.cc \ +- gimple-match.cc +- $(SHELL) $(srcdir)/../move-if-change tmp-generic-match.cc \ +- generic-match.cc +- $(STAMP) s-match ++$(GIMPLE_MATCH_PD_SEQ_SRC): s-gimple-match gimple-match-head.cc \ ++ gimple-match-exports.cc; @true ++gimple-match-auto.h: s-gimple-match gimple-match-head.cc \ ++ gimple-match-exports.cc; @true ++$(GENERIC_MATCH_PD_SEQ_SRC): s-generic-match generic-match-head.cc; @true ++generic-match-auto.h: s-generic-match generic-match-head.cc; @true ++ ++s-gimple-match: build/genmatch$(build_exeext) \ ++ $(srcdir)/match.pd cfn-operators.pd ++ $(RUN_GEN) build/genmatch$(build_exeext) --gimple \ ++ --header=tmp-gimple-match-auto.h --include=gimple-match-auto.h \ ++ $(srcdir)/match.pd $(patsubst %, tmp-%, $(GIMPLE_MATCH_PD_SEQ_SRC)) ++ $(foreach id, $(MATCH_SPLITS_SEQ), \ ++ $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match-$(id).cc \ ++ gimple-match-$(id).cc;) ++ $(SHELL) $(srcdir)/../move-if-change tmp-gimple-match-auto.h \ ++ gimple-match-auto.h ++ $(STAMP) s-gimple-match ++ ++s-generic-match: build/genmatch$(build_exeext) \ ++ $(srcdir)/match.pd cfn-operators.pd ++ $(RUN_GEN) build/genmatch$(build_exeext) --generic \ ++ --header=tmp-generic-match-auto.h --include=generic-match-auto.h \ ++ $(srcdir)/match.pd $(patsubst %, tmp-%, $(GENERIC_MATCH_PD_SEQ_SRC)) ++ $(foreach id, $(MATCH_SPLITS_SEQ), \ ++ $(SHELL) $(srcdir)/../move-if-change tmp-generic-match-$(id).cc \ ++ generic-match-$(id).cc;) ++ $(SHELL) $(srcdir)/../move-if-change tmp-generic-match-auto.h \ ++ generic-match-auto.h ++ $(STAMP) s-generic-match + + GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \ + $(host_xm_file_list) \ +@@ -2812,7 +2838,8 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_D_H) $(TM_H) multilib.h \ + $(ALL_GTFILES_H) gtype-desc.cc gtype-desc.h version.h \ + options.h target-hooks-def.h insn-opinit.h \ + common/common-target-hooks-def.h pass-instances.def \ +- gimple-match.cc generic-match.cc \ ++ $(GIMPLE_MATCH_PD_SEQ_SRC) $(GENERIC_MATCH_PD_SEQ_SRC) \ ++ gimple-match-auto.h generic-match-auto.h \ + c-family/c-target-hooks-def.h d/d-target-hooks-def.h \ + case-cfn-macros.h \ + cfn-operators.pd omp-device-properties.h +diff --git a/gcc/config.in b/gcc/config.in +index 5281a12a707c..ea60c5b11fc5 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -67,6 +67,12 @@ + #endif + + ++/* Define to larger than one set the number of match.pd partitions to make. */ ++#ifndef USED_FOR_TARGET ++#undef DEFAULT_MATCHPD_PARTITIONS ++#endif ++ ++ + /* Define to larger than zero set the default stack clash protector size. */ + #ifndef USED_FOR_TARGET + #undef DEFAULT_STK_CLASH_GUARD_SIZE +diff --git a/gcc/configure b/gcc/configure +index ade0af23e8cc..542d100c2b73 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -838,6 +838,7 @@ enable_gcov + enable_shared + enable_fixed_point + enable_decimal_float ++DEFAULT_MATCHPD_PARTITIONS + with_float + with_cpu + enable_multiarch +@@ -965,6 +966,7 @@ enable_valgrind_annotations + enable_multilib + enable_multiarch + with_stack_clash_protection_guard_size ++with_matchpd_partitions + enable___cxa_atexit + enable_decimal_float + enable_fixed_point +@@ -1832,6 +1834,9 @@ Optional Packages: + --with-stack-clash-protection-guard-size=size + Set the default stack clash protection guard size + for specific targets as a power of two in bytes. ++ --with-matchpd-partitions=num ++ Set the number of partitions to make for gimple and ++ generic when splitting match.pd. [default=10] + --with-dwarf2 force the default debug format to be DWARF 2 (or + later) + --with-specs=SPECS add SPECS to driver command-line processing +@@ -7918,6 +7923,26 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + + ++# Specify the number of splits of match.pd to generate. ++ ++# Check whether --with-matchpd-partitions was given. ++if test "${with_matchpd_partitions+set}" = set; then : ++ withval=$with_matchpd_partitions; DEFAULT_MATCHPD_PARTITIONS="$with_matchpd_partitions" ++else ++ DEFAULT_MATCHPD_PARTITIONS=10 ++fi ++ ++if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then ++ as_fn_error $? "Invalid value $DEFAULT_MATCHPD_PARTITIONS for --with-matchpd-partitions. Cannot be negative." "$LINENO" 5 ++fi ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define DEFAULT_MATCHPD_PARTITIONS $DEFAULT_MATCHPD_PARTITIONS ++_ACEOF ++ ++ ++ + # Enable __cxa_atexit for C++. + # Check whether --enable-__cxa_atexit was given. + if test "${enable___cxa_atexit+set}" = set; then : +@@ -19871,7 +19896,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 19874 "configure" ++#line 19899 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -19977,7 +20002,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 19980 "configure" ++#line 20005 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/gcc/configure.ac b/gcc/configure.ac +index bf8ff4d63906..31aa8566a3e7 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -943,6 +943,21 @@ fi + AC_DEFINE_UNQUOTED(DEFAULT_STK_CLASH_GUARD_SIZE, $DEFAULT_STK_CLASH_GUARD_SIZE, + [Define to larger than zero set the default stack clash protector size.]) + ++# Specify the number of splits of match.pd to generate. ++AC_ARG_WITH(matchpd-partitions, ++[AS_HELP_STRING([--with-matchpd-partitions=num], ++[Set the number of partitions to make for gimple and generic when splitting match.pd. [default=10]])], ++[DEFAULT_MATCHPD_PARTITIONS="$with_matchpd_partitions"], [DEFAULT_MATCHPD_PARTITIONS=10]) ++if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then ++ AC_MSG_ERROR(m4_normalize([ ++ Invalid value $DEFAULT_MATCHPD_PARTITIONS for --with-matchpd-partitions. \ ++ Cannot be negative.])) ++fi ++ ++AC_DEFINE_UNQUOTED(DEFAULT_MATCHPD_PARTITIONS, $DEFAULT_MATCHPD_PARTITIONS, ++ [Define to larger than one set the number of match.pd partitions to make.]) ++AC_SUBST(DEFAULT_MATCHPD_PARTITIONS) ++ + # Enable __cxa_atexit for C++. + AC_ARG_ENABLE(__cxa_atexit, + [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])], +-- +2.44.0 + +From 2c1f550db00c7dd9abede5644a3acd915767e0ad Mon Sep 17 00:00:00 2001 +From: Alexander Monakov <amonakov@ispras.ru> +Date: Fri, 5 May 2023 19:46:25 +0300 +Subject: [PATCH 07/15] Makefile.in: clean up match.pd-related dependencies + +Clean up confusing changes from the recent refactoring for +parallel match.pd build. + +gimple-match-head.o is not built. Remove related flags adjustment. + +Autogenerated gimple-match-N.o files do not depend on +gimple-match-exports.cc. + +{gimple,generic)-match-auto.h only depend on the prerequisites of the +corresponding s-{gimple,generic}-match stamp file, not any .cc file. + +gcc/ChangeLog: + + * Makefile.in: (gimple-match-head.o-warn): Remove. + (GIMPLE_MATCH_PD_SEQ_SRC): Do not depend on + gimple-match-exports.cc. + (gimple-match-auto.h): Only depend on s-gimple-match. + (generic-match-auto.h): Likewise. + +(cherry picked from commit 31c70a7daa368767f0f58e0389deb2c69d9e14fd) +--- + gcc/Makefile.in | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index f0c34d00ecbc..fe3af5c8008c 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -230,7 +230,6 @@ gengtype-lex.o-warn = -Wno-error + libgcov-util.o-warn = -Wno-error + libgcov-driver-tool.o-warn = -Wno-error + libgcov-merge-tool.o-warn = -Wno-error +-gimple-match-head.o-warn = -Wno-unused + gimple-match-exports.o-warn = -Wno-unused + dfp.o-warn = -Wno-strict-aliasing + +@@ -2674,12 +2673,10 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in + false; \ + fi + +-$(GIMPLE_MATCH_PD_SEQ_SRC): s-gimple-match gimple-match-head.cc \ +- gimple-match-exports.cc; @true +-gimple-match-auto.h: s-gimple-match gimple-match-head.cc \ +- gimple-match-exports.cc; @true ++$(GIMPLE_MATCH_PD_SEQ_SRC): s-gimple-match gimple-match-head.cc; @true ++gimple-match-auto.h: s-gimple-match; @true + $(GENERIC_MATCH_PD_SEQ_SRC): s-generic-match generic-match-head.cc; @true +-generic-match-auto.h: s-generic-match generic-match-head.cc; @true ++generic-match-auto.h: s-generic-match; @true + + s-gimple-match: build/genmatch$(build_exeext) \ + $(srcdir)/match.pd cfn-operators.pd +-- +2.44.0 + +https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=319aef8d2fde32be5cfed99f321c7f90e33d1f1d + +From a18a994030d16f58ebced231e778ec4e06a98abb Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek <jakub@redhat.com> +Date: Sat, 6 May 2023 02:32:17 +0200 +Subject: [PATCH 08/15] build: Replace seq for portability with GNU Make + variant + +Some hosts like AIX don't have seq command, this patch replaces it +with something that uses just GNU make features we've been using +for this already before for the parallel make check. + +2023-05-06 Jakub Jelinek <jakub@redhat.com> + + * Makefile.in (check_p_numbers): Rename to one_to_9999, move + earlier with helper variables also renamed. + (MATCH_SPLUT_SEQ): Use $(wordlist 1,$(NUM_MATCH_SPLITS),$(one_to_9999)) + instead of $(shell seq 1 $(NUM_MATCH_SPLITS)). + (check_p_subdirs): Use $(one_to_9999) instead of $(check_p_numbers). + +(cherry picked from commit 319aef8d2fde32be5cfed99f321c7f90e33d1f1d) +--- + gcc/Makefile.in | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index fe3af5c8008c..975fbb61ea8a 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -214,9 +214,19 @@ rtl-ssa-warn = $(STRICT_WARN) + GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn) + GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) + ++# 1 2 3 ... 9999 ++one_to_9999_0:=1 2 3 4 5 6 7 8 9 ++one_to_9999_1:=0 $(one_to_9999_0) ++one_to_9999_2:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_1))) ++one_to_9999_3:=$(addprefix 0,$(one_to_9999_1)) $(one_to_9999_2) ++one_to_9999_4:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_3))) ++one_to_9999_5:=$(addprefix 0,$(one_to_9999_3)) $(one_to_9999_4) ++one_to_9999_6:=$(foreach i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_5))) ++one_to_9999:=$(one_to_9999_0) $(one_to_9999_2) $(one_to_9999_4) $(one_to_9999_6) ++ + # The number of splits to be made for the match.pd files. + NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@ +-MATCH_SPLITS_SEQ = $(shell seq 1 $(NUM_MATCH_SPLITS)) ++MATCH_SPLITS_SEQ = $(wordlist 1,$(NUM_MATCH_SPLITS),$(one_to_9999)) + GIMPLE_MATCH_PD_SEQ_SRC = $(patsubst %, gimple-match-%.cc, $(MATCH_SPLITS_SEQ)) + GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-match-%.o, $(MATCH_SPLITS_SEQ)) + GENERIC_MATCH_PD_SEQ_SRC = $(patsubst %, generic-match-%.cc, $(MATCH_SPLITS_SEQ)) +@@ -4224,18 +4234,10 @@ $(patsubst %,%-subtargets,$(lang_checks)): check-%-subtargets: + check_p_tool=$(firstword $(subst _, ,$*)) + check_p_count=$(check_$(check_p_tool)_parallelize) + check_p_subno=$(word 2,$(subst _, ,$*)) +-check_p_numbers0:=1 2 3 4 5 6 7 8 9 +-check_p_numbers1:=0 $(check_p_numbers0) +-check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers1))) +-check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2) +-check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers3))) +-check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4) +-check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers5))) +-check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) $(check_p_numbers6) + check_p_subdir=$(subst _,,$*) + check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \ + $(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \ +- $(check_p_numbers))) ++ $(one_to_9999))) + + # For parallelized check-% targets, this decides whether parallelization + # is desirable (if -jN is used). If desirable, recursive make is run with +-- +2.44.0 + +https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bc45e18d433f879a02e369d027829f90f9e85724 + +From b60091fe7d22e0cac71461dceeb804e37555b5d3 Mon Sep 17 00:00:00 2001 +From: Tamar Christina <tamar.christina@arm.com> +Date: Mon, 12 Jun 2023 14:06:08 +0100 +Subject: [PATCH 09/15] Remove DEFAULT_MATCHPD_PARTITIONS macro + +As Jakub pointed out, DEFAULT_MATCHPD_PARTITIONS +is now unused and can be removed. + +gcc/ChangeLog: + + * config.in: Regenerate. + * configure: Regenerate. + * configure.ac: Remove DEFAULT_MATCHPD_PARTITIONS. + +(cherry picked from commit bc45e18d433f879a02e369d027829f90f9e85724) +--- + gcc/config.in | 6 ------ + gcc/configure | 9 ++------- + gcc/configure.ac | 2 -- + 3 files changed, 2 insertions(+), 15 deletions(-) + +diff --git a/gcc/config.in b/gcc/config.in +index ea60c5b11fc5..5281a12a707c 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -67,12 +67,6 @@ + #endif + + +-/* Define to larger than one set the number of match.pd partitions to make. */ +-#ifndef USED_FOR_TARGET +-#undef DEFAULT_MATCHPD_PARTITIONS +-#endif +- +- + /* Define to larger than zero set the default stack clash protector size. */ + #ifndef USED_FOR_TARGET + #undef DEFAULT_STK_CLASH_GUARD_SIZE +diff --git a/gcc/configure b/gcc/configure +index 542d100c2b73..cc8247037569 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -7937,11 +7937,6 @@ if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then + fi + + +-cat >>confdefs.h <<_ACEOF +-#define DEFAULT_MATCHPD_PARTITIONS $DEFAULT_MATCHPD_PARTITIONS +-_ACEOF +- +- + + # Enable __cxa_atexit for C++. + # Check whether --enable-__cxa_atexit was given. +@@ -19896,7 +19891,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 19899 "configure" ++#line 19894 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -20002,7 +19997,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 20005 "configure" ++#line 20000 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 31aa8566a3e7..d02ffc22a3a3 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -954,8 +954,6 @@ if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then + Cannot be negative.])) + fi + +-AC_DEFINE_UNQUOTED(DEFAULT_MATCHPD_PARTITIONS, $DEFAULT_MATCHPD_PARTITIONS, +- [Define to larger than one set the number of match.pd partitions to make.]) + AC_SUBST(DEFAULT_MATCHPD_PARTITIONS) + + # Enable __cxa_atexit for C++. +-- +2.44.0 + diff --git a/system/gcc/risc-san.patch b/system/gcc/risc-san.patch new file mode 100644 index 000000000..db4b14697 --- /dev/null +++ b/system/gcc/risc-san.patch @@ -0,0 +1,59 @@ +Ensure TSan works on PowerPC and RISC-V. + +Ported to GCC from compiler-rt. Original patch at: https://github.com/chimera-linux/cports/blob/0f5c5be86e/main/llvm/patches/0008-compiler-rt-lsan-basic-musl-fixes-on-various-archs.patch + +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp 2024-08-05 07:52:22.981401062 -0500 +@@ -29,6 +29,14 @@ + #include "sanitizer_procmaps.h" + #include "sanitizer_solaris.h" + ++#if defined(__powerpc__) ++#define DTP_OFFSET 0x8000 ++#elif SANITIZER_RISCV64 ++#define DTP_OFFSET 0x800 ++#else ++#define DTP_OFFSET 0 ++#endif ++ + #if SANITIZER_NETBSD + #define _RTLD_SOURCE // for __lwp_gettcb_fast() / __lwp_getprivate_fast() + #endif +@@ -289,6 +297,7 @@ + return val; + } + ++#if SANITIZER_GLIBC + uptr ThreadDescriptorSize() { + uptr val = atomic_load_relaxed(&thread_descriptor_size); + if (val) +@@ -303,6 +312,9 @@ + atomic_store_relaxed(&thread_descriptor_size, val); + return val; + } ++#else ++uptr ThreadDescriptorSize() { return 0; } ++#endif + + #if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 + // TlsPreTcbSize includes size of struct pthread_descr and size of tcb +@@ -392,6 +404,7 @@ + begin = (uptr)__tls_get_addr(mod_and_off); + #endif + } ++ begin -= DTP_OFFSET; + for (unsigned i = 0; i != info->dlpi_phnum; ++i) + if (info->dlpi_phdr[i].p_type == PT_TLS) { + static_cast<InternalMmapVector<TlsBlock> *>(data)->push_back( +@@ -542,9 +555,11 @@ + else if (SANITIZER_FREEBSD) + *size += 128; // RTLD_STATIC_TLS_EXTRA + #if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 ++# if SANITIZER_GLIBC + const uptr pre_tcb_size = TlsPreTcbSize(); + *addr -= pre_tcb_size; + *size += pre_tcb_size; ++# endif + #else + // arm and aarch64 reserve two words at TP, so this underestimates the range. + // However, this is sufficient for the purpose of finding the pointers to diff --git a/system/gcc/sanitation.patch b/system/gcc/sanitation.patch new file mode 100644 index 000000000..984b60498 --- /dev/null +++ b/system/gcc/sanitation.patch @@ -0,0 +1,184 @@ +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp 2024-07-24 15:56:06.119891718 -0500 +@@ -82,6 +82,10 @@ + # include <sys/sysmacros.h> + #endif + ++#if SANITIZER_LINUX && defined(__powerpc__) ++# include <asm/ptrace.h> ++#endif ++ + #if SANITIZER_FREEBSD + #include <sys/exec.h> + #include <sys/procctl.h> +@@ -277,7 +281,7 @@ + return res; + } + +-#if (!SANITIZER_LINUX_USES_64BIT_SYSCALLS || SANITIZER_SPARC) && SANITIZER_LINUX ++#if (!SANITIZER_LINUX_USES_64BIT_SYSCALLS || SANITIZER_SPARC) && SANITIZER_LINUX && defined(__glibc__) + static void stat64_to_stat(struct stat64 *in, struct stat *out) { + internal_memset(out, 0, sizeof(*out)); + out->st_dev = in->st_dev; +@@ -384,11 +388,8 @@ + return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, + 0); + # else +- struct stat64 buf64; +- int res = internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, +- (uptr)&buf64, 0); +- stat64_to_stat(&buf64, (struct stat *)buf); +- return res; ++ return internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, (uptr)buf, ++ 0); + # endif + # else + struct stat64 buf64; +@@ -416,11 +417,8 @@ + return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, + AT_SYMLINK_NOFOLLOW); + # else +- struct stat64 buf64; +- int res = internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, +- (uptr)&buf64, AT_SYMLINK_NOFOLLOW); +- stat64_to_stat(&buf64, (struct stat *)buf); +- return res; ++ return internal_syscall(SYSCALL(fstatat64), AT_FDCWD, (uptr)path, (uptr)buf, ++ AT_SYMLINK_NOFOLLOW); + # endif + # else + struct stat64 buf64; +@@ -448,10 +446,7 @@ + return internal_syscall(SYSCALL(fstat), fd, (uptr)buf); + # endif + #else +- struct stat64 buf64; +- int res = internal_syscall(SYSCALL(fstat64), fd, &buf64); +- stat64_to_stat(&buf64, (struct stat *)buf); +- return res; ++ return internal_syscall(SYSCALL(fstat64), fd, (uptr)buf); + #endif + } + +@@ -871,7 +866,9 @@ + #endif + + #if SANITIZER_LINUX +-#define SA_RESTORER 0x04000000 ++# ifndef SA_RESTORER ++# define SA_RESTORER 0x04000000 ++# endif + // Doesn't set sa_restorer if the caller did not set it, so use with caution + //(see below). + int internal_sigaction_norestorer(int signum, const void *act, void *oldact) { +@@ -1677,6 +1674,8 @@ + return res; + } + #elif defined(__arm__) ++#pragma GCC push_options ++#pragma GCC optimize("omit-frame-pointer") + uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, + int *parent_tidptr, void *newtls, int *child_tidptr) { + unsigned int res; +@@ -1742,6 +1741,7 @@ + : "memory"); + return res; + } ++#pragma GCC pop_options + #endif + #endif // SANITIZER_LINUX + +@@ -2173,11 +2173,20 @@ + *bp = ucontext->uc_mcontext.mc_frame[31]; + # else + ucontext_t *ucontext = (ucontext_t*)context; ++#ifdef __powerpc64__ + *pc = ucontext->uc_mcontext.regs->nip; + *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; ++#else ++ *pc = ucontext->uc_mcontext.gregs[PT_NIP]; ++ *sp = ucontext->uc_mcontext.gregs[PT_R1]; ++#endif + // The powerpc{,64}-linux ABIs do not specify r31 as the frame + // pointer, but GCC always uses r31 when we need a frame pointer. ++#ifdef __powerpc64__ + *bp = ucontext->uc_mcontext.regs->gpr[PT_R31]; ++#else ++ *bp = ucontext->uc_mcontext.gregs[PT_R31]; ++#endif + # endif + #elif defined(__sparc__) + #if defined(__arch64__) || defined(__sparcv9) +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp.old 2024-06-20 14:03:27.437916098 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 2024-07-09 03:28:44.101087267 -0500 +@@ -51,7 +51,7 @@ + #include <time.h> + #include <wchar.h> + #include <regex.h> +-#if !SANITIZER_APPLE ++#if HAVE_UTMP_H + #include <utmp.h> + #endif + +@@ -62,7 +62,6 @@ + #if !SANITIZER_ANDROID + #include <sys/mount.h> + #include <sys/timeb.h> +-#include <utmpx.h> + #endif + + #if SANITIZER_LINUX +@@ -94,7 +93,7 @@ + # include <utime.h> + # include <sys/ptrace.h> + # if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \ +- defined(__hexagon__) || SANITIZER_RISCV64 ++ defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64 + # include <asm/ptrace.h> + # ifdef __arm__ + typedef struct user_fpregs elf_fpregset_t; +@@ -313,11 +312,11 @@ + int shmctl_shm_stat = (int)SHM_STAT; + #endif + +-#if !SANITIZER_APPLE && !SANITIZER_FREEBSD ++#if HAVE_UTMP_H + unsigned struct_utmp_sz = sizeof(struct utmp); + #endif + #if !SANITIZER_ANDROID +- unsigned struct_utmpx_sz = sizeof(struct utmpx); ++ unsigned struct_utmpx_sz = 400; + #endif + + int map_fixed = MAP_FIXED; +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp 2024-06-20 16:23:27.115377319 -0500 +@@ -31,7 +31,7 @@ + #include <sys/types.h> // for pid_t + #include <sys/uio.h> // for iovec + #include <elf.h> // for NT_PRSTATUS +-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID ++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID + // GLIBC 2.20+ sys/user does not include asm/ptrace.h + # include <asm/ptrace.h> + #endif +--- gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_arm.inc.old 2024-05-21 02:47:42.000000000 -0500 ++++ gcc-13.3.0/libsanitizer/sanitizer_common/sanitizer_syscall_linux_arm.inc 2024-07-24 15:56:06.129890658 -0500 +@@ -12,6 +12,9 @@ + + #define SYSCALL(name) __NR_ ## name + ++#pragma GCC push_options ++#pragma GCC optimize("omit-frame-pointer") ++ + static uptr __internal_syscall(u32 nr) { + register u32 r8 asm("r7") = nr; + register u32 r0 asm("r0"); +@@ -115,6 +118,7 @@ + #define __internal_syscall6(n, a1, a2, a3, a4, a5, a6) \ + (__internal_syscall)(n, (u32)(a1), (long)(a2), (long)(a3), (long)(a4), \ + (u32)(a5), (long)(a6)) ++#pragma GCC pop_options + + #define __SYSCALL_NARGS_X(a1, a2, a3, a4, a5, a6, a7, a8, n, ...) n + #define __SYSCALL_NARGS(...) \ diff --git a/system/gdb/APKBUILD b/system/gdb/APKBUILD index ff0476266..b069c7d9a 100644 --- a/system/gdb/APKBUILD +++ b/system/gdb/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=gdb pkgver=12.1 -pkgrel=0 +pkgrel=1 pkgdesc="The GNU Debugger" url="https://www.sourceware.org/gdb/" arch="all" @@ -44,6 +44,7 @@ package() { # resolve conflict with binutils-doc rm -f "$pkgdir"/usr/share/info/bfd.info rm -f "$pkgdir"/usr/share/info/dir + rm -f "$pkgdir"/usr/share/info/ctf-spec.info # resolve conflict with binutils-lang rm -f "$pkgdir"/usr/share/locale/*/LC_MESSAGES/bfd.mo diff --git a/system/git/APKBUILD b/system/git/APKBUILD index cd84b9352..0562bfba2 100644 --- a/system/git/APKBUILD +++ b/system/git/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=git pkgver=2.40.0 -pkgrel=0 +pkgrel=1 pkgdesc="Distributed version control system" url="https://www.git-scm.com/" arch="all" @@ -30,6 +30,7 @@ source="https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar.xz git-daemon.confd disable-t2082-2.patch + perl-getopt-long.patch " _gitcoredir=/usr/libexec/git-core @@ -171,4 +172,5 @@ sha512sums="a2720f8f9a0258c0bb5e23badcfd68a147682e45a5d039a42c47128296c508109d50 4bcc8367478601c856e0977d46fc4842f62daf300093a576704ad27ccd9fae975f95d3fbfcb00e9fa7254b1db64cd074f49a94fb5cf0abd8d72d7edc9ab8798c dont-test-other-encodings.patch 89528cdd14c51fd568aa61cf6c5eae08ea0844e59f9af9292da5fc6c268261f4166017d002d494400945e248df6b844e2f9f9cd2d9345d516983f5a110e4c42a git-daemon.initd fbf1f425206a76e2a8f82342537ed939ff7e623d644c086ca2ced5f69b36734695f9f80ebda1728f75a94d6cd2fcb71bf845b64239368caab418e4d368c141ec git-daemon.confd -6d7cbb701584a078328056a67bfd32dde5795a80c0911734b38bd534699fb0165ac2b486b267c5c39b90bbb0d7c5ab0ab6ada1d068748865617326da28304eb4 disable-t2082-2.patch" +6d7cbb701584a078328056a67bfd32dde5795a80c0911734b38bd534699fb0165ac2b486b267c5c39b90bbb0d7c5ab0ab6ada1d068748865617326da28304eb4 disable-t2082-2.patch +9800318f9e6a8b6bfd8c700cce5cc326522a607b89236a868ef46940efe0566fdadf5d69dc3e72f989d61df66be8510b8989bd4ce3fc780f017f30652c7e9efa perl-getopt-long.patch" diff --git a/system/git/perl-getopt-long.patch b/system/git/perl-getopt-long.patch new file mode 100644 index 000000000..dd5776033 --- /dev/null +++ b/system/git/perl-getopt-long.patch @@ -0,0 +1,459 @@ +From 46edab516bf04c190cb2e100419dee817d3f33f6 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger <tmz@pobox.com> +Date: Wed, 15 Nov 2023 12:39:44 -0500 +Subject: [PATCH] send-email: remove stray characters from usage + +A few stray single quotes crept into the usage string in a2ce608244 +(send-email docs: add format-patch options, 2021-10-25). Remove them. + +Signed-off-by: Todd Zullinger <tmz@pobox.com> +Signed-off-by: Junio C Hamano <gitster@pobox.com> +--- + git-send-email.perl | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/git-send-email.perl b/git-send-email.perl +index 897cea6564fb50..85544a18bfe37e 100755 +--- a/git-send-email.perl ++++ b/git-send-email.perl +@@ -28,8 +28,8 @@ + + sub usage { + print <<EOT; +-git send-email' [<options>] <file|directory> +-git send-email' [<options>] <format-patch options> ++git send-email [<options>] <file|directory> ++git send-email [<options>] <format-patch options> + git send-email --dump-aliases + + Composing: +From d13a73e383076636534e10ba799af0c9a2b85357 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger <tmz@pobox.com> +Date: Thu, 16 Nov 2023 14:30:10 -0500 +Subject: [PATCH] perl: bump the required Perl version to 5.8.1 from 5.8.0 + +The following commit will make use of a Getopt::Long feature which is +only present in Perl >= 5.8.1. Document that as the minimum version we +support. + +Many of our Perl scripts will continue to run with 5.8.0 but this change +allows us to adjust them as needed without breaking any promises to our +users. + +The Perl requirement was last changed in d48b284183 (perl: bump the +required Perl version to 5.8 from 5.6.[21], 2010-09-24). At that time, +5.8.0 was 8 years old. It is now over 21 years old. + +Signed-off-by: Todd Zullinger <tmz@pobox.com> +Signed-off-by: Junio C Hamano <gitster@pobox.com> +--- + Documentation/CodingGuidelines | 2 +- + INSTALL | 2 +- + contrib/diff-highlight/DiffHighlight.pm | 2 +- + contrib/mw-to-git/Git/Mediawiki.pm | 2 +- + git-archimport.perl | 2 +- + git-cvsexportcommit.perl | 2 +- + git-cvsimport.perl | 2 +- + git-cvsserver.perl | 2 +- + git-send-email.perl | 4 ++-- + git-svn.perl | 2 +- + gitweb/INSTALL | 2 +- + gitweb/gitweb.perl | 2 +- + perl/Git.pm | 2 +- + perl/Git/I18N.pm | 2 +- + perl/Git/LoadCPAN.pm | 2 +- + perl/Git/LoadCPAN/Error.pm | 2 +- + perl/Git/LoadCPAN/Mail/Address.pm | 2 +- + perl/Git/Packet.pm | 2 +- + t/t0202/test.pl | 2 +- + t/t5562/invoke-with-content-length.pl | 2 +- + t/t9700/test.pl | 2 +- + t/test-terminal.perl | 2 +- + 22 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines +index 65af8d82cedd5f..aa0195d6ebab0b 100644 +--- a/Documentation/CodingGuidelines ++++ b/Documentation/CodingGuidelines +@@ -490,7 +490,7 @@ For Perl programs: + + - Most of the C guidelines above apply. + +- - We try to support Perl 5.8 and later ("use Perl 5.008"). ++ - We try to support Perl 5.8.1 and later ("use Perl 5.008001"). + + - use strict and use warnings are strongly preferred. + +diff --git a/INSTALL b/INSTALL +index 4b422888828d0e..06f29a8ae70022 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -119,7 +119,7 @@ Issues of note: + - A POSIX-compliant shell is required to run some scripts needed + for everyday use (e.g. "bisect", "request-pull"). + +- - "Perl" version 5.8 or later is needed to use some of the ++ - "Perl" version 5.8.1 or later is needed to use some of the + features (e.g. sending patches using "git send-email", + interacting with svn repositories with "git svn"). If you can + live without these, use NO_PERL. Note that recent releases of +diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm +index 376f577737591e..636add69680675 100644 +--- a/contrib/diff-highlight/DiffHighlight.pm ++++ b/contrib/diff-highlight/DiffHighlight.pm +@@ -1,6 +1,6 @@ + package DiffHighlight; + +-use 5.008; ++use 5.008001; + use warnings FATAL => 'all'; + use strict; + +diff --git a/contrib/mw-to-git/Git/Mediawiki.pm b/contrib/mw-to-git/Git/Mediawiki.pm +index 917d9e2d3222c1..ff7811225ee671 100644 +--- a/contrib/mw-to-git/Git/Mediawiki.pm ++++ b/contrib/mw-to-git/Git/Mediawiki.pm +@@ -1,6 +1,6 @@ + package Git::Mediawiki; + +-use 5.008; ++use 5.008001; + use strict; + use POSIX; + use Git; +diff --git a/git-archimport.perl b/git-archimport.perl +index b7c173c345544d..f5a317b89961ce 100755 +--- a/git-archimport.perl ++++ b/git-archimport.perl +@@ -54,7 +54,7 @@ =head1 Devel Notes + + =cut + +-use 5.008; ++use 5.008001; + use strict; + use warnings; + use Getopt::Std; +diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl +index 289d4bc684dc26..1e03ba94d1b271 100755 +--- a/git-cvsexportcommit.perl ++++ b/git-cvsexportcommit.perl +@@ -1,6 +1,6 @@ + #!/usr/bin/perl + +-use 5.008; ++use 5.008001; + use strict; + use warnings; + use Getopt::Std; +diff --git a/git-cvsimport.perl b/git-cvsimport.perl +index 7bf3c12d678974..07ea3443f7f336 100755 +--- a/git-cvsimport.perl ++++ b/git-cvsimport.perl +@@ -13,7 +13,7 @@ + # The head revision is on branch "origin" by default. + # You can change that with the '-o' option. + +-use 5.008; ++use 5.008001; + use strict; + use warnings; + use Getopt::Long; +diff --git a/git-cvsserver.perl b/git-cvsserver.perl +index 7b757360e28c01..124f598bdc0705 100755 +--- a/git-cvsserver.perl ++++ b/git-cvsserver.perl +@@ -15,7 +15,7 @@ + #### + #### + +-use 5.008; ++use 5.008001; + use strict; + use warnings; + use bytes; +diff --git a/git-send-email.perl b/git-send-email.perl +index 897cea6564fb50..041db702d46fcc 100755 +--- a/git-send-email.perl ++++ b/git-send-email.perl +@@ -16,7 +16,7 @@ + # and second line is the subject of the message. + # + +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + use Getopt::Long; +@@ -228,7 +228,7 @@ sub system_or_msg { + my @sprintf_args = ($cmd_name ? $cmd_name : $args->[0], $exit_code); + if (defined $msg) { + # Quiet the 'redundant' warning category, except we +- # need to support down to Perl 5.8, so we can't do a ++ # need to support down to Perl 5.8.1, so we can't do a + # "no warnings 'redundant'", since that category was + # introduced in perl 5.22, and asking for it will die + # on older perls. +diff --git a/git-svn.perl b/git-svn.perl +index be987e316f92ac..1d1c52f42468b1 100755 +--- a/git-svn.perl ++++ b/git-svn.perl +@@ -1,7 +1,7 @@ + #!/usr/bin/perl + # Copyright (C) 2006, Eric Wong <normalperson@yhbt.net> + # License: GPL v2 or later +-use 5.008; ++use 5.008001; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + use strict; + use vars qw/ $AUTHOR $VERSION +diff --git a/gitweb/INSTALL b/gitweb/INSTALL +index a58e6b3c44b0ef..dadc6efa81f035 100644 +--- a/gitweb/INSTALL ++++ b/gitweb/INSTALL +@@ -29,7 +29,7 @@ Requirements + ------------ + + - Core git tools +- - Perl 5.8 ++ - Perl 5.8.1 + - Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename. + - web server + +diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl +index e66eb3d9bad7cf..55e7c6567e6c47 100755 +--- a/gitweb/gitweb.perl ++++ b/gitweb/gitweb.perl +@@ -7,7 +7,7 @@ + # + # This program is licensed under the GPLv2 + +-use 5.008; ++use 5.008001; + use strict; + use warnings; + # handle ACL in file access tests +diff --git a/perl/Git.pm b/perl/Git.pm +index 117765dc73c4a8..03bf570bf4c852 100644 +--- a/perl/Git.pm ++++ b/perl/Git.pm +@@ -7,7 +7,7 @@ Git - Perl interface to the Git version control system + + package Git; + +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + +diff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm +index 895e759c57a9d9..5454c3a6d2c433 100644 +--- a/perl/Git/I18N.pm ++++ b/perl/Git/I18N.pm +@@ -1,5 +1,5 @@ + package Git::I18N; +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + BEGIN { +diff --git a/perl/Git/LoadCPAN.pm b/perl/Git/LoadCPAN.pm +index 0c360bc7998607..8c7fa805f97390 100644 +--- a/perl/Git/LoadCPAN.pm ++++ b/perl/Git/LoadCPAN.pm +@@ -1,5 +1,5 @@ + package Git::LoadCPAN; +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + +diff --git a/perl/Git/LoadCPAN/Error.pm b/perl/Git/LoadCPAN/Error.pm +index 5d84c202884b7c..5cecb0fcd6930a 100644 +--- a/perl/Git/LoadCPAN/Error.pm ++++ b/perl/Git/LoadCPAN/Error.pm +@@ -1,5 +1,5 @@ + package Git::LoadCPAN::Error; +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + use Git::LoadCPAN ( +diff --git a/perl/Git/LoadCPAN/Mail/Address.pm b/perl/Git/LoadCPAN/Mail/Address.pm +index 340e88a7a56be3..9f808090a66a16 100644 +--- a/perl/Git/LoadCPAN/Mail/Address.pm ++++ b/perl/Git/LoadCPAN/Mail/Address.pm +@@ -1,5 +1,5 @@ + package Git::LoadCPAN::Mail::Address; +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + use Git::LoadCPAN ( +diff --git a/perl/Git/Packet.pm b/perl/Git/Packet.pm +index d144f5168f37ad..d896e6952399b0 100644 +--- a/perl/Git/Packet.pm ++++ b/perl/Git/Packet.pm +@@ -1,5 +1,5 @@ + package Git::Packet; +-use 5.008; ++use 5.008001; + use strict; + use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : (); + BEGIN { +diff --git a/t/t0202/test.pl b/t/t0202/test.pl +index 2cbf7b95907384..47d96a2a13f93b 100755 +--- a/t/t0202/test.pl ++++ b/t/t0202/test.pl +@@ -1,5 +1,5 @@ + #!/usr/bin/perl +-use 5.008; ++use 5.008001; + use lib (split(/:/, $ENV{GITPERLLIB})); + use strict; + use warnings; +diff --git a/t/t5562/invoke-with-content-length.pl b/t/t5562/invoke-with-content-length.pl +index 718dd9b49d493e..9babb9a375e5fb 100644 +--- a/t/t5562/invoke-with-content-length.pl ++++ b/t/t5562/invoke-with-content-length.pl +@@ -1,4 +1,4 @@ +-use 5.008; ++use 5.008001; + use strict; + use warnings; + +diff --git a/t/t9700/test.pl b/t/t9700/test.pl +index 6d753708d2acb6..d8e85482ab2ba7 100755 +--- a/t/t9700/test.pl ++++ b/t/t9700/test.pl +@@ -1,7 +1,7 @@ + #!/usr/bin/perl + use lib (split(/:/, $ENV{GITPERLLIB})); + +-use 5.008; ++use 5.008001; + use warnings; + use strict; + +diff --git a/t/test-terminal.perl b/t/test-terminal.perl +index 1bcf01a9a42a61..3810e9bb431903 100755 +--- a/t/test-terminal.perl ++++ b/t/test-terminal.perl +@@ -1,5 +1,5 @@ + #!/usr/bin/perl +-use 5.008; ++use 5.008001; + use strict; + use warnings; + use IO::Pty; +From 6ff658cc78f36baa74c0f25314b0043a8f4b4fc6 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger <tmz@pobox.com> +Date: Thu, 16 Nov 2023 14:30:11 -0500 +Subject: [PATCH] send-email: avoid duplicate specification warnings + +A warning is issued for options which are specified more than once +beginning with perl-Getopt-Long >= 2.55. In addition to causing users +to see warnings, this results in test failures which compare the output. +An example, from t9001-send-email.37: + + | +++ diff -u expect actual + | --- expect 2023-11-14 10:38:23.854346488 +0000 + | +++ actual 2023-11-14 10:38:23.848346466 +0000 + | @@ -1,2 +1,7 @@ + | +Duplicate specification "no-chain-reply-to" for option "no-chain-reply-to" + | +Duplicate specification "to-cover|to-cover!" for option "to-cover" + | +Duplicate specification "cc-cover|cc-cover!" for option "cc-cover" + | +Duplicate specification "no-thread" for option "no-thread" + | +Duplicate specification "no-to-cover" for option "no-to-cover" + | fatal: longline.patch:35 is longer than 998 characters + | warning: no patches were sent + | error: last command exited with $?=1 + | not ok 37 - reject long lines + +Remove the duplicate option specs. These are primarily the explicit +'--no-' prefix opts which were added in f471494303 (git-send-email.perl: +support no- prefix with older GetOptions, 2015-01-30). This was done +specifically to support perl-5.8.0 which includes Getopt::Long 2.32[1]. + +Getopt::Long 2.33 added support for the '--no-' prefix natively by +appending '!' to the option specification string, which was included in +perl-5.8.1 and is not present in perl-5.8.0. The previous commit bumped +the minimum supported Perl version to 5.8.1 so we no longer need to +provide the '--no-' variants for negatable options manually. + +Teach `--git-completion-helper` to output the '--no-' options. They are +not included in the options hash and would otherwise be lost. + +Signed-off-by: Todd Zullinger <tmz@pobox.com> +Signed-off-by: Junio C Hamano <gitster@pobox.com> +--- + git-send-email.perl | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/git-send-email.perl b/git-send-email.perl +index 041db702d46fcc..60afafb375d8f4 100755 +--- a/git-send-email.perl ++++ b/git-send-email.perl +@@ -119,13 +119,16 @@ sub completion_helper { + + foreach my $key (keys %$original_opts) { + unless (exists $not_for_completion{$key}) { +- $key =~ s/!$//; ++ my $negatable = ($key =~ s/!$//); + + if ($key =~ /[:=][si]$/) { + $key =~ s/[:=][si]$//; + push (@send_email_opts, "--$_=") foreach (split (/\|/, $key)); + } else { + push (@send_email_opts, "--$_") foreach (split (/\|/, $key)); ++ if ($negatable) { ++ push (@send_email_opts, "--no-$_") foreach (split (/\|/, $key)); ++ } + } + } + } +@@ -491,7 +494,6 @@ sub config_regexp { + "bcc=s" => \@getopt_bcc, + "no-bcc" => \$no_bcc, + "chain-reply-to!" => \$chain_reply_to, +- "no-chain-reply-to" => sub {$chain_reply_to = 0}, + "sendmail-cmd=s" => \$sendmail_cmd, + "smtp-server=s" => \$smtp_server, + "smtp-server-option=s" => \@smtp_server_options, +@@ -506,34 +508,25 @@ sub config_regexp { + "smtp-auth=s" => \$smtp_auth, + "no-smtp-auth" => sub {$smtp_auth = 'none'}, + "annotate!" => \$annotate, +- "no-annotate" => sub {$annotate = 0}, + "compose" => \$compose, + "quiet" => \$quiet, + "cc-cmd=s" => \$cc_cmd, + "suppress-from!" => \$suppress_from, +- "no-suppress-from" => sub {$suppress_from = 0}, + "suppress-cc=s" => \@suppress_cc, + "signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc, +- "no-signed-off-cc|no-signed-off-by-cc" => sub {$signed_off_by_cc = 0}, +- "cc-cover|cc-cover!" => \$cover_cc, +- "no-cc-cover" => sub {$cover_cc = 0}, +- "to-cover|to-cover!" => \$cover_to, +- "no-to-cover" => sub {$cover_to = 0}, ++ "cc-cover!" => \$cover_cc, ++ "to-cover!" => \$cover_to, + "confirm=s" => \$confirm, + "dry-run" => \$dry_run, + "envelope-sender=s" => \$envelope_sender, + "thread!" => \$thread, +- "no-thread" => sub {$thread = 0}, + "validate!" => \$validate, +- "no-validate" => sub {$validate = 0}, + "transfer-encoding=s" => \$target_xfer_encoding, + "format-patch!" => \$format_patch, +- "no-format-patch" => sub {$format_patch = 0}, + "8bit-encoding=s" => \$auto_8bit_encoding, + "compose-encoding=s" => \$compose_encoding, + "force" => \$force, + "xmailer!" => \$use_xmailer, +- "no-xmailer" => sub {$use_xmailer = 0}, + "batch-size=i" => \$batch_size, + "relogin-delay=i" => \$relogin_delay, + "git-completion-helper" => \$git_completion_helper, diff --git a/system/heirloom-devtools/APKBUILD b/system/heirloom-devtools/APKBUILD index c6ca8892f..cbf0633d5 100644 --- a/system/heirloom-devtools/APKBUILD +++ b/system/heirloom-devtools/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=heirloom-devtools pkgver=070527 -pkgrel=1 +pkgrel=2 pkgdesc="Development tools compatible with UNIX" url="http://heirloom.sourceforge.net/devtools.html" arch="all" @@ -20,7 +20,7 @@ source="https://downloads.sourceforge.net/heirloom/heirloom-devtools/$pkgver/hei $pkgname-$pkgver-64-bit.patch" build() { - make -j1 CXXFLAGS="${CXXFLAGS} -DMAXNETNAMELEN=255" + make -j1 CXXFLAGS="${CXXFLAGS} -DMAXNETNAMELEN=255 -std=c++98" } package() { diff --git a/system/heirloom-pax/APKBUILD b/system/heirloom-pax/APKBUILD index 303af5ebb..ec9e444d4 100644 --- a/system/heirloom-pax/APKBUILD +++ b/system/heirloom-pax/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=heirloom-pax pkgver=1.0 -pkgrel=1 +pkgrel=2 pkgdesc="Portable Archive eXchange, the POSIX archival tool" url="http://heirloom.sourceforge.net/" arch="all" @@ -13,7 +13,9 @@ makedepends="bsd-compat-headers bzip2-dev zlib-dev" replaces="pax" subpackages="$pkgname-doc" source="https://distfiles.adelielinux.org/source/${pkgname}-$pkgver.tar.xz - sysmacros.patch" + sysmacros.patch + modern-c.patch + " build() { make LD="gcc" @@ -30,4 +32,5 @@ package() { } sha512sums="7b0ad20cc51b5bcec9c07e84c603e4891f636944f6f6bd13d3decb0e9d6b23d6164b663468ee2293b37721aae20334774f4e56fd8541ffceee934050e819b642 heirloom-pax-1.0.tar.xz -bcc12138ebed707e165a1ac5dac815acd85770974e19f62610e0fe32a96879fb1173fc4e7beafde12b7bc1ed03f2751b2839eeb3ccacbe209d8cbcfe0307eac3 sysmacros.patch" +bcc12138ebed707e165a1ac5dac815acd85770974e19f62610e0fe32a96879fb1173fc4e7beafde12b7bc1ed03f2751b2839eeb3ccacbe209d8cbcfe0307eac3 sysmacros.patch +e0e2756bf3f55862880eadf6c5852e1c2dc6cdc4a75451a4d917685ef3c7f955f23229eef1c778be32bc27a1253ceaf820225d3ea794cfc88fe702adccaf9ef7 modern-c.patch" diff --git a/system/heirloom-pax/modern-c.patch b/system/heirloom-pax/modern-c.patch new file mode 100644 index 000000000..8574d71dc --- /dev/null +++ b/system/heirloom-pax/modern-c.patch @@ -0,0 +1,71 @@ +GCC 10 and higher treat enums differently and the way that cpio(1)/pax(1) use +them is no longer supported. This is similar, but not identical, to the patch +used by Gentoo for sys-apps/heirloom-tools. + +This should be upstreamable, but sadly, there is no upstream any more. +--- heirloom-pax-1.0/cpio/cpio.c.old 2024-05-25 11:20:07.088299291 -0500 ++++ heirloom-pax-1.0/cpio/cpio.c 2024-05-25 11:25:21.674430528 -0500 +@@ -824,6 +824,9 @@ + static int compressed_bar; /* this is a compressed bar archive */ + static int formatforced; /* -k -i -Hfmt forces a format */ + static long long lineno; /* input line number */ ++enum fmttype fmttype; /* type of archive format */ ++enum pax pax; /* type of pax command this is */ ++enum pax_preserve pax_preserve; /* attributes to preserve */ + + int pax_dflag; /* directory matches only itself */ + int pax_kflag; /* do not overwrite files */ +--- heirloom-pax-1.0/cpio/cpio.h.old 2007-03-26 13:14:57.000000000 -0500 ++++ heirloom-pax-1.0/cpio/cpio.h 2024-05-25 11:23:54.143854185 -0500 +@@ -31,7 +31,7 @@ + #include <sys/stat.h> + #include <inttypes.h> + +-enum { ++enum fmttype { + FMT_NONE = 00000000, /* no format chosen yet */ + + TYP_PAX = 00000010, /* uses pax-like extended headers */ +@@ -70,7 +70,8 @@ + FMT_BAR = 00400001, /* bar format type */ + + FMT_ZIP = 01000000 /* zip format */ +-} fmttype; ++}; ++extern enum fmttype fmttype; + + /* + * Zip compression method. +@@ -173,11 +174,12 @@ + extern char *progname; + extern struct glist *patterns; + +-enum { /* type of pax command this is */ ++enum pax { /* type of pax command this is */ + PAX_TYPE_CPIO = 0, /* not a pax command */ + PAX_TYPE_PAX1992 = 1, /* POSIX.2 pax command */ + PAX_TYPE_PAX2001 = 2 /* POSIX.1-2001 pax command */ +-} pax; ++}; ++extern enum pax pax; + extern int pax_dflag; + extern int pax_kflag; + extern int pax_nflag; +@@ -185,14 +187,15 @@ + extern int pax_uflag; + extern int pax_Xflag; + +-enum { ++enum pax_preserve { + PAX_P_NONE = 0000, + PAX_P_ATIME = 0001, + PAX_P_MTIME = 0004, + PAX_P_OWNER = 0010, + PAX_P_MODE = 0020, + PAX_P_EVERY = 0400 +-} pax_preserve; ++}; ++extern enum pax_preserve pax_preserve; + + extern size_t (*ofiles)(char **, size_t *); + extern void (*prtime)(time_t); diff --git a/system/icu/APKBUILD b/system/icu/APKBUILD index a2b0af950..62b39f2e4 100644 --- a/system/icu/APKBUILD +++ b/system/icu/APKBUILD @@ -43,6 +43,9 @@ prepare() { } build() { + # GCC 13 changed default fp precision behavior. (#1193) + export CXXFLAGS="${CXXFLAGS} -fexcess-precision=fast" + ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -59,7 +62,8 @@ build() { } check() { - make check + # Using TZ=UTC temporarily until we can update ICU. (#1169) + TZ=UTC make check } package() { diff --git a/system/jfsutils/APKBUILD b/system/jfsutils/APKBUILD index cf9d19a1e..e02cf1f62 100644 --- a/system/jfsutils/APKBUILD +++ b/system/jfsutils/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=jfsutils pkgver=1.1.15 -pkgrel=3 +pkgrel=4 pkgdesc="JFS filesystem utilities" url="http://jfs.sourceforge.net" arch="all" @@ -14,6 +14,7 @@ source="http://jfs.sourceforge.net/project/pub/jfsutils-$pkgver.tar.gz musl-fix-includes.patch missing-stdinth.patch sysmacros.patch + modern-gcc.patch " build() { @@ -36,4 +37,5 @@ package() { sha512sums="fa8ba7f4997471da3e6ea7239564f3395046222cfbb2b10e37b24ad0bd107b7eadbb51ce328d89d193034360b4035ca5e0e5b0b416a74483d7a2c0a2b9c65858 jfsutils-1.1.15.tar.gz fb0d7348e2e13a6a9c3a987d161e0cf05363649515366ef49a45e3580b8f6135fce8465b99ff8a351231d970371c00bea6ceb9edb1d0f24da20d261b06ec85bd musl-fix-includes.patch a8e2332f2dec37affa8404b31e7e68399d815d450422ad342243c51d117e4d7ef4aaa0e30d1389380a81ed076a7ef1e1d41fcf260fa05ce4d823aa779628982d missing-stdinth.patch -9e5006bcee7595ee978bdd6791867a22de26b241dcd8d19b84a7694b3de11b20adcfd46d7999062663bdabf985abe3a53865089fdc219ecfe5476f2dcb93eaff sysmacros.patch" +9e5006bcee7595ee978bdd6791867a22de26b241dcd8d19b84a7694b3de11b20adcfd46d7999062663bdabf985abe3a53865089fdc219ecfe5476f2dcb93eaff sysmacros.patch +8571affb0af6e4b5613e361ce69693be2b481ca0d18c5461ab248baa3946afa3370801469f3b215acf5085267acbd4b2f9e7819cfa59ae1014c47c638b641916 modern-gcc.patch" diff --git a/system/jfsutils/modern-gcc.patch b/system/jfsutils/modern-gcc.patch new file mode 100644 index 000000000..24476df7b --- /dev/null +++ b/system/jfsutils/modern-gcc.patch @@ -0,0 +1,72 @@ +Fix building with GCC 10 or later. + +Based-on: https://sources.debian.org/patches/jfsutils/1.1.15-5/gcc10_fix-1.patch/ +Source: https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/jfsutils/files/jfsutils-1.1.15-gcc10.patch + +--- jfsutils-1.1.15/fscklog/display.c ++++ jfsutils-1.1.15/fscklog/display.c +@@ -54,7 +54,7 @@ + * output: fsck extracted service log I/O buffer + * + */ +-char xchklog_buffer[XCHKLOG_BUFSIZE]; ++static char xchklog_buffer[XCHKLOG_BUFSIZE]; + + /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * +--- jfsutils-1.1.15/libfs/logredo.c ++++ jfsutils-1.1.15/libfs/logredo.c +@@ -87,9 +87,9 @@ + * S T U F F F O R T H E L O G + * + */ +-struct logsuper logsup; /* log super block */ +-int32_t numdoblk; /* number of do blocks used */ +-int32_t numnodofile; /* number of nodo file blocks used */ ++static struct logsuper logsup; /* log super block */ ++static int32_t numdoblk; /* number of do blocks used */ ++static int32_t numnodofile; /* number of nodo file blocks used */ + int32_t numExtDtPg = 0; /* number of extended dtpage blocks used */ + + /* +@@ -129,7 +129,7 @@ + */ + + /* buffer header table */ +-struct bufhdr { ++static struct bufhdr { + int16_t next; /* 2: next on free/lru list */ + int16_t prev; /* 2: previous on free/lru list */ + int16_t hnext; /* 2: next on hash chain */ +@@ -142,7 +142,7 @@ + } bufhdr[NBUFPOOL]; /* (24) */ + + /* buffer table */ +-struct bufpool { ++static struct bufpool { + char bytes[PSIZE]; + } buffer[NBUFPOOL - 1]; + +@@ -151,15 +151,16 @@ + * + * log has its own 4 page buffer pool. + */ +-uint8_t afterdata[LOGPSIZE * 2]; /* buffer to read in redopage data */ ++static uint8_t afterdata[LOGPSIZE * 2]; /* buffer to read in redopage data */ + + /* + * Miscellaneous + */ +-caddr_t prog; /* Program name */ +-int32_t mntcnt, bufsize; +-char *mntinfo; +-int32_t retcode; /* return code from logredo */ ++static caddr_t prog; /* Program name */ ++extern int32_t mntcnt; ++static int32_t bufsize; ++static char *mntinfo; ++static int32_t retcode; /* return code from logredo */ + int end_of_transaction = 0; + + /* + diff --git a/system/libarchive/APKBUILD b/system/libarchive/APKBUILD index 18fae33b9..9fcca3319 100644 --- a/system/libarchive/APKBUILD +++ b/system/libarchive/APKBUILD @@ -1,20 +1,20 @@ # Contributor: Sergey Lukin <sergej.lukin@gmail.com> # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=libarchive -pkgver=3.6.2 -pkgrel=1 +pkgver=3.7.2 +pkgrel=0 pkgdesc="Multi-format archive and compression library" url="https://www.libarchive.org/" arch="all" license="BSD-2-Clause AND BSD-3-Clause AND Public-Domain" depends="" makedepends="zlib-dev bzip2-dev xz-dev lz4-dev acl-dev openssl-dev expat-dev - attr-dev zstd-dev autoconf automake libtool" + attr-dev zstd-dev" subpackages="$pkgname-dev $pkgname-doc $pkgname-tools" source="https://github.com/libarchive/libarchive/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz disable-locale-tests.patch disable-unaligned-access-arm32-xxhash.patch - revert-autotools-Fix-static-linking-when-openssl-is-.patch + fix-test-32-bit-zstd.patch " # secfixes: @@ -27,11 +27,6 @@ source="https://github.com/libarchive/libarchive/releases/download/v$pkgver/$pkg # 3.3.2-r1: # - CVE-2017-14166 -prepare() { - default_prepare - autoreconf -i -} - build () { ./configure \ --build=$CBUILD \ @@ -66,7 +61,7 @@ tools() { ln -s bsdcpio "$subpkgdir"/usr/bin/cpio } -sha512sums="24e476465054a29a2d48adf3c197a171b5361fa5038729a1f14d578c6701424de4e5dd6a2b20a6b697969ab43bdd8afc1585f8de0465c266f455d7eaa19e5048 libarchive-3.6.2.tar.gz +sha512sums="1af253203df3014d1fbf3e99ebdc7aa2a3f036c7c2606d0f0550c49973b0fff99ee7262f4a6e20090c0806c40e964731334360daa3b718bde40108183eacc8a1 libarchive-3.7.2.tar.gz 27cf2aaa3e70e3a2a9944fac0c96c411e669c7e1a48daad1423bff68eef0f49153e5ef9d22dc9591a65353119d7fe203a28258ab82278aeb86b46fe691bcfb6a disable-locale-tests.patch 56a2b13b6cd7b127c04ac50ebf49994ec91ff2467d5d0f32b8428bd4df82b167459d4630dee5d1b5119f70b04ea6fe4411d44b768e0f313fa302c9e5fe51b7cd disable-unaligned-access-arm32-xxhash.patch -1b69d47d900d658622de7a621056f8abeacaf6ad4871a2d326fc925d76f7fe8ae15b16d16979fb8c62e429e231e13a97a89e8d064b3ed2b53b1399722207e1ab revert-autotools-Fix-static-linking-when-openssl-is-.patch" +f0a8e3881e742395afc74e418eceab419280152f0884fd6b9dc971d90e117de1cd0a7578c08f14f694c75b904f12fa71fb0102dde0d67a095f6369b3413f7348 fix-test-32-bit-zstd.patch" diff --git a/system/libarchive/fix-test-32-bit-zstd.patch b/system/libarchive/fix-test-32-bit-zstd.patch new file mode 100644 index 000000000..5f43c2626 --- /dev/null +++ b/system/libarchive/fix-test-32-bit-zstd.patch @@ -0,0 +1,29 @@ +From 3bd918d92f8c34ba12de9c6604d96f9e262a59fc Mon Sep 17 00:00:00 2001 +From: Martin Matuska <martin@matuska.de> +Date: Tue, 12 Sep 2023 08:54:47 +0200 +Subject: [PATCH] tests: fix zstd long option test for 32-bit architectures + +Fixes #1968 +--- + libarchive/test/test_write_filter_zstd.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libarchive/test/test_write_filter_zstd.c b/libarchive/test/test_write_filter_zstd.c +index 3cdbd812a..c9731f1b6 100644 +--- a/libarchive/test/test_write_filter_zstd.c ++++ b/libarchive/test/test_write_filter_zstd.c +@@ -161,8 +161,12 @@ DEFINE_TEST(test_write_filter_zstd) + archive_write_set_filter_option(a, NULL, "max-frame-size", "1048576")); + #endif + #if ZSTD_VERSION_NUMBER >= MINVER_LONG +- assertEqualIntA(a, ARCHIVE_OK, +- archive_write_set_filter_option(a, NULL, "long", "27")); ++ if ((int)(sizeof(size_t) == 4)) ++ assertEqualIntA(a, ARCHIVE_OK, ++ archive_write_set_filter_option(a, NULL, "long", "26")); ++ else ++ assertEqualIntA(a, ARCHIVE_OK, ++ archive_write_set_filter_option(a, NULL, "long", "27")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "long", "-1")); /* negative */ + #endif diff --git a/system/libarchive/revert-autotools-Fix-static-linking-when-openssl-is-.patch b/system/libarchive/revert-autotools-Fix-static-linking-when-openssl-is-.patch deleted file mode 100644 index 24acd4080..000000000 --- a/system/libarchive/revert-autotools-Fix-static-linking-when-openssl-is-.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 57b52cb8b54ec57d72ed0ccacacc1f6506749d17 Mon Sep 17 00:00:00 2001 -From: Zach van Rijn <me@zv.io> -Date: Tue, 11 Apr 2023 17:14:18 -0500 -Subject: [PATCH] Revert "autotools: Fix static linking when openssl is enabled - in windows" - -This reverts commit a83f3d327aefe8d628230f326621b014d82f55b4. - -diff --git a/build/pkgconfig/libarchive.pc.in b/build/pkgconfig/libarchive.pc.in -index 1f51e77f..4b631e63 100644 ---- a/build/pkgconfig/libarchive.pc.in -+++ b/build/pkgconfig/libarchive.pc.in -@@ -10,4 +10,3 @@ Cflags: -I${includedir} - Cflags.private: -DLIBARCHIVE_STATIC - Libs: -L${libdir} -larchive - Libs.private: @LIBS@ --Requires.private: @LIBSREQUIRED@ -diff --git a/configure.ac b/configure.ac -index 349e7580..d60f66fb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -378,7 +378,6 @@ if test "x$with_iconv" != "xno"; then - AC_CHECK_HEADERS([localcharset.h]) - am_save_LIBS="$LIBS" - LIBS="${LIBS} ${LIBICONV}" -- LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv" - AC_CHECK_FUNCS([locale_charset]) - LIBS="${am_save_LIBS}" - if test "x$ac_cv_func_locale_charset" != "xyes"; then -@@ -1210,7 +1209,6 @@ fi - if test "x$with_openssl" != "xno"; then - AC_CHECK_HEADERS([openssl/evp.h]) - saved_LIBS=$LIBS -- LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libssl libcrypto" - AC_CHECK_LIB(crypto,OPENSSL_config) - CRYPTO_CHECK(MD5, OPENSSL, md5) - CRYPTO_CHECK(RMD160, OPENSSL, rmd160) -@@ -1221,8 +1219,6 @@ if test "x$with_openssl" != "xno"; then - AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1]) - fi - --AC_SUBST(LIBSREQUIRED) -- - # Probe libmd AFTER OpenSSL/libcrypto. - # The two are incompatible and OpenSSL is more complete. - AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h]) --- -2.25.1 - diff --git a/system/libelf/APKBUILD b/system/libelf/APKBUILD index 266591533..2f89334e2 100644 --- a/system/libelf/APKBUILD +++ b/system/libelf/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Zach van Rijn <me@zv.io> pkgname=libelf pkgver=0.8.13 -pkgrel=5 +pkgrel=6 pkgdesc="ELF object file access library" url=" " # Dead upstream: http://www.mr511.de/software/ arch="all" @@ -11,6 +11,7 @@ depends="" makedepends="" subpackages="$pkgname-dev" source="https://distfiles.adelielinux.org/source/$pkgname-$pkgver.tar.gz + mkdir-p.patch preprocessor-warnings.patch " @@ -39,4 +40,5 @@ package() { } sha512sums="d2a4ea8ccc0bbfecac38fa20fbd96aefa8e86f8af38691fb6991cd9c5a03f587475ecc2365fc89a4954c11a679d93460ee9a5890693112f6133719af3e6582fe libelf-0.8.13.tar.gz +176efa888350544f144e7d2115278bf2cc5aaca09f0937a1196ec2a0f72de1d2e62a40acf1f45331cd6c9ca3ad23104f9c3f093b6e9baafd93305a683d587198 mkdir-p.patch 6f5e4a50c1fee7bae39c7fca237bbcad005b2b865ff9fbd835c7772f92f4a31324e958b7c583a378a5069eb5c43500d9a8881013f0a7a169310efba75b2f01e8 preprocessor-warnings.patch" diff --git a/system/libelf/mkdir-p.patch b/system/libelf/mkdir-p.patch new file mode 100644 index 000000000..38a4712d8 --- /dev/null +++ b/system/libelf/mkdir-p.patch @@ -0,0 +1,13 @@ +--- libelf-0.8.13/mkinstalldirs.old 2005-05-21 10:28:38.000000000 -0500 ++++ libelf-0.8.13/mkinstalldirs 2024-07-26 15:44:20.923580931 -0500 +@@ -22,8 +22,8 @@ + pathcomp="${pathcomp}${d}" + + if test ! -d "${pathcomp}"; then +- echo "mkdir $pathcomp" 1>&2 +- mkdir "${pathcomp}" || errstatus=$? ++ echo "mkdir -p $pathcomp" 1>&2 ++ mkdir -p "${pathcomp}" || errstatus=$? + fi + + pathcomp="${pathcomp}/" diff --git a/system/libtool/APKBUILD b/system/libtool/APKBUILD index 90b3a0170..5d8b85716 100644 --- a/system/libtool/APKBUILD +++ b/system/libtool/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Zach van Rijn <me@zv.io> pkgname=libtool pkgver=2.4.7 -pkgrel=0 +pkgrel=1 pkgdesc="A generic library support script" arch="all" license="GPL-2.0+" @@ -14,6 +14,7 @@ options="libtool" source="https://ftp.gnu.org/gnu/$pkgname/${pkgname}-${pkgver}.tar.gz libtool-fix-cross-compile.patch fix-test-grep-expression.patch + gnulib-tests-dont-require-gpg-passphrase.patch " build() { @@ -46,4 +47,5 @@ libltdl() { sha512sums="27acef46d9eb67203d708b57d80b853f76fa4b9c2720ff36ec161e6cdf702249e7982214ddf60bae75511aa79bc7d92aa27e3eab7ef9c0f5c040e8e42e76a385 libtool-2.4.7.tar.gz aa14cadd70a633520249fa3a6a4c45b309a980380e62dd5982b3ae842c478a77401ad809297fceebd167c167b0a19f380e6a6c295bc75d1029d56d3bf262b209 libtool-fix-cross-compile.patch -57d47955bd3d51c5df2d62ba4773687e9111bfc155312eaa10d84e273845e255c2e62a1ceb01e8ce35617cb702f116fc223121dbb69955f5141c0185fbf4b6b4 fix-test-grep-expression.patch" +57d47955bd3d51c5df2d62ba4773687e9111bfc155312eaa10d84e273845e255c2e62a1ceb01e8ce35617cb702f116fc223121dbb69955f5141c0185fbf4b6b4 fix-test-grep-expression.patch +0d5364fd652e2e65a5f9a7c4c54755863bf2e68a7000a28cc8acf78e2342592d12444ff71dd2b755e4a3a2ef18a9757a029a25dfcf34b3e277bbfa351abe0575 gnulib-tests-dont-require-gpg-passphrase.patch" diff --git a/system/libtool/gnulib-tests-dont-require-gpg-passphrase.patch b/system/libtool/gnulib-tests-dont-require-gpg-passphrase.patch new file mode 100644 index 000000000..c3267b159 --- /dev/null +++ b/system/libtool/gnulib-tests-dont-require-gpg-passphrase.patch @@ -0,0 +1,10 @@ +--- libtool-2.4.7/gnulib-tests/test-vc-list-files-git.sh.old 2018-01-03 18:36:29.000000000 -0600 ++++ libtool-2.4.7/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/mandoc/APKBUILD b/system/mandoc/APKBUILD index 870e3d3be..88230079e 100644 --- a/system/mandoc/APKBUILD +++ b/system/mandoc/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Max Rees <maxcrees@me.com> pkgname=mandoc pkgver=1.14.6 -pkgrel=0 +pkgrel=1 pkgdesc="Manual page database, compiler, and viewer" url="https://mandoc.bsd.lv/" arch="all" diff --git a/system/mandoc/mandoc.trigger b/system/mandoc/mandoc.trigger index 34fc1decc..d8ffe7102 100644 --- a/system/mandoc/mandoc.trigger +++ b/system/mandoc/mandoc.trigger @@ -1,3 +1,3 @@ #!/bin/sh -exec makewhatis -a -T utf8 "$@" +exec makewhatis -T utf8 diff --git a/system/mdevd/APKBUILD b/system/mdevd/APKBUILD index 2983fd378..228ef287e 100644 --- a/system/mdevd/APKBUILD +++ b/system/mdevd/APKBUILD @@ -1,14 +1,14 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=mdevd -pkgver=0.1.6.2 +pkgver=0.1.6.4 pkgrel=0 pkgdesc="A small uevent manager daemon" -url="https://skarnet.org/software/$pkgname/" +url="https://skarnet.org/software/mdevd/" arch="all" options="!check" # No test suite. license="ISC" -_skalibs_version=2.13 +_skalibs_version=2.14 makedepends="skalibs-dev>=$_skalibs_version" subpackages="$pkgname-doc $pkgname-openrc" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz mdev.conf mdevd.run mdevd.initd" @@ -20,23 +20,14 @@ build() { package() { make DESTDIR="$pkgdir" install - mkdir -p -m 0755 "$pkgdir/etc/init.d" + mkdir -p -m 0755 "$pkgdir/etc/init.d" "$pkgdir/usr/share/doc" cp -f "$srcdir/mdev.conf" "$pkgdir/etc/" chmod 0644 "$pkgdir/etc/mdev.conf" cp -f "$srcdir/mdevd.initd" "$pkgdir/etc/init.d/mdevd" chmod 0755 "$pkgdir/etc/init.d/mdevd" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends= - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" -} - - openrc() { rldir="$subpkgdir"/etc/runlevels/sysinit svcdir="$subpkgdir/etc/s6-linux-init/current/run-image/service/mdevd" @@ -49,7 +40,7 @@ openrc() { ln -s ../../init.d/mdevd "$rldir/mdevd" } -sha512sums="e1b0aee398715ab8892518efb41a983114b8bc245374b3ee9dc2bd652ae8545ac2d191ea43e7a8dda84e995dc3d30dad93ef14147a4fa3e0f20e80f72b232887 mdevd-0.1.6.2.tar.gz +sha512sums="4435fac14887f12ba429099f8ad9c9215a6fc3966a5f836a48684ecdd2fa38ccbcdaf363af7e8397b4dc741b92fad0998179919e12fc5c0404b914370db13f1b mdevd-0.1.6.4.tar.gz f966d66366eac3b9b9eeb9b8523ea0924ada2b858c85ca0c0151d0fb374dfbf56c49ec2210d2d5ca19aa4d9f24371c85d777050eb8bf9f57821ec65704f18717 mdev.conf 427a5903fa2126060955dcce8144d59255a679c4973f2dbc3145a4d646e879fc241ebcaa53289498719d343c746fc376c41defa87932dcbe91192b2d6f4ed1c4 mdevd.run e7599f51a4280243a5be459c6fad7eb8ba3b5f65fae8cad923ccca2addab55787819909fea311c998e1126e6802a81ab000ee6de7474f3245ce72521244c22ba mdevd.initd" diff --git a/system/ncurses/APKBUILD b/system/ncurses/APKBUILD index 25316409a..3b9da03fc 100644 --- a/system/ncurses/APKBUILD +++ b/system/ncurses/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> pkgname=ncurses -pkgver=6.4 -_ver=20230311 +pkgver=6.5 +_ver=20240427 pkgrel=0 pkgdesc="Console display library" url="https://invisible-island.net/ncurses/ncurses.html" @@ -112,4 +112,4 @@ static() { mv "$pkgdir"/lib/*.a "$subpkgdir"/lib/ } -sha512sums="320146868f84ad8cf18478165a61769409ef9d6dc0cd88448eefb767d1810d2eae62d84c362930512f8351860f4c49370681e319844e25adeee530df136f7d00 ncurses-6.4-20230311.tgz" +sha512sums="a5c55927217880e13952988c45dab42a80318420954920e6e083be5399b0dd71d2c9c759aa623130fc1e5ae7abcfc93d197ef626706b0846b96e5d4f3ce1ac7a ncurses-6.5-20240427.tgz" diff --git a/system/nss/APKBUILD b/system/nss/APKBUILD index 04a3f12bb..e3a7131eb 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.89 +pkgver=3.94 _ver=$(printf '%s' "$pkgver" | tr . _) pkgrel=0 pkgdesc="Mozilla Network Security Services" @@ -157,7 +157,7 @@ tools() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } -sha512sums="1db06d4575f2c16d2a0629007981211e714f99c014c0a6256dd33d0caf8c809ba8d5be204d018f9d1cc99b9fcd055ac1fb99b399486ed43c9cf3f55f2747de82 nss-3.89.tar.gz +sha512sums="3a839a6cc7267e45749f769621c3e8823f92cb654ee40460187e59b50825bb0f84ca278cd61881a3e0e7d95f95e0ffcd266a10c780cdcf8a08a2f0a9bb71892f nss-3.94.tar.gz 75dbd648a461940647ff373389cc73bc8ec609139cd46c91bcce866af02be6bcbb0524eb3dfb721fbd5b0bc68c20081ed6f7debf6b24317f2a7ba823e8d3c531 nss.pc.in 0f2efa8563b11da68669d281b4459289a56f5a3a906eb60382126f3adcfe47420cdcedc6ab57727a3afeeffa2bbb4c750b43bef8b5f343a75c968411dfa30e09 nss-util.pc.in 09c69d4cc39ec9deebc88696a80d0f15eb2d8c94d9daa234a2adfec941b63805eb4ce7f2e1943857b938bddcaee1beac246a0ec627b71563d9f846e6119a4a15 nss-softokn.pc.in diff --git a/system/openrc/0006-mount-efivars-read-only.patch b/system/openrc/0006-mount-efivars-read-only.patch deleted file mode 100644 index ec2321dd2..000000000 --- a/system/openrc/0006-mount-efivars-read-only.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 37feb4b716525f0c5c5469f21686ab4efcf06fab Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Wed, 1 Feb 2017 04:18:53 +0000 -Subject: [PATCH 6/7] mount efivars read-only - -unintentional writes to efivars may result in bricked hardware. mount it -read-only to play safe. ---- - init.d/sysfs.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/init.d/sysfs.in b/init.d/sysfs.in -index e493f584..bfd0d438 100644 ---- a/init.d/sysfs.in -+++ b/init.d/sysfs.in -@@ -101,7 +101,7 @@ mount_misc() - if [ -d /sys/firmware/efi/efivars ] && - ! mountinfo -q /sys/firmware/efi/efivars; then - ebegin "Mounting efivarfs filesystem" -- mount -n -t efivarfs -o ${sysfs_opts} \ -+ mount -n -t efivarfs -o ro,${sysfs_opts} \ - efivarfs /sys/firmware/efi/efivars 2> /dev/null - eend 0 - fi --- -2.11.1 - diff --git a/system/openrc/APKBUILD b/system/openrc/APKBUILD index 5546e46be..632b55452 100644 --- a/system/openrc/APKBUILD +++ b/system/openrc/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: pkgname=openrc pkgver=0.24.1 -pkgrel=12 +pkgrel=14 pkgdesc="OpenRC manages the services, startup and shutdown of a host" url="https://github.com/OpenRC/openrc" arch="all" @@ -18,9 +18,9 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgve 0003-sysctl-add-compatibility-for-busybox-sysctl.patch 0004-hide-error-when-migrating-var-run-to-run.patch 0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch - 0006-mount-efivars-read-only.patch hwclock-grep.patch + modern-gcc.patch openrc-configuration.patch openrc.logrotate @@ -88,8 +88,8 @@ aedf77f9159fefb4bd5f30a29a33b6aedbc986c9a0f993aa928cc79fbe24aac76bd9e5974dcce52e 5494f5ee520b26219048586882919dc0b45e839bd9543edc974f7b283d7b9326dc0362f9d2608b6acf043613399ea16c8287b854da874f49801963165e239dba 0003-sysctl-add-compatibility-for-busybox-sysctl.patch d54630d40a2d6b10a325cb012d4efcda997a60c008ca953ce5d60059d3f267308a59dabddf93a5fc0d301aa91967137d144effbe5f574394af768ce4ebc48738 0004-hide-error-when-migrating-var-run-to-run.patch 39a35c54ec9112fe84c901ed155a711cec8e194af02d5483ee60b80743dab12391e6fdc7b3da2f86844dd4edcf53e681ff95bd4d6fa1101a89ce54dce2ddbb7c 0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch -7221dd2daccd8844f6f9481b7b5921abc2711c8abd1a4bb72f04db8fd8e734b817f5d0d571daea0e2e05d3bc687f75ee1d8025249996bdee0b3328e18d9da7d3 0006-mount-efivars-read-only.patch 43355d72ad82858787e240450ae556cdd40aa9a3719545991d76719df80cc5c851c21374b339a6953f0344f1468e08e99c4da11334dc0b72647f4aa1db08558c hwclock-grep.patch +aeb63843b69bf5dc3e513a9b0fa1c5631b509b2ecc9e127d6d5e1ac18254375a45afb6e82429d2c559e29aef70e01286b82cabbdc7c3907a5cce6cdfb32be4f9 modern-gcc.patch 634c09a36d542a69b147a292418fa99a5d071d7a384bd2d2b30917a986cdc82ef4e96e380bc3a154cb0709c57d5308320c30fd6973972d6e6d7f8ac5b2e31bea openrc-configuration.patch 12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec openrc.logrotate 99b542c0903ad6874b8c308b2e0660a4fe2ff9db962dfec65325cd12c368873a2ae800d5e6d42dc4deff775e1d5c0068869eb72581f7ab16e88d5738afe1d3dd hostname.initd diff --git a/system/openrc/modern-gcc.patch b/system/openrc/modern-gcc.patch new file mode 100644 index 000000000..e50029af2 --- /dev/null +++ b/system/openrc/modern-gcc.patch @@ -0,0 +1,14 @@ +Ensure we can build with -fno-common. +--- openrc-0.24.1/src/rc/rc-logger.h.old 2017-03-14 19:58:26.000000000 -0500 ++++ openrc-0.24.1/src/rc/rc-logger.h 2024-05-25 12:47:43.244186307 -0500 +@@ -13,8 +13,8 @@ + #ifndef RC_LOGGER_H + #define RC_LOGGER_H + +-pid_t rc_logger_pid; +-int rc_logger_tty; ++extern pid_t rc_logger_pid; ++extern int rc_logger_tty; + extern bool rc_in_logger; + + void rc_logger_open(const char *runlevel); diff --git a/system/perl-cpanel-json-xs/APKBUILD b/system/perl-cpanel-json-xs/APKBUILD index 0c27696be..403e77f00 100644 --- a/system/perl-cpanel-json-xs/APKBUILD +++ b/system/perl-cpanel-json-xs/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Cpanel-JSON-XS _author=RURBAN _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=4.36 +pkgver=4.37 pkgrel=0 pkgdesc="cPanel's fork of JSON::XS, fast and correct serialising" url="https://metacpan.org/release/Cpanel-JSON-XS" @@ -32,4 +32,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="3e080bfb2842e7d1270c1bee7463f6ee3579b526f385b2a55abfceaf57af45786a22d45d5e7d6490f0998cd5b3bf305f608fb744ca0bbfffc6644456ea17c22d Cpanel-JSON-XS-4.36.tar.gz" +sha512sums="f1b5fc161711815f33b3e05a19111d9c94ef817c952eb3d317cb8bc3fd973acdb645a6b129cb21345dccf4a161de069f0ab2d3cb807e7f6b20ebe2527ef48978 Cpanel-JSON-XS-4.37.tar.gz" diff --git a/system/perl-dbd-sqlite/APKBUILD b/system/perl-dbd-sqlite/APKBUILD index f015faba1..b415bad63 100644 --- a/system/perl-dbd-sqlite/APKBUILD +++ b/system/perl-dbd-sqlite/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=DBD-SQLite _author=ISHIGAKI _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=1.72 +pkgver=1.74 pkgrel=0 pkgdesc="Perl DBI SQLite module" url="https://metacpan.org/release/DBD-SQLite" @@ -39,5 +39,5 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="67a90c618a3626b3ae0b333b5eb4d4d0c8c13712bbcd50c135bf74e83dc252301664089803597c1bcbebf7f1eda040673d4438e70e2dae0aef3b8ebeeecd2f79 DBD-SQLite-1.72.tar.gz +sha512sums="46bb26ffac07ca6d25d44101bd59fe7ebb397d159154fe10528e4ca4ee270e62159a40be0325099237ce28fb6ce11b5dc1da5396c3e9a3e0e03062a65c16cbab DBD-SQLite-1.74.tar.gz 00961932f9f89d9b46e6134150c2628aadd4cfa7159cb1604de023fedc919087fbf982b72fd51610e1ca390234cd939e74430b270131d0b30cedb97ba6203b49 perl-DBD-SQLite-bz543982.patch" diff --git a/system/perl-file-listing/APKBUILD b/system/perl-file-listing/APKBUILD index 2f5e1a610..6de780095 100644 --- a/system/perl-file-listing/APKBUILD +++ b/system/perl-file-listing/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=File-Listing _author=PLICEASE _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=6.15 +pkgver=6.16 pkgrel=0 pkgdesc="Perl module for parsing directory lists in various formats" url="https://metacpan.org/release/File-Listing" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="8368605bf196750f4044d87a8b784e6a28fa6fe6d5971c5de507b4df77859020dcba4929ce97f5091966a6a2fca94466a345450f2f9d2fad9fb88d880f491944 File-Listing-6.15.tar.gz" +sha512sums="2d18f0cf7dbf30bb752c5d70132e90dd346e6fb795cb61664b8f11bfba67ec357235f5cb5a87752cf65ba9d000a6c7976548f0aed0f833048ca1b06aed991eca File-Listing-6.16.tar.gz" diff --git a/system/perl-http-cookiejar/APKBUILD b/system/perl-http-cookiejar/APKBUILD new file mode 100644 index 000000000..240cd68eb --- /dev/null +++ b/system/perl-http-cookiejar/APKBUILD @@ -0,0 +1,35 @@ +# Contributor: Síle Ekaterin Liszka <sheila@vulpine.house> +# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> +pkgname=perl-http-cookiejar +_pkgreal=HTTP-CookieJar +pkgver=0.014 +pkgrel=0 +_author=DAGOLDEN +_au=${_author%%"${_author#??}"} +_a=${_author%%"${_author#?}"} +pkgdesc="A minimalist HTTP user agent cookie jar implementation for Perl" +url="https://metacpan.org/dist/HTTP-CookieJar" +arch="noarch" +license="Apache-2.0" +depends="perl-http-date perl-uri perl" +checkdepends="perl-test-deep perl-test-requires" +makedepends="" +subpackages="$pkgname-doc" +source="https://cpan.metacpan.org/authors/id/$_a/$_au/$_author/$_pkgreal-$pkgver.tar.gz" +builddir="$srcdir/$_pkgreal-$pkgver" + +build() { + PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor + make +} + +check() { + make test +} + +package() { + make DESTDIR="$pkgdir" install + find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete +} + +sha512sums="98e6834574e28d8e278ba6f23817d7a4b0a072fea144f97db78e20881f622c01ddf4edff1dc5563c0fc46b22ba94fd9acfd18c9c81118c8c18c7d810f7534467 HTTP-CookieJar-0.014.tar.gz" diff --git a/system/perl-http-cookies/APKBUILD b/system/perl-http-cookies/APKBUILD index 6570a889c..c13f5f57a 100644 --- a/system/perl-http-cookies/APKBUILD +++ b/system/perl-http-cookies/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=HTTP-Cookies _author=OALDERS _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=6.10 +pkgver=6.11 pkgrel=0 pkgdesc="Perl HTTP cookie jars" url="https://metacpan.org/release/HTTP-Cookies" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="c24a986e524ebf5d8b13b4580c3ee6aed018e79c203fd62208bfe970744482832fe9c41bb3195a596af1e11058053ed7615a09a26fbcef4433e270f0f5d38658 HTTP-Cookies-6.10.tar.gz" +sha512sums="3ebfa742407a623fdcb23fe7fc559a1667b9510c4c152f98c6d98bcea3df6f336183920636244cd5175b9e9ada4a599bae87433c1ea518739b4eac90a4ca5342 HTTP-Cookies-6.11.tar.gz" diff --git a/system/perl-http-message/APKBUILD b/system/perl-http-message/APKBUILD index 2f02752ff..9190b98ae 100644 --- a/system/perl-http-message/APKBUILD +++ b/system/perl-http-message/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=HTTP-Message _author=OALDERS _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=6.44 +pkgver=6.45 pkgrel=0 pkgdesc="Perl class encapsulating HTTP-style messages" url="https://metacpan.org/release/HTTP-Message" @@ -33,4 +33,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="515f3b91b4ed1b12c63149006651b8d60e3b4d3d842e2b997b2e8c67ce93cbdcb8eb5357f4c5bce20057aea22c1f84b5e02995b02e381c21d918032edb35a994 HTTP-Message-6.44.tar.gz" +sha512sums="b72ab9068c5f9ddb41f89b2a84887393f2c1bd14b462a1a60c03b4560800cfbf37c76f4bdd7c08f1ce9bf616242c2e39e0ff93859ed61268c48c978322a6d03d HTTP-Message-6.45.tar.gz" diff --git a/system/perl-io-socket-ssl/APKBUILD b/system/perl-io-socket-ssl/APKBUILD index 113d2c902..e8b9f6556 100644 --- a/system/perl-io-socket-ssl/APKBUILD +++ b/system/perl-io-socket-ssl/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=IO-Socket-SSL _author=SULLR _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=2.081 +pkgver=2.085 pkgrel=0 pkgdesc="Perl module implementing SSL/TLS with IO::Socket interface" url="https://metacpan.org/release/IO-Socket-SSL" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="309d02983a8a6c1440c2161189fd4648533bafb784a3271fb0d8671681ed606aeaeb5f0650de5f26869e1fd84e9c8bd94674988bbefcd0f424c94a387a548534 IO-Socket-SSL-2.081.tar.gz" +sha512sums="c4e045e88f69579d53a3663ed8f74d342fe3529e24e06d9e7d299debafdb840839c6f5bccb579b4d03f7501615439dba4661ac006312f379a2598a3030634cfd IO-Socket-SSL-2.085.tar.gz" diff --git a/system/perl-ipc-run3/APKBUILD b/system/perl-ipc-run3/APKBUILD new file mode 100644 index 000000000..ca9d1f546 --- /dev/null +++ b/system/perl-ipc-run3/APKBUILD @@ -0,0 +1,34 @@ +# Contributor: A. Wilcox <awilfox@adelielinux.org> +# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> +pkgname=perl-ipc-run3 +_pkgreal=IPC-Run3 +_author=RJBS +_au=${_author%%"${_author#??}"} +_a=${_author%%"${_author#?}"} +pkgver=0.049 +pkgrel=0 +pkgdesc="Run a subprocess from Perl with I/O redirection" +url="https://metacpan.org/release/IPC-Run3" +arch="noarch" +license="GPL-1.0+ OR BSD-2-Clause OR Artistic-1.0-Perl OR Artistic-2.0" +depends="perl" +makedepends="perl-dev" +subpackages="$pkgname-doc" +source="https://cpan.metacpan.org/authors/id/$_a/$_au/$_author/$_pkgreal-$pkgver.tar.gz" +builddir="$srcdir/$_pkgreal-$pkgver" + +build() { + PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor + make +} + +check() { + make test +} + +package() { + make DESTDIR="$pkgdir" install + find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete +} + +sha512sums="19dbf902666ccb56bfdb02c0c4e9ef585d773e1b8b53d4627367a3c0344d08a6358a733786b8de97e615b6916b716c4e66e73ae263986a2cacf50ab155539c55 IPC-Run3-0.049.tar.gz" diff --git a/system/perl-json-maybexs/APKBUILD b/system/perl-json-maybexs/APKBUILD index f8fb858ba..12e22b2a8 100644 --- a/system/perl-json-maybexs/APKBUILD +++ b/system/perl-json-maybexs/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=JSON-MaybeXS _author=ETHER _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=1.004004 +pkgver=1.004005 pkgrel=0 pkgdesc="Use <Cpanel::JSON::XS> with a fallback to <JSON::XS> and <JSON::PP>" url="https://metacpan.org/release/JSON-MaybeXS" @@ -32,4 +32,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="b3ed3a0993c0671f49cbb6bde72b58f3dc55d807b42cfa98702e92daea177fdd8f71cccda962daedf98fb0d77d043a95558a670eda70c8e929791e52229bab9d JSON-MaybeXS-1.004004.tar.gz" +sha512sums="f483549f08bb829c7958fd36d33ece8550ed13d53f559d3a8a0915045a11443a01fcbd3ad767f09759d24ec98c2eeced4e550a1fb333a1fc929b7086e1506edf JSON-MaybeXS-1.004005.tar.gz" diff --git a/system/perl-libwww/APKBUILD b/system/perl-libwww/APKBUILD index 5d9e894b2..be7b7d13e 100644 --- a/system/perl-libwww/APKBUILD +++ b/system/perl-libwww/APKBUILD @@ -5,14 +5,14 @@ _pkgreal=libwww-perl _author=OALDERS _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=6.68 +pkgver=6.76 pkgrel=0 pkgdesc="Perl module - World Wide Web library" 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 +depends="perl-http-date perl-http-cookies perl-http-cookiejar perl-net-http + perl-http-daemon perl-html-parser perl-file-listing perl-www-robotrules perl-http-negotiate perl-uri perl-http-message perl-test-needs perl-lwp-mediatypes perl-encode-locale perl-try-tiny" makedepends="" @@ -35,4 +35,4 @@ package() { find "$pkgdir" -name perllocal.pod -delete } -sha512sums="acce4c6c062d1893c45613f3c9ef4896d60efba2887f80a18c97c13bd5eba95295a777178077c942abe392e37ade689489ad60cefce28656c541e875b2bf09d2 perl-libwww-6.68.tar.gz" +sha512sums="8a055c3324007eb1badc3d8b8d368a46b7c1c5e5dd837ddbb862924e8c7fc13c413f50dae4ff8d32bf53774f1a95016098e56c181547f60b42dbbedf3813b897 perl-libwww-6.76.tar.gz" diff --git a/system/perl-module-scandeps/APKBUILD b/system/perl-module-scandeps/APKBUILD index 655c0ea66..998711304 100644 --- a/system/perl-module-scandeps/APKBUILD +++ b/system/perl-module-scandeps/APKBUILD @@ -6,13 +6,13 @@ _pkgreal=Module-ScanDeps _author=RSCHUPP _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=1.31 +pkgver=1.35 pkgrel=0 pkgdesc="Recursively scan Perl code for dependencies" url="https://metacpan.org/release/Module-ScanDeps" arch="noarch" license="GPL-2.0-only OR Artistic-1.0-Perl" -depends="perl" +depends="perl-ipc-run3 perl" checkdepends="perl-test-requires" makedepends="perl-test-pod" subpackages="$pkgname-doc" @@ -34,4 +34,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="c7164d768b6401a0d01516f5a09ddf2a0399355738ff17d04757aeb235b47f8d973083d0425ca53757588916c7fb2959d8c042361055a0e8eab7bf6d4c31d6fd Module-ScanDeps-1.31.tar.gz" +sha512sums="314a8098883995d876bfae7760b569ade56eed1940e50f92a509fd0f2c0020d57da859bb8848c56a9e1dcb4acd62cd246c39424bc1c30d71c6defc9f491518b9 Module-ScanDeps-1.35.tar.gz" diff --git a/system/perl-net-http/APKBUILD b/system/perl-net-http/APKBUILD index b547c20f5..6235d2fc0 100644 --- a/system/perl-net-http/APKBUILD +++ b/system/perl-net-http/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Net-HTTP _author=OALDERS _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=6.22 +pkgver=6.23 pkgrel=0 pkgdesc="Low-level HTTP connection client library for Perl" url="https://metacpan.org/release/Net-HTTP" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="8d0af85baee8a3b257995c6dd277c2eb578d1feeec89f3e4be0548959d2cf07934764d9d16a542a50f72a4611e3f4b6335ff7e969a28cd74fbb0ec3961588131 Net-HTTP-6.22.tar.gz" +sha512sums="be926d12f6a8be504f221b54dbe9b1cbe1ff18b7dc8075ce308cc8c436ed9e4fe959516ce81c858a70de80df13cedd8cd78fd153cc5eb763f1bc3c9893ceaa05 Net-HTTP-6.23.tar.gz" diff --git a/system/perl-net-ssleay/APKBUILD b/system/perl-net-ssleay/APKBUILD index a89b57832..24c299329 100644 --- a/system/perl-net-ssleay/APKBUILD +++ b/system/perl-net-ssleay/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Net-SSLeay _author=CHRISN _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=1.92 +pkgver=1.94 pkgrel=0 pkgdesc="Perl extension for using OpenSSL" url="https://metacpan.org/release/Net-SSLeay" @@ -32,4 +32,4 @@ package() { find "$pkgdir" -name perllocal.pod -delete } -sha512sums="e9d9161ebeb7be90f4c7a0ea98f1034892ce6d33aa72872683177b19daa1f4c5819f85ea9a052a076ec8d7c21705f6c344aef64680bc881bf3218d38e8b7b173 Net-SSLeay-1.92.tar.gz" +sha512sums="f1461667269f3da56ff7e1724b5511b95c34582250f8336e9f93d30f3b30d4a5360eb27622b9730bba11df75e00d717c7f0cea2120d20206723db136a8509375 Net-SSLeay-1.94.tar.gz" diff --git a/system/perl-test-deep/APKBUILD b/system/perl-test-deep/APKBUILD new file mode 100644 index 000000000..422c93185 --- /dev/null +++ b/system/perl-test-deep/APKBUILD @@ -0,0 +1,34 @@ +# Contributor: Dan Theisen <djt@hxx.in> +# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> +pkgname=perl-test-deep +_pkgreal=Test-Deep +_author=RJBS +_au=${_author%%"${_author#??}"} +_a=${_author%%"${_author#?}"} +pkgver=1.204 +pkgrel=0 +pkgdesc="Extremely flexible deep comparison" +url="https://metacpan.org/pod/Test::Deep" +arch="noarch" +license="Artistic-1.0-Perl OR GPL-1.0+" +depends="perl" +makedepends="perl-dev" +subpackages="$pkgname-doc" +source="https://cpan.metacpan.org/authors/id/$_a/$_au/$_author/$_pkgreal-$pkgver.tar.gz" +builddir="$srcdir/$_pkgreal-$pkgver" + +build() { + PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor + make +} + +check() { + make test +} + +package() { + make DESTDIR="$pkgdir" install + find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete +} + +sha512sums="1a11b221810b7b23a6d3f71546e264ea3636fa36c73def760f756da69e6937ca3e1c1123505b80241360459d09fc4b9ab614d1c6826593695f6577f60595a8ae Test-Deep-1.204.tar.gz" diff --git a/system/perl-test-harness/APKBUILD b/system/perl-test-harness/APKBUILD index c2602edb6..5abb6c237 100644 --- a/system/perl-test-harness/APKBUILD +++ b/system/perl-test-harness/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Test-Harness _author=LEONT _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=3.44 +pkgver=3.48 pkgrel=0 pkgdesc="Run Perl standard test scripts with statistics" url="https://metacpan.org/release/Test-Harness" @@ -32,4 +32,4 @@ package() { rm "$pkgdir"/usr/bin/prove } -sha512sums="908f0105bfa6c6e4578a4e08180d799d0ca7299c2206280fe64b9229fe3c05abdb000364d853a078f39f7d3129a8f91b7030976e1dfab726c6c6fd16e0970ef1 Test-Harness-3.44.tar.gz" +sha512sums="7d65b48157ec7bc63553144f68e6233c07d21a4d127cefd5f77b2193c47f4d96325b15a9eb029ed62a19340f65659fcef0796ff7c6b07e5b5b8d539ddeee485c Test-Harness-3.48.tar.gz" diff --git a/system/perl-test-simple/APKBUILD b/system/perl-test-simple/APKBUILD index ebfe0077d..8bf0a6281 100644 --- a/system/perl-test-simple/APKBUILD +++ b/system/perl-test-simple/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Test-Simple _author=EXODIST _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=1.302193 +pkgver=1.302198 pkgrel=0 pkgdesc="Basic utilities for writing Perl tests" url="https://metacpan.org/release/Test-Simple" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="8d4ce910525db4b0f2d10bb21f1dc649d8ea1ae0fa8c97b5fa5ddaf25f04fa751327269ccfcad8846090afb486d80a7a5a0fa519338768b12950dab2fb291f37 Test-Simple-1.302193.tar.gz" +sha512sums="b59ed1033338219cd6352f825ed3657b6dc8e2cd38ac7ccd062181b2e2076d6ba48a7d559a20f75e68718165874231c2434f3a73b78d645947d129ebf1d8b04e Test-Simple-1.302198.tar.gz" diff --git a/system/perl-test-warnings/APKBUILD b/system/perl-test-warnings/APKBUILD index 8dace4f45..357e12575 100644 --- a/system/perl-test-warnings/APKBUILD +++ b/system/perl-test-warnings/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=Test-Warnings _author=ETHER _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=0.031 +pkgver=0.033 pkgrel=0 pkgdesc="Test for warnings and the lack of them" url="https://metacpan.org/pod/Test::Warnings" @@ -31,4 +31,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="02ddd342b6aa8771dd6ea3b7385c5eb970173633d49a3535bc46c3f98a66cd6e81895fc5f38cbe23366c8fa0f96121b51a8180b0d4ef0f2d8c658bb559c72c58 Test-Warnings-0.031.tar.gz" +sha512sums="dc49e345b2b5d2dd42d83b4351025f2c0db0216ef8388b02db77d5078e5eda0b5aab1491b07a0009923acc73b30c4ef6d77d406e85b0f958f575007c6ca1e6e8 Test-Warnings-0.033.tar.gz" diff --git a/system/perl-uri/APKBUILD b/system/perl-uri/APKBUILD index 68d75e841..6213d892e 100644 --- a/system/perl-uri/APKBUILD +++ b/system/perl-uri/APKBUILD @@ -5,7 +5,7 @@ _pkgreal=URI _author=OALDERS _au=${_author%%"${_author#??}"} _a=${_author%%"${_author#?}"} -pkgver=5.17 +pkgver=5.27 pkgrel=0 pkgdesc="Perl library for URI manipulation" url="https://metacpan.org/release/URI" @@ -33,4 +33,4 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } -sha512sums="52171e16137bfaa77ab31007245a561614c5c42336473022ebbe370b395d3052d3de80da0b42754ca2e0b09f47520ef96afdbdb72fe5c25cab87441eda03ec12 URI-5.17.tar.gz" +sha512sums="5d4cdaf2baed2b15af827093e139ee22c7f87b979b5998462500b13d68966bd94be3841e9b0c4f64ef2df9ca5e258933c21f67870a671242330f296c7bef45b8 URI-5.27.tar.gz" diff --git a/system/perl/APKBUILD b/system/perl/APKBUILD index 85d1d162f..9134c50b2 100644 --- a/system/perl/APKBUILD +++ b/system/perl/APKBUILD @@ -3,7 +3,11 @@ # Contributor: Síle Ekaterin Liszka <sheila@vulpine.house> # Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org> pkgname=perl -pkgver=5.34.1 +pkgver=5.34.3 +_glver=2.57 +_glauthor=JV +_glau=${_glauthor%%"${_glauthor#??}"} +_gla=${_glauthor%%"${_glauthor#?}"} pkgrel=1 pkgdesc="Larry Wall's Practical Extraction and Report Language" url="https://www.perl.org/" @@ -18,9 +22,15 @@ source="https://www.cpan.org/src/5.0/perl-$pkgver.tar.gz musl-stack-size.patch zlib-test.patch fix-test-chris-williams-tcp-server.patch + cve-2023-31484.patch + cve-2023-31486.patch + https://cpan.metacpan.org/authors/id/$_gla/$_glau/$_glauthor/Getopt-Long-$_glver.tar.gz " # secfixes: +# 5.34.3-r0: +# - CVE-2023-31484 +# - CVE-2023-31486 # 5.34.1-r0: # - CVE-2021-36770 # 5.26.3-r0: @@ -49,6 +59,10 @@ prepare() { rm -rf cpan/Compress-Raw-Zlib/zlib-src rm -rf cpan/Compress-Raw-Bzip2/bzip2-src sed -i '/\(bzip2\|zlib\)-src/d' MANIFEST + for i in lib t; do + rm -rf cpan/Getopt-Long/$i + cp -r "$srcdir"/Getopt-Long-$_glver/$i cpan/Getopt-Long + done } build() { @@ -103,6 +117,11 @@ package() { error "files found under /usr/local" fi find "$pkgdir" -name '.*' -delete + + rm "$pkgdir"/usr/share/man/man1/prove.1 + rm "$pkgdir"/usr/share/man/man1/xsubpp.1 + rm -r "$pkgdir"/usr/share/man/man3 + rm "$pkgdir"/usr/bin/xsubpp } @@ -119,8 +138,11 @@ dev() { default_dev } -sha512sums="bf17f2c6fce1b046dce11450f28823fe5df6341f259ec351a4445768feb38706413be867a32c1fd916567657ca9f08c838030e02bb8a3bc1cd8a1350c007cf3a perl-5.34.1.tar.gz +sha512sums="d3dcabec76e4d6854d6bc1b118cb30cb2baeb329f6deb9fbe4380d446568a2982c8fb242f257da94e743760d23bbad829a228cbe3a55a1c6f4636346e6ab1933 perl-5.34.3.tar.gz a78b5fb1a2b6f60b401329cfd2d8349d4fdcc19628cde0e9b840b82e1a02e705f7d7413fe206aa13ed714ab93a65b62ac3d85dfd526ca8048621d5d89b22f0ef musl-locale.patch c004d6612ec754e5947255a2e2d15b5581f187c32495aeeec9f4fa286919bd9f40c72b63db61e3f4004b09288af2063a6a14b67e5c289e9a8b23ebd7c216e16f musl-stack-size.patch bbb2beb49604982c42c833b229852bc8bca4e3498f97fcfbb3bf7de10dddbef3b21c917f333958c64feb99a65f4093773e33018ae0e91dadeecdf985ab0ed3a2 zlib-test.patch -1cf3365942a6447083e7487e3b79e1a57d3b08dad9cadb86f44bdda3bd7882fe5d71ebb4fab12a0663d4c0d4c1566d593be10ea46ecf892926528a9ae31328b9 fix-test-chris-williams-tcp-server.patch" +1cf3365942a6447083e7487e3b79e1a57d3b08dad9cadb86f44bdda3bd7882fe5d71ebb4fab12a0663d4c0d4c1566d593be10ea46ecf892926528a9ae31328b9 fix-test-chris-williams-tcp-server.patch +dd60c8db64f648a88aaaca0eb4e6cd4b29e9bf47f92cac54958c1d12573fe8181eb5da2144650c15da7f8e59a06243ac859ec57be5c0e5fd88fc7ec1b1982083 cve-2023-31484.patch +89195c2398196f1730b9dfc3adb87694007bb5f3b663d058056d323388e7858c8201aaddd733b1dbeaf4a5cc0989a39b78177897ee144c35ffb66bc30616eef4 cve-2023-31486.patch +6b07f683b6f1371bc7f9b018ec659c049d58de25194965c6e2ba3a288e6802ba07257aa5d447bc082f0481d0956798d9f17521faf6a31d896bb3be0d17953b49 Getopt-Long-2.57.tar.gz" diff --git a/system/perl/cve-2023-31484.patch b/system/perl/cve-2023-31484.patch new file mode 100644 index 000000000..8e2b71fea --- /dev/null +++ b/system/perl/cve-2023-31484.patch @@ -0,0 +1,11 @@ +diff '--color=auto' -Nurd perl-5.34.3/cpan/CPAN/lib/CPAN/HTTP/Client.pm perl-5.34.3.new/cpan/CPAN/lib/CPAN/HTTP/Client.pm +--- perl-5.34.3/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-11-28 03:57:18.000000000 -0800 ++++ perl-5.34.3.new/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-12-01 20:31:22.921302476 -0800 +@@ -32,6 +32,7 @@ + + my $want_proxy = $self->_want_proxy($uri); + my $http = HTTP::Tiny->new( ++ verify_SSL => 1, + $want_proxy ? (proxy => $self->{proxy}) : () + ); + diff --git a/system/perl/cve-2023-31486.patch b/system/perl/cve-2023-31486.patch new file mode 100644 index 000000000..fe7689447 --- /dev/null +++ b/system/perl/cve-2023-31486.patch @@ -0,0 +1,84 @@ +From 1490431e40e22052f75a0b3449f1f53cbd27ba92 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Thu, 21 May 2020 22:53:37 +0100 +Subject: [PATCH] Enable SSL by default in HTTP::Tiny + +Gbp-Pq: Topic debian +Gbp-Pq: Name http-tiny-ssl.diff +--- + cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +index 5803e4599..88ba51461 100644 +--- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm ++++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +@@ -40,7 +40,7 @@ sub _croak { require Carp; Carp::croak(@_) } + #pod * C<timeout> — Request timeout in seconds (default is 60) If a socket open, + #pod read or write takes longer than the timeout, an exception is thrown. + #pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL +-#pod certificate of an C<https> — connection (default is false) ++#pod certificate of an C<https> — connection (default is true) + #pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to + #pod L<IO::Socket::SSL> + #pod +@@ -112,7 +112,7 @@ sub new { + max_redirect => 5, + timeout => defined $args{timeout} ? $args{timeout} : 60, + keep_alive => 1, +- verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default ++ verify_SSL => $args{verify_SSL} // $args{verify_ssl} // 1, # verification by default + no_proxy => $ENV{no_proxy}, + }; + +@@ -1038,7 +1038,7 @@ sub new { + timeout => 60, + max_line_size => 16384, + max_header_lines => 64, +- verify_SSL => 0, ++ verify_SSL => 1, + SSL_options => {}, + %args + }, $class; +@@ -1765,7 +1765,7 @@ C<timeout> — Request timeout in seconds (default is 60) If a socket open, read + + =item * + +-C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is false) ++C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is true) + + =item * + +@@ -2035,7 +2035,7 @@ Verification of server identity + + =back + +-B<By default, HTTP::Tiny does not verify server identity>. ++B<By default, HTTP::Tiny verifies server identity. + + Server identity verification is controversial and potentially tricky because it + depends on a (usually paid) third-party Certificate Authority (CA) trust model +@@ -2043,16 +2043,14 @@ to validate a certificate as legitimate. This discriminates against servers + with self-signed certificates or certificates signed by free, community-driven + CA's such as L<CAcert.org|http://cacert.org>. + +-By default, HTTP::Tiny does not make any assumptions about your trust model, +-threat level or risk tolerance. It just aims to give you an encrypted channel +-when you need one. +- + Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify + that an SSL connection has a valid SSL certificate corresponding to the host + name of the connection and that the SSL certificate has been verified by a CA. + Assuming you trust the CA, this will protect against a L<man-in-the-middle +-attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. If you are +-concerned about security, you should enable this option. ++attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. ++ ++If you are not concerned about security, and this default causes problems, ++you should disable this option. + + Certificate verification requires a file containing trusted CA certificates. + +-- +GitLab + diff --git a/system/python3/fix-xattrs-glibc.patch b/system/python3/fix-xattrs-glibc.patch deleted file mode 100644 index da0c6e3cb..000000000 --- a/system/python3/fix-xattrs-glibc.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -ur a/Modules/posixmodule.c b/Modules/posixmodule.c ---- a/Modules/posixmodule.c 2022-01-11 11:45:55.120000000 +0000 -+++ b/Modules/posixmodule.c 2022-01-11 11:47:28.010000000 +0000 -@@ -272,8 +272,9 @@ - # undef HAVE_SCHED_SETAFFINITY - #endif - --#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) -+#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) - # define USE_XATTRS -+# include <linux/limits.h> - #endif - - #ifdef USE_XATTRS diff --git a/system/s6-linux-init/APKBUILD b/system/s6-linux-init/APKBUILD index 0601b593b..973037509 100644 --- a/system/s6-linux-init/APKBUILD +++ b/system/s6-linux-init/APKBUILD @@ -1,19 +1,26 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=s6-linux-init -pkgver=1.1.0.0 -pkgrel=0 +pkgver=1.1.2.0 +pkgrel=2 pkgdesc="A s6-based init system" -url="https://skarnet.org/software/$pkgname/" +url="https://skarnet.org/software/s6-linux-init/" arch="all" options="!check" # No test suite. license="ISC" -_skalibs_version=2.13 -_s6_version=2.11.3.0 +_skalibs_version=2.14 +_s6_version=2.12 depends="execline s6>=$_s6_version s6-linux-init-common" -makedepends="skalibs-dev>=$_skalibs_version execline-dev s6-dev utmps-dev" -subpackages="$pkgname-common:common:noarch $pkgname-early-getty:earlygetty:noarch $pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc" -source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz rc.init runlevel rc.shutdown reboot.sh earlygetty.run" +depends_dev="skalibs-dev>=$_skalibs_version" +makedepends="$depends_dev execline-dev s6-dev utmps-dev" +subpackages=" + $pkgname-common:common:noarch + $pkgname-early-getty:earlygetty:noarch + $pkgname-dracut:dracut:noarch + $pkgname-libs + $pkgname-dev + $pkgname-doc" +source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz rc.init runlevel rc.shutdown reboot.sh earlygetty.run dracut_module.sh" install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall" provides="/sbin/init=0" @@ -52,10 +59,11 @@ package() { -s /run/kernel_env \ -f "$pkgdir/etc/s6-linux-init/skel" \ -- "$pkgdir/etc/s6-linux-init/current" - mkdir -p -m 0755 "$pkgdir/sbin" "$pkgdir/etc/runlevels/empty" + mkdir -p -m 0755 "$pkgdir/sbin" "$pkgdir/etc/runlevels/empty" "$pkgdir/usr/share/doc" for i in init halt poweroff reboot shutdown telinit ; do ln -sf "../etc/s6-linux-init/current/bin/$i" "$pkgdir/sbin/$i" done + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } @@ -85,43 +93,16 @@ earlygetty() { chmod 0755 "$subsvcimg/s6-linux-init-early-getty/run" } - -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="skalibs-libs>=$_skalibs_version" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - - -dev() { - pkgdesc="$pkgdesc (development files)" - depends="skalibs-dev>=$_skalibs_version" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr" - mv "$pkgdir/usr/lib" "$pkgdir/usr/include" "$subpkgdir/usr/" -} - - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" +dracut() { + pkgdesc="$pkgdesc (Dracut module)" + install_if="$pkgname=$pkgver-r$pkgrel dracut" + install -D -m755 "$srcdir"/dracut_module.sh "$subpkgdir"/usr/lib/dracut/modules.d/99s6li/module-setup.sh } -sha512sums="4d96a7e9786c085445970290bdb77d763b912f8405fa2ca5ccd01c31e18bee67ca4b420f222a7ea599376a9ab4a89269cb7756ef15138b191168bfd01366c3a6 s6-linux-init-1.1.0.0.tar.gz +sha512sums="76376c4d407e665f67f733f1366dbacca58d268ebdbe22a9147cb102d519bd4c5887a345f66db2005d29ed9a841cb5a388c73c7d8df00d984cc4a25b9a813786 s6-linux-init-1.1.2.0.tar.gz 756b0cbbe5dabb4631380c3c7ea199cc213224b2e36e50a2d012a61948170078b78bf49b85d886319fecf59843087f937d3d804723b2553ac9f94d088a2f0fd8 rc.init e73c3c32b118831074288d23fadace2158a2b15d5a13ffa73290b92a9e39c2a21c73d3b0eabea29bcbaa5f6381611fd8d0aaa6aa691ec7de91b8ef6ae404b6da runlevel 7bb050248a5c2ab6a56c50c35f87cde724f97ff9882f5e60b0f0f2f14bd93c1df7d99fedc3d81c8519cf1a1ed90e03f1cbb9bf891c7b3618aa9a5f5738d262f4 rc.shutdown 6fb2a1112988fd2322b4bc4862bfb948a1c2e43921c5d01ae873c0d31b39fe74fc2934a5018c08b1704a2b2199b31d3a3d7365be369bba734f153b74e000aa74 reboot.sh -dfff483b61370ce2c8fe653cb4e9b6ec7ef678f26b128eab8e677548a48b668b532b12a2e4618c85bf95777a666ac30189780708803d6ea12e43ab0072399212 earlygetty.run" +dfff483b61370ce2c8fe653cb4e9b6ec7ef678f26b128eab8e677548a48b668b532b12a2e4618c85bf95777a666ac30189780708803d6ea12e43ab0072399212 earlygetty.run +a62cf543e64aaf24f16c0e3d23497890de7a4a621c9d8f93c447001ea56a21324046ee589188d11b3d4dbfea4a707b5a1889d2b703c00ea6a81207a0442f9799 dracut_module.sh" diff --git a/system/s6-linux-init/dracut_module.sh b/system/s6-linux-init/dracut_module.sh new file mode 100755 index 000000000..106025ca7 --- /dev/null +++ b/system/s6-linux-init/dracut_module.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# called by dracut +check() { + return 0 +} + +# called by dracut +depends() { + return 0 +} + +# called by dracut +install() { + inst /bin/s6-linux-init-hpr +} + diff --git a/system/s6-rc/APKBUILD b/system/s6-rc/APKBUILD index 04453992b..6fbcf44e1 100644 --- a/system/s6-rc/APKBUILD +++ b/system/s6-rc/APKBUILD @@ -1,18 +1,19 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=s6-rc -pkgver=0.5.4.1 +pkgver=0.5.4.3 pkgrel=0 pkgdesc="skarnet.org's service manager, working on top of s6" url="https://skarnet.org/software/s6-rc/" arch="all" options="!check" license="ISC" -_skalibs_version=2.13 -_s6_version=2.11 +_skalibs_version=2.14 +_s6_version=2.12 depends="execline" -makedepends="skalibs-dev>=$_skalibs_version execline-dev s6-dev>=$_s6_version" -subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc" +depends_dev="skalibs-dev>=$_skalibs_version s6-dev>=$_s6_version" +makedepends="$depends_dev execline-dev" +subpackages="$pkgname-dev $pkgname-libs $pkgname-doc" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz" build() { @@ -29,41 +30,8 @@ build() { package() { make DESTDIR="$pkgdir" install + mkdir -p -m 0755 "$pkgdir/usr/share/doc" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } - -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="skalibs-libs>=$_skalibs_version s6-libs>=$_s6_version" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - - -dev() { - pkgdesc="$pkgdesc (development files)" - depends="skalibs-dev>=$_skalibs_version s6-dev>=$_s6_version" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/include" "$subpkgdir/usr/lib" - mv "$pkgdir/usr/include" "$subpkgdir/usr/" - mv "$pkgdir"/usr/lib/*.a "$subpkgdir/usr/lib/" -} - - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" -} - -sha512sums="6b61df9fa1d9bd24430bab4c11bfba009ca79c62a32dd2db3b79a1057645da9f92db4058c66c35bb068d805d958bfdf024399d240559dfdee62f9a6a30cf2086 s6-rc-0.5.4.1.tar.gz" +sha512sums="7a54a32ea1261de79b9494adde74b50dbefce831f5a00f9d3772c9b64fd71918ce54a16dff828de0fb762633255226ca935357f9f31c4264716b7041a5f5f8bb s6-rc-0.5.4.3.tar.gz" diff --git a/system/s6/APKBUILD b/system/s6/APKBUILD index 1c7891d2c..52c462154 100644 --- a/system/s6/APKBUILD +++ b/system/s6/APKBUILD @@ -1,18 +1,19 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=s6 -pkgver=2.11.3.0 +pkgver=2.13.0.0 pkgrel=0 pkgdesc="skarnet.org's small & secure supervision software suite" -url="https://skarnet.org/software/$pkgname/" +url="https://skarnet.org/software/s6/" arch="all" options="!check" # No test suite. license="ISC" -_skalibs_version=2.13.1 +_skalibs_version=2.14.1 depends="execline" -makedepends="skalibs-dev>=$_skalibs_version execline-dev" +depends_dev="skalibs-dev>=$_skalibs_version" +makedepends="$depends_dev execline-dev" install="$pkgname.post-upgrade" -subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc" +subpackages="$pkgname-dev $pkgname-libs $pkgname-doc" triggers="$pkgname.trigger=/run/service" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz" @@ -30,41 +31,8 @@ build() { package() { make DESTDIR="$pkgdir" install - mkdir -p -m 0755 "$pkgdir/var/lib/s6/services" + mkdir -p -m 0755 "$pkgdir/var/lib/s6/services" "$pkgdir/usr/share/doc" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } - -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="skalibs-libs>=$_skalibs_version" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - - -dev() { - pkgdesc="$pkgdesc (development files)" - depends="skalibs-dev>=$_skalibs_version" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr" - mv "$pkgdir/usr/lib" "$pkgdir/usr/include" "$subpkgdir/usr/" -} - - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" -} - -sha512sums="764981bb54c6add6bff7c77b41c6c61055fd8b9ba284c7b41e13e4103c8d5a3dddd442145d8eb572e5be6883ab6a9e3025c064d946e8e273e956d404528c5479 s6-2.11.3.0.tar.gz" +sha512sums="b54d334496d79d1b845552f5e7763c536d6f253c9bb2d61802695ea1a596af918562daa230f09f4cbfc06614eff70930d0963439d7d84ec8ae0388291912ca9d s6-2.13.0.0.tar.gz" diff --git a/system/s6/s6.post-upgrade b/system/s6/s6.post-upgrade index 54144895b..91459ad9f 100644 --- a/system/s6/s6.post-upgrade +++ b/system/s6/s6.post-upgrade @@ -1,3 +1,16 @@ #!/bin/sh -e rm -f /etc/runlevels/default/s6 + +vnew="$1" +vold="$2" + +if test `apk version -t $vnew 2.13` != '<' && test `apk version -t $vold 2.13` = '<' ; then + echo + echo '***' + echo 'The s6 package has undergone an ABI change.' + echo 'Please reboot at your earliest convenience. Commands such as s6-svstat' + echo 'may not work until you do so.' + echo '***' + echo +fi diff --git a/system/scdoc/APKBUILD b/system/scdoc/APKBUILD new file mode 100644 index 000000000..d496dce6a --- /dev/null +++ b/system/scdoc/APKBUILD @@ -0,0 +1,24 @@ +# Contributor: A. Wilcox <awilfox@adelielinux.org> +# Maintainer: A. Wilcox <awilfox@adelielinux.org> +pkgname=scdoc +pkgver=1.11.2 +pkgrel=0 +pkgdesc="Small man page generator" +url="https://git.sr.ht/~sircmpwn/scdoc" +arch="all" +license="MIT" +options="!check" # No test suite. +depends="" +makedepends="" +subpackages="$pkgname-doc" +source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/scdoc/archive/$pkgver.tar.gz" + +build() { + make PREFIX=/usr +} + +package() { + make PREFIX=/usr DESTDIR=$pkgdir install +} + +sha512sums="3fbf1a74b222dd88410636124e4b6ca73f7e77f67d512cf430a878fefcaa5c6c13a1e9f6c0c9654de15353f94bb1bd528665acebc2293bebb325501d1eb6cda3 scdoc-1.11.2.tar.gz" diff --git a/system/sharutils/APKBUILD b/system/sharutils/APKBUILD index 67b264b53..7d74c1743 100644 --- a/system/sharutils/APKBUILD +++ b/system/sharutils/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=sharutils pkgver=4.15.2 -pkgrel=2 +pkgrel=3 pkgdesc="Utilities for manipulating shell archives" url="https://www.gnu.org/software/sharutils/" arch="all" @@ -11,7 +11,9 @@ depends="bzip2" makedepends_build="texinfo" subpackages="$pkgname-lang $pkgname-doc" source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz - CVE-2018-1000097.patch" + CVE-2018-1000097.patch + modern-gcc.patch + " # secfixes: # 4.15.2-r2: @@ -40,4 +42,5 @@ package() { } sha512sums="80d0b804a0617e11e5c23dc0d59b218bbf93e40aaf5e9a5401a18ef9cb700390aab711e2b2e2f26c8fd5b8ef99a91d3405e01d02cadabcba7639979314e59f8d sharutils-4.15.2.tar.xz -6415da74c4f6f203bc4ad617bd05fa6ac86e1079538236148763e0b5e81ca8ea4004ea58e9e4755ba371246a7c469ef1e421576260494043d3ce3fc80e73cf69 CVE-2018-1000097.patch" +6415da74c4f6f203bc4ad617bd05fa6ac86e1079538236148763e0b5e81ca8ea4004ea58e9e4755ba371246a7c469ef1e421576260494043d3ce3fc80e73cf69 CVE-2018-1000097.patch +3938bd255cbc62953a8c2888525e0b8932df0df2628efbda285ba85ae2037fd1e32b6015f89663452c1d566fb7e27e648c0be4141a4c327e9744c07c86b523fd modern-gcc.patch" diff --git a/system/sharutils/modern-gcc.patch b/system/sharutils/modern-gcc.patch new file mode 100644 index 000000000..b42e0a7fb --- /dev/null +++ b/system/sharutils/modern-gcc.patch @@ -0,0 +1,47 @@ +Upstream-URL: https://savannah.gnu.org/bugs/index.php?65790 +Upstream-Status: Pending + +--- sharutils-4.15.2/src/shar-opts.h.old 2015-05-30 10:34:12.000000000 -0500 ++++ sharutils-4.15.2/src/shar-opts.h 2024-05-25 12:36:29.126495658 -0500 +@@ -352,7 +352,7 @@ + * global exported definitions + */ + #include "local.h" +-char const * const program_name; ++extern char const * const program_name; + + extern bool initialization_done; + extern int optidx; +--- sharutils-4.15.2/src/unshar-opts.h.old 2015-05-30 10:34:18.000000000 -0500 ++++ sharutils-4.15.2/src/unshar-opts.h 2024-05-25 12:36:07.748789737 -0500 +@@ -192,7 +192,7 @@ + extern size_t separator_str_len; + + #include "local.h" +-char const * const program_name; ++extern char const * const program_name; + + + /* * * * * * +--- sharutils-4.15.2/src/uudecode-opts.h.old 2015-05-30 10:34:21.000000000 -0500 ++++ sharutils-4.15.2/src/uudecode-opts.h 2024-05-25 12:33:58.052707656 -0500 +@@ -170,7 +170,7 @@ + * global exported definitions + */ + #include "local.h" +-char const * const program_name; ++extern char const * const program_name; + + + /* * * * * * +--- sharutils-4.15.2/src/uuencode-opts.h.old 2015-05-30 10:34:25.000000000 -0500 ++++ sharutils-4.15.2/src/uuencode-opts.h 2024-05-25 12:36:54.973721944 -0500 +@@ -166,7 +166,7 @@ + * global exported definitions + */ + #include "local.h" +-char const * const program_name; ++extern char const * const program_name; + + + /* * * * * * diff --git a/system/skalibs/APKBUILD b/system/skalibs/APKBUILD index 2076e030a..acef0c29c 100644 --- a/system/skalibs/APKBUILD +++ b/system/skalibs/APKBUILD @@ -1,14 +1,14 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=skalibs -pkgver=2.13.1.0 +pkgver=2.14.2.0 pkgrel=0 pkgdesc="A set of general-purpose C programming libraries for skarnet.org software" url="https://skarnet.org/software/skalibs/" arch="all" options="!check" # No test suite. license="ISC" -subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc" +subpackages="$pkgname-dev $pkgname-libs $pkgname-doc" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz" build() { @@ -21,40 +21,14 @@ build() { package() { make DESTDIR="$pkgdir" install + mkdir -p -m 0755 "$pkgdir/usr/share/doc" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } - -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - - dev() { - pkgdesc="$pkgdesc (development files)" - depends="" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir" - mv "$pkgdir/usr" "$subpkgdir/" -} - - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" + default_dev + mkdir -p -m 0755 "$subpkgdir/usr/lib/skalibs" + mv "$pkgdir/usr/lib/skalibs/sysdeps" "$subpkgdir/usr/lib/skalibs/" } -sha512sums="922a26f0113e22491d57aa2a577375245d70fea1478024c7130814426d978f4c18b59acbbe6a0b846a4776f0af34b966585318feb7e9b4fbcbfded459e061c9d skalibs-2.13.1.0.tar.gz" +sha512sums="b96491e6429cc69bc75f50be99b7b18769cb756c1a82f698994c23aefb16bc68ee5558076993b948a6674203ecd82a454a978c89f450c219cc2728d52b7f5656 skalibs-2.14.2.0.tar.gz" diff --git a/system/slibtool/APKBUILD b/system/slibtool/APKBUILD index a1ac2142d..06601b494 100644 --- a/system/slibtool/APKBUILD +++ b/system/slibtool/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=slibtool -pkgver=0.5.34 +pkgver=0.5.35 pkgrel=0 pkgdesc="'Skinny' library support script" url="https://dev.midipix.org/cross/slibtool" @@ -10,7 +10,7 @@ license="MIT" depends="" makedepends="m4" subpackages="" -source="https://git.foss21.org/slibtool/snapshot/$pkgname-$pkgver.tar.xz" +source="https://dl.foss21.org/slibtool/$pkgname-$pkgver.tar.xz" build() { ./configure \ @@ -21,4 +21,4 @@ build() { package() { make DESTDIR="$pkgdir" install } -sha512sums="62f976d4a05c8a6464679fc98fb8734914bb27bff9ababfcda24d7be9ff8c7d2cb43ad73569403593142059d115750d1fc45660d934f43eb5e0f206d8ed43dbe slibtool-0.5.34.tar.xz" +sha512sums="e1d2f03596432f970f8c1f93d4387cafb11355a520fb5adb9bbc02f3dcdea0bbb78ca6fe84c24faebee848279050c5bec13fd64a168b12d7fc885ac9d31a7560 slibtool-0.5.35.tar.xz" diff --git a/system/utmps/APKBUILD b/system/utmps/APKBUILD index 8ad477089..7ae3849ed 100644 --- a/system/utmps/APKBUILD +++ b/system/utmps/APKBUILD @@ -1,17 +1,18 @@ # Contributor: Laurent Bercot <ska-adelie@skarnet.org> # Maintainer: Laurent Bercot <ska-adelie@skarnet.org> pkgname=utmps -pkgver=0.1.2.1 -pkgrel=1 +pkgver=0.1.2.2 +pkgrel=2 pkgdesc="A secure utmp/wtmp implementation" -url="https://skarnet.org/software/$pkgname/" +url="https://skarnet.org/software/utmps/" arch="all" options="!check" # No test suite license="ISC" depends="execline s6" -_skalibs_version=2.13 +_skalibs_version=2.14 +depends_dev="skalibs-dev>=$_skalibs_version" makedepends="skalibs-dev>=$_skalibs_version" -subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc $pkgname-openrc" +subpackages="$pkgname-dev $pkgname-libs $pkgname-doc $pkgname-openrc" install="$pkgname.post-upgrade" source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz utmpd.run @@ -35,9 +36,10 @@ build() { package() { make DESTDIR="$pkgdir" install runimage="$pkgdir/etc/s6-linux-init/current/run-image" - mkdir -p -m 0755 "$runimage/utmps" + mkdir -p -m 0755 "$runimage/utmps" "$pkgdir/usr/share/doc" chown utmp:utmp "$runimage/utmps" - install -D -m755 "$srcdir/utmps.initd" "$pkgdir/etc/init.d/utmps" + install -D -m 0755 "$srcdir/utmps.initd" "$pkgdir/etc/init.d/utmps" + cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname" } openrc() { @@ -61,37 +63,7 @@ openrc() { ln -s ../../init.d/utmps "$rldir/utmps" } -libs() { - pkgdesc="$pkgdesc (shared libraries)" - depends="skalibs-libs>=$_skalibs_version" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/" -} - -dev() { - pkgdesc="$pkgdesc (development files)" - depends="skalibs-dev>=$_skalibs_version" - install_if="dev $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr" - mv "$pkgdir/usr/lib" "$pkgdir/usr/include" "$subpkgdir/usr/" -} - -libsdev() { - pkgdesc="$pkgdesc (development files for dynamic linking)" - depends="$pkgname-dev" - mkdir -p "$subpkgdir/lib" - mv "$pkgdir"/lib/*.so "$subpkgdir/lib/" -} - -doc() { - pkgdesc="$pkgdesc (documentation)" - depends="" - install_if="docs $pkgname=$pkgver-r$pkgrel" - mkdir -p "$subpkgdir/usr/share/doc" - cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname" -} - -sha512sums="20bf9bfabfdd390377ca86d85da4a263a027ee5bdf5b7305bc6fb44d4aea7b4af886580f485d543895f85fb61d4f0ac711afba342a911c5ef928076c35746134 utmps-0.1.2.1.tar.gz +sha512sums="57a73658ecb947af9dfad7a5e2931660ad1b8fa61d36c803c373e8aba13e9afa8398c1522765f5ea2b5df87d942cea17062faf30f589afa6acc744ff3ae4a409 utmps-0.1.2.2.tar.gz 0ec30284c64c6ea9f25142c5f4a643bd48b137fe85781b650104f5137ffa4dfc35ca7be3e41e3acd3403ebe1d8c5378073afa4e2f3607d3d794fcd9f98ed51c4 utmpd.run 9e875a5cd37be531320a8e582afed2c980dd0a1bdfc2f6f3d826d5e5389fc6ab93f973ed1506edb23f4c73cf24a2357aefe856148eaacff86c2aafe376c575e2 wtmpd.run 503bdbb3d244243934b9b4e3deea0bf92a95f88417c822ad9cf6202584d4724d5e182a0d88d7f09069e435a8a97230b85d2b264736c85c893da193fd5ec34c71 btmpd.run diff --git a/system/vim/APKBUILD b/system/vim/APKBUILD index ae8aa1e31..0023238ee 100644 --- a/system/vim/APKBUILD +++ b/system/vim/APKBUILD @@ -4,7 +4,7 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house> pkgname=vim -pkgver=9.0.1385 +pkgver=9.1.0378 _pkgver=${pkgver%.*.*}${pkgver#*.} _pkgver=${_pkgver%.*} pkgrel=0 @@ -23,6 +23,22 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$ builddir="$srcdir/$pkgname-$pkgver" # secfixes: +# 9.1.0148-r0: +# - CVE-2023-4752 +# - CVE-2023-4781 +# - CVE-2023-5344 +# - CVE-2023-5441 +# - CVE-2023-5535 +# - CVE-2023-46246 +# - CVE-2023-48231 +# - CVE-2023-48232 +# - CVE-2023-48233 +# - CVE-2023-48234 +# - CVE-2023-48235 +# - CVE-2023-48236 +# - CVE-2023-48237 +# - CVE-2023-48706 +# - CVE-2024-22667 # 9.0.1385-r0: # - CVE-2023-0049 # - CVE-2023-0051 @@ -86,5 +102,5 @@ vimdiff() { mv "$pkgdir"/usr/bin/vimdiff "$subpkgdir"/usr/bin } -sha512sums="807f53451a5d6a38eb35c1a79c8dbd7a54e74b6e3f4f93099900579668254948231c56a97bcd9cbb3d9ba4f63a8042062395351dcfb23fd7e390f8d8eb97c106 vim-9.0.1385.tar.gz +sha512sums="d1c31de1e39bd3504a462aa324b699bb81ff11717171529047e5518c9bb2aec651b0b40a18b66f4df92a1b2065abc68a523df61681f32228839e69ba0f383e6b vim-9.1.0378.tar.gz 12ee3f96c94d74215159fba379ed61907ec5982a9f1643575dcb7c3d5e30824665d683de95f97b5067718b3f2a1238fb7534a70803bc170614498ad026f352d8 vimrc" diff --git a/system/zlib/APKBUILD b/system/zlib/APKBUILD index fac869fb3..610e98329 100644 --- a/system/zlib/APKBUILD +++ b/system/zlib/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Zach van Rijn <me@zv.io> pkgname=zlib -pkgver=1.3 +pkgver=1.3.1 pkgrel=0 pkgdesc="A compression/decompression Library" arch="all" @@ -29,4 +29,4 @@ package() { DESTDIR="$pkgdir" } -sha512sums="185795044461cd78a5545250e06f6efdb0556e8d1bfe44e657b509dd6f00ba8892c8eb3febe65f79ee0b192d6af857f0e0055326d33a881449f3833f92e5f8fb zlib-1.3.tar.gz" +sha512sums="580677aad97093829090d4b605ac81c50327e74a6c2de0b85dd2e8525553f3ddde17556ea46f8f007f89e435493c9a20bc997d1ef1c1c2c23274528e3c46b94f zlib-1.3.1.tar.gz" |