From 223093d95abfc2b2161105f2ef73a8287c687d95 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 28 Feb 2019 23:20:33 +0000 Subject: system/gcc: bump to 8.3.0 These patches have been forward-ported to 8: 002_all_default-relro.patch 005_all_default-as-needed.patch 011_all_default-warn-format-security.patch 012_all_default-warn-trampolines.patch We are no longer using fortify-headers, so these patches are no longer needed: 003_all_default-fortify-source.patch 050_all_libiberty-asprintf.patch 053_all_libitm-no-fortify-source.patch These patches no longer appear necessary: 067_all_gcc-poison-system-directories.patch 090_all_pr55930-dependency-tracking.patch 201-cilkrts.patch 203-libgcc_s.patch 207-static-pie.patch These patches have already been applied upstream: 204-linux_libc_has_function.patch 332-gccgo-remove-ustat.patch ada-aarch64-multiarch.patch ada-fixes.patch boehm-gc-musl.patch fix-rs6000-pie.patch gcc-4.8-build-args.patch lra-pentium.patch These patches are no longer necessary because GCJ has been removed: 310-build-gcj-s390x.patch fix-gcj-iconv-musl.patch fix-gcj-musl.patch fix-gcj-stdgnu14-link.patch The rest of the changes are updates from nsz's patchset. --- system/gcc/APKBUILD | 174 ++++++++++------------------------------------------ 1 file changed, 31 insertions(+), 143 deletions(-) (limited to 'system/gcc/APKBUILD') diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD index 7da594e20..e831d2604 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -1,21 +1,22 @@ # Maintainer: Adelie Platform Group pkgname=gcc -pkgver=6.4.0 -_ecjver=4.9 +pkgver=8.3.0 [ "$BOOTSTRAP" = "nolibc" ] && pkgname="gcc-pass2" [ "$CBUILD" != "$CHOST" ] && _cross="-$CARCH" || _cross="" [ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target="" pkgname="$pkgname$_target" -pkgrel=10 +pkgrel=0 pkgdesc="The GNU Compiler Collection" url="https://gcc.gnu.org" arch="all" license="GPL-3.0+ AND LGPL-2.1+" _gccrel=$pkgver-r$pkgrel depends="binutils$_target isl" -makedepends_build="gcc$_cross g++$_cross paxmark bison flex texinfo zip gmp-dev mpfr-dev mpc1-dev zlib-dev" -makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev libucontext-dev" +makedepends_build="gcc$_cross g++$_cross bison flex texinfo zip gmp-dev + mpfr-dev mpc1-dev zlib-dev" +makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev + libucontext-dev" subpackages=" " [ "$CHOST" = "$CTARGET" ] && subpackages="gcc-doc$_target gcc-lang$_target" replaces="libstdc++ binutils" @@ -23,7 +24,6 @@ options="$options !check !dbg strip toolchain" : ${LANG_CXX:=true} : ${LANG_OBJC:=true} -: ${LANG_JAVA:=true} : ${LANG_GO:=true} : ${LANG_FORTRAN:=true} : ${LANG_ADA:=false} @@ -43,7 +43,6 @@ if [ "$CHOST" != "$CTARGET" ]; then _builddir="$srcdir/build-cross-final" fi LANG_OBJC=false - LANG_JAVA=false LANG_GO=false LANG_FORTRAN=false LIBGOMP=false @@ -80,7 +79,6 @@ elif [ "$CBUILD" != "$CHOST" ]; then # Languages that do not need bootstrapping LANG_OBJC=false - LANG_JAVA=false LANG_GO=false LANG_FORTRAN=false @@ -124,10 +122,6 @@ if $LANG_OBJC; then subpackages="$subpackages libobjc::$CTARGET_ARCH gcc-objc$_target:objc" _languages="$_languages,objc" fi -if $LANG_JAVA; then - subpackages="$subpackages libgcj::$CTARGET_ARCH gcc-java$_target:java" - _languages="$_languages,java" -fi if $LANG_GO; then subpackages="$subpackages libgo::$CTARGET_ARCH gcc-go$_target:go" _languages="$_languages,go" @@ -144,54 +138,40 @@ fi makedepends="$makedepends_build $makedepends_host" source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz - https://sourceware.org/pub/java/ecj-$_ecjver.jar + + 0002-posix_memalign.patch + 0008-s390x-muslldso.patch + 0009-microblaze-pr65649.patch + 0010-ldbl128-config.patch + 0011-m68k.patch + 0012-static-pie.patch 001_all_default-ssp-strong.patch 002_all_default-relro.patch - 003_all_default-fortify-source.patch 005_all_default-as-needed.patch 011_all_default-warn-format-security.patch 012_all_default-warn-trampolines.patch 020_all_msgfmt-libstdc++-link.patch - 050_all_libiberty-asprintf.patch 051_all_libiberty-pic.patch - 053_all_libitm-no-fortify-source.patch - 067_all_gcc-poison-system-directories.patch - 090_all_pr55930-dependency-tracking.patch - 201-cilkrts.patch - 203-libgcc_s.patch - 204-linux_libc_has_function.patch 205-nopie.patch - 207-static-pie.patch libgcc-always-build-gcceh.a.patch gcc-4.9-musl-fortify.patch gcc-6.1-musl-libssp.patch - boehm-gc-musl.patch gcc-pure64.patch - fix-gcj-stdgnu14-link.patch - fix-gcj-musl.patch - fix-gcj-iconv-musl.patch - gcc-4.8-build-args.patch fix-cxxflags-passing.patch - ada-fixes.patch ada-shared.patch ada-musl.patch - ada-aarch64-multiarch.patch - 300-main-gcc-add-musl-s390x-dynamic-linker.patch - 310-build-gcj-s390x.patch 320-libffi-gnulinux.patch 330-gccgo-link-to-ucontext.patch 331-gccgo-use-real-off_t-type.patch - 332-gccgo-remove-ustat.patch + 332-gccgo-sysinfo.patch + 333-gccgo-signal-ppc64.patch - fix-rs6000-pie.patch add-classic_table-support.patch - lra-pentium.patch - gcc-5.4.0-locale.patch " @@ -221,12 +201,7 @@ prepare() { return 1 fi - # see http://gcc.gnu.org/ml/java/2008-04/msg00027.html - mv "$srcdir"/ecj-*.jar ecj.jar - echo ${pkgver} > gcc/BASE-VER - echo "UNSUPPORTED=1" > libcilkrts/configure.tgt - rm libgo/go/syscall/libcall_linux_ustat.go } build() { @@ -336,14 +311,6 @@ package() { ln -s gcc "$pkgdir"/usr/bin/cc - # we dont support gcj -static - # and saving 35MB is not bad. - find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \ - -o -name libgjsmalsa.a -o -name libgcj-tools.a \ - -o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \ - -o -name libjavamath.a \ - | xargs rm -f - # strip debug info from some static libs ${STRIP_FOR_TARGET} -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \ -o -name libmudflap.a -o -name libmudflapth.a \ @@ -352,11 +319,6 @@ package() { -o -name libatomic.a -o -name libasan.a -o -name libtsan.a \) \ -a -type f` - if $LANG_JAVA; then - sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \ - "$pkgdir"/usr/lib/libgcj.spec - fi - if $LIBGOMP; then mv "$pkgdir"/usr/lib/libgomp.spec "$pkgdir"/$_gcclibdir fi @@ -374,8 +336,6 @@ package() { mv "$i" "$pkgdir"/usr/share/gdb/python/auto-load/usr/$gdblib/ done - paxmark -pmrs "$pkgdir"/$_gcclibexec/cc1 - # move ada runtime libs if $LANG_ADA; then for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do @@ -429,7 +389,6 @@ gpp() { "$subpkgdir"/usr/${_target:+$CTARGET/}lib \ mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/" - paxmark -pmrs "$subpkgdir/$_gcclibexec/cc1plus" mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/*++* "$subpkgdir"/usr/${_target:+$CTARGET/}lib/ mv "$pkgdir"/usr/${_target:+$CTARGET/}include/c++ "$subpkgdir"/usr/${_target:+$CTARGET/}include/ @@ -473,65 +432,6 @@ libgomp() { mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/ } -java() { - pkgdesc="Java support for GCC" - depends="zlib-dev gcc=$_gccrel libgcj=$_gccrel" - - paxmark -pm "$pkgdir"/$_gcclibexec/ecj1 - mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib "$subpkgdir"/$_gcclibdir/ - cd "$pkgdir"/usr/bin - mv *gcj *gcj-dbtool *gjavah *gcjh *jcf-dump "$subpkgdir"/usr/bin/ - cd "$pkgdir" - for i in $(find usr/ -name ecj1 -o -name jc1 -o -name jvgenmain); do - mkdir -p "$subpkgdir"/${i%/*} - mv "$pkgdir"/$i "$subpkgdir"/$i - done - for i in "$pkgdir"/usr/lib/libgcj*.so; do - if [ -L "$i" ]; then - mv "$i" "$subpkgdir"/usr/lib/ - fi - done - mkdir -p "$subpkgdir"/usr/share/gcc-6.4.0/python - mv "$pkgdir"/usr/share/gcc-6.4.0/python/libjava \ - "$subpkgdir"/usr/share/gcc-6.4.0/python - mv "$pkgdir"/usr/lib/libgij.so "$subpkgdir"/usr/lib/ - mv "$pkgdir"/usr/lib/libgcj.spec "$subpkgdir"/$_gcclibdir/ -} - -libgcj() { - pkgdesc="Java runtime library for gcc" - # libgcj_bc.so moved from gcc-java to libgcj - replaces="gcc-java" - depends= - - mkdir -p "$subpkgdir"/usr/bin - cd "$pkgdir"/usr/bin - paxmark -pmse "$pkgdir"/usr/bin/gij - mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\ - gnative2ascii gorbd grmic grmid grmiregistry gserialver \ - gtnameserv jv-convert rebuild-gcj-db \ - "$subpkgdir"/usr/bin/ - cd "$pkgdir" - for i in $(find usr/lib -name jc1 -o -name jvgenmain); do - mkdir -p "$subpkgdir"/${i%/*} - mv "$pkgdir"/$i "$subpkgdir"/$i - done - mkdir -p "$subpkgdir"/usr/lib - mv "$pkgdir"/usr/lib/gcj-* \ - "$pkgdir"/usr/lib/libgcj_bc.so \ - "$pkgdir"/usr/lib/libgcj*.so.* \ - "$pkgdir"/usr/lib/libgij.so.* \ - "$pkgdir"/usr/lib/logging.properties \ - "$pkgdir"/usr/lib/security \ - "$subpkgdir"/usr/lib/ - - mkdir -p "$subpkgdir"/usr/lib/pkgconfig - mv "$pkgdir"/usr/lib/pkgconfig/libgcj* "$subpkgdir"/usr/lib/pkgconfig/ - - mkdir -p "$subpkgdir"/usr/share/ - mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/ -} - libgo() { pkgdesc="Go runtime library for GCC" depends= @@ -553,11 +453,13 @@ go() { mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/ mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/ + mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/ mv "$pkgdir"/usr/lib/libgo.a \ "$pkgdir"/usr/lib/libgo.so \ "$pkgdir"/usr/lib/libgobegin.a \ "$pkgdir"/usr/lib/libgolibbegin.a \ - "$pkgdir"/usr/lib/libnetgo.a \ "$subpkgdir"/usr/lib/ } @@ -622,46 +524,32 @@ gnat() { mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/ } -sha512sums="02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 gcc-6.4.0.tar.xz -28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar +sha512sums="1811337ae3add9680cec64968a2509d085b6dc5b6783fc1e8c295e3e47416196fd1a3ad8dfe7e10be2276b4f62c357659ce2902f239f60a8648548231b4b5802 gcc-8.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 +45d5bc11a89e5af77503ca06eec52d6d84e6fea0be021aaee1bcc39f8dd3c7b4baa4200cfa2b0688faa0f207d005db89c029eff32f362207aa3d2365b2f2363e 0012-static-pie.patch a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch -e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch -f86466c62b8291fac46f9c250c7ad8fa5ab7b1cce2504442fd07ddc4543665b317ae28951f244e39aba29aeaf3fff252ec4f6a147aa16adb2b7aed747dd89188 003_all_default-fortify-source.patch -51282fea54c7e616367bbeb2479ba13fec6f24eb47bd04e2071907b3b36273b2ff24676f46ef8d22f241c8ab4857307861eee076eab66797c3a50a8ecaa1809a 005_all_default-as-needed.patch -3398386dd1e079d6545dd9799adc799c6b80e3984fac6899d0e1a7ee21b66d0c7e53cddf17a65d590c883db750f9f79aaedd857355a8b9f7fb9476c906237919 011_all_default-warn-format-security.patch -9adb0d2b9b67dd957df6c609b8714c7c078efb52cd88770905c37c67827be8fc83d1125037b9c29d77db21ce78756aa2bb0bacdb0b98d869ac126da76a298e21 012_all_default-warn-trampolines.patch +625c02e03c2f1db04da12cc6a086ec85790a031a13df36486243fd9569cd17f7c8ebeec91ac16cc1f87c3ec1ffe4c421153e98a9aeb5eea35943a6f015d81f50 002_all_default-relro.patch +02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch +622fdbcbbf2feb86bd839af627ec3613c6d2c77b14d37d31165b19f73f45b3663a203efff5d224f194edb15eb62d3d5885e32f85d1b584f071e580fea4e12664 011_all_default-warn-format-security.patch +03cddde56b2a355f08716c8efcd5616606d42946c87831d77d55570636c46e351e81a04c7dabd3466d9406c40476bead857cfe1eceaf7f0d86dd2757c8cf4a9e 012_all_default-warn-trampolines.patch d35a3ac7e13a4446921a90e1ff3eec1079840c845f9d523c868e24ae21f94cf69ba041de5341ebef96432a6f57598e223381d4286e8fb8baaa25906707f29fbd 020_all_msgfmt-libstdc++-link.patch -840070a3c423e6206aaa6e63e1d9a0fcd6efd53626cd1240a193f0b60aa5d84216acc4a2a4fa8bce74549b07e6a316b01d638f20cea13dc62473491a302fb3d6 050_all_libiberty-asprintf.patch 0a0bc72b9366158f5d23fff1928e756fdd212433bac6ab1f00d632f241382820db8db5d475ddf11ea020eaf7e2e71b12fb9b1c3c870cf84adf6c2b16f15aabca 051_all_libiberty-pic.patch -e7a2eb1b1870e199d6fd753d065781575656fa12baa264f96c5d179689d88c31b8a3f92a5dae96088c05e96aa2bda138364ad7dbcc79e1819a102f192cbb7bab 053_all_libitm-no-fortify-source.patch -e87da18aa7ab92b02b06168658c63b42a6c73a08fad2a30f81ef6296100fdbe3c3a91548fd0cb24eaf591e862bb08e4b67249bc4b977b07da33523aee0c686bc 067_all_gcc-poison-system-directories.patch -4a328d1e1a56c20166307edcfa322068915784d9c08025b7f81cf69714da48fc266b6d34f77b9135c2f10da830d9df408276a1b78d1fd218637c2823506593c2 090_all_pr55930-dependency-tracking.patch -ef052d0c3c9642fcb5ed570069c5a49c8ef523c47ac8ce3f201a801766f72ae4ff7c3725a70ee66e52c0fb559621e35fe0cf5b88b901d71ceadd381f49653a08 201-cilkrts.patch -808e206f5e107084156fba333d4e091dcbd62f5d7756142bc292d4b0a52619f8c2aaca3617defc2f5b6552ba0439aebd33f4141329d88eab6ddf2dd637d92c08 203-libgcc_s.patch -fc0de05b36613b732a0222ea005c90653c6a40d6761b6894af2419272f4e74875f37e26af33a9b9940669ef89269c44c46d17ca5bcd54b5cd1176e5eaf2992c1 204-linux_libc_has_function.patch 98473bcaa77903a223ca9b0d2087c0921b287a2816d308cc32c8fe009e6cbf5dd1ae7fba27794ab8d9c09e117fe534413d91a464d1218474fc123ce0adfdc2c1 205-nopie.patch -3287d5b443bea8ec64132bcabe869c738ae98ea8f1a86df1c5d18c927f8816edbfcefeefc47792dbbb2bcacf50319af00e01b3735d34525913b64350770ad453 207-static-pie.patch d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch 600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch -bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch fa62556719449caec6b2b434355bfbcaa5ae55ffe017b3e1f827f66a2aae21b79c571ee7a4ce723ea69169bc3a6447e73650991a200cc372adf2f102677518d7 gcc-pure64.patch -2253941f3d19b6d08801d3782f5f5ed56c3b73fbc9d3561a8f01c702963ac4fab91599c686076e7081eb6a80c37ccd33591ae978996d6eee1dc0ce0f1c50259a fix-gcj-stdgnu14-link.patch -f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch -54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch -abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch 35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch -9016b257abd8fa981de44a49512e35db814d1cbb47c1a87cd31c12d4ae20b13e9e149fe41691a7ec3c95bbcfde8a79194a8d2eaf547ceade3a246fad67c47dd8 ada-fixes.patch 3f5bc334d9f73d06f5f7c876738d02356acdd08958bea0e4d2095ebf15c2c2ec4e411abdae0297505ae9a1699ca01b17338e853184e84663203b192b0d35fc19 ada-shared.patch 631d4bdef6d8bde34df7978bb53ec28c3c909cf1f87139e5f148138d0f09adc58b41ecf0148bbf50fb4bc916c411e9bf8a2b6c046c75c0e77d754d8c35bcd4d7 ada-musl.patch -fa44c8158111627aa0e91c43e7cc3aa38642c2041c96532dd4f0932dae4d6f92ea2850b683abcf10e7e120299d42ea6b69adc00002a514c76be8e39e99fa052b ada-aarch64-multiarch.patch -4b4a0ff306a8ef34ff6e3284fbfca869012164a47ba7cb099085c1dd03e6ca0cdd462f82710e08c9a02895adc7484e4c5eef17b5aa264cf5d978fe8ad78eea93 300-main-gcc-add-musl-s390x-dynamic-linker.patch -385bc2fa50204f678964e5148c6170f572701dab920fbec8301f505bda34d182cde0adb7da042fee71719e12fb59f59181897f9b1bb4f4716ff59aad46ca1998 310-build-gcj-s390x.patch f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45b58ba8764ab1eb575d4eb6d6dfc550a87a183f8b94e76181 320-libffi-gnulinux.patch 8efd028febb962ae100be32f72f7450c4f77d67ad96a5f47072136cdf47043f9d54835a87c7ab5aaa0fa0108c4c7a97ba2d7732d5aaf2efce70fe1f7e1c39d6e 330-gccgo-link-to-ucontext.patch 24c8708f64b9b7945b3f07e9bbecf17ab8bcde2524f49cbd694ca2f6146ccc3f13bb027db282f326525ea79d50a2868fa3fa2b0d688a914b5ea77bbfd7e5cbe4 331-gccgo-use-real-off_t-type.patch -cf19fcc6abee70210a9061e5385fe361a5eb59a74f7d34297420a53e351400da23a060164bef5b322daba4be90019481731acf93c45fb5a93430018f1aa7ce35 332-gccgo-remove-ustat.patch -01c71cd5881fc07ea3b9b980697e89b3ca0fe98502958ceafc3fca18b2604c844e2f457feab711baf8e03f00a5383b0e38aac7eb954034e306f43d4a37f165ed fix-rs6000-pie.patch +31f9d85faa8648d140834646fc2bc7733eb362bfb87d696c5f375f9c0a3e4c3df41708a9a37c49bc0757513a7704976b9a5e21aa5c2de4b380d47d7e2cbde214 332-gccgo-sysinfo.patch +ef6ff46d571814ce2f6db549bfb9b9f5cc55d46085b197c36627a72e4f355fcbeb41d04fabd3029f3bc536fc48155fe3feab58a7a6ece9dcd19409ea44c17b0b 333-gccgo-signal-ppc64.patch 1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch -4e1b421ed72668b66ecbcb0a34afa99d2a34cb2ea9ee51c4aad605fc8a0e94e3bfbabae4ebe236efc5ec86fc01a472cbe93f36fe25cf579714939d8102a9b84a lra-pentium.patch 67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch" -- cgit v1.2.3-70-g09d2 From 63b5fb12c3d75e460799c672bbbdd5d29c3cc33c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 4 Mar 2019 00:59:59 +0000 Subject: system/gcc: More Go fixes (build and runtime) --- system/gcc/334-gccgo-signal-shell.patch | 25 +++++++++++++++++++++++++ system/gcc/335-gccgo-signal-ppc32.patch | 14 ++++++++++++++ system/gcc/336-gccgo-mmap64.patch | 29 +++++++++++++++++++++++++++++ system/gcc/337-gccgo-signal-sig34.patch | 11 +++++++++++ system/gcc/APKBUILD | 8 ++++++++ 5 files changed, 87 insertions(+) create mode 100644 system/gcc/334-gccgo-signal-shell.patch create mode 100644 system/gcc/335-gccgo-signal-ppc32.patch create mode 100644 system/gcc/336-gccgo-mmap64.patch create mode 100644 system/gcc/337-gccgo-signal-sig34.patch (limited to 'system/gcc/APKBUILD') diff --git a/system/gcc/334-gccgo-signal-shell.patch b/system/gcc/334-gccgo-signal-shell.patch new file mode 100644 index 000000000..5c7405c4f --- /dev/null +++ b/system/gcc/334-gccgo-signal-shell.patch @@ -0,0 +1,25 @@ +--- 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 @@ + checksig _SIGEMT '{_SigThrow, "SIGEMT: emulate instruction executed"}' + checksig _SIGINFO '{_SigNotify, "SIGINFO: status request from keyboard"}' + checksig _SIGTHR '{_SigNotify, "SIGTHR: reserved"}' +-checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' ++#checksig _SIGPOLL '{_SigNotify, "SIGPOLL: pollable event occurred"}' + 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 new file mode 100644 index 000000000..f44444948 --- /dev/null +++ b/system/gcc/335-gccgo-signal-ppc32.patch @@ -0,0 +1,14 @@ +--- 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 @@ + #endif + #ifdef __PPC__ + #ifdef __linux__ ++ #ifdef __PPC64__ + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32]; ++ #else ++ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32]; ++ #endif + #endif + #ifdef _AIX + ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar; diff --git a/system/gcc/336-gccgo-mmap64.patch b/system/gcc/336-gccgo-mmap64.patch new file mode 100644 index 000000000..23b4cebc8 --- /dev/null +++ b/system/gcc/336-gccgo-mmap64.patch @@ -0,0 +1,29 @@ +--- 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 new file mode 100644 index 000000000..757d2f216 --- /dev/null +++ b/system/gcc/337-gccgo-signal-sig34.patch @@ -0,0 +1,11 @@ +--- 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/APKBUILD b/system/gcc/APKBUILD index e831d2604..f95655eb6 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -170,6 +170,10 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz 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 add-classic_table-support.patch gcc-5.4.0-locale.patch @@ -551,5 +555,9 @@ f4ef08454e28c8732db69115e4998ec153399e8d229dd27f923dbdcf57b68128a65640d026cc7f45 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 1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch 67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch" -- cgit v1.2.3-70-g09d2 From ca1238c16d9009387066123f02f8dc0e8b4624d2 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 4 Mar 2019 22:23:53 +0000 Subject: system/gcc: GCC 8 introduces --enable-default-ssp, kill patch --- system/gcc/001_all_default-ssp-strong.patch | 215 ---------------------------- system/gcc/APKBUILD | 4 +- 2 files changed, 2 insertions(+), 217 deletions(-) delete mode 100644 system/gcc/001_all_default-ssp-strong.patch (limited to 'system/gcc/APKBUILD') diff --git a/system/gcc/001_all_default-ssp-strong.patch b/system/gcc/001_all_default-ssp-strong.patch deleted file mode 100644 index 95949eb00..000000000 --- a/system/gcc/001_all_default-ssp-strong.patch +++ /dev/null @@ -1,215 +0,0 @@ -# DP: Turn on -fstack-protector by default for C, C++, ObjC, ObjC++. -# DP: Build libgcc using -fno-stack-protector. - ---- - gcc/Makefile.in | 2 ++ - gcc/cp/lang-specs.h | 6 +++--- - gcc/doc/invoke.texi | 4 ++++ - gcc/gcc.c | 18 ++++++++++++++---- - gcc/objc/lang-specs.h | 10 +++++----- - gcc/objcp/lang-specs.h | 8 ++++---- - 6 files changed, 32 insertions(+), 16 deletions(-) - -Index: b/gcc/gcc.c -=================================================================== ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -858,6 +858,14 @@ proper position among the other output f - #define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G" - #endif - -+#ifndef SSP_DEFAULT_SPEC -+#ifdef TARGET_LIBC_PROVIDES_SSP -+#define SSP_DEFAULT_SPEC "%{!fno-stack-protector:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:%{!fstack-protector:-fstack-protector-strong}}}}}" -+#else -+#define SSP_DEFAULT_SPEC "" -+#endif -+#endif -+ - #ifndef LINK_SSP_SPEC - #ifdef TARGET_LIBC_PROVIDES_SSP - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ -@@ -1057,6 +1065,7 @@ static const char *cc1_spec = CC1_SPEC; - static const char *cc1plus_spec = CC1PLUS_SPEC; - static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; - static const char *link_ssp_spec = LINK_SSP_SPEC; -+static const char *ssp_default_spec = SSP_DEFAULT_SPEC; - static const char *asm_spec = ASM_SPEC; - static const char *asm_final_spec = ASM_FINAL_SPEC; - static const char *link_spec = LINK_SPEC; -@@ -1112,7 +1121,7 @@ static const char *cpp_unique_options = - static const char *cpp_options = - "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ - %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ -- %{undef} %{save-temps*:-fpch-preprocess}"; -+ %{undef} %{save-temps*:-fpch-preprocess} %(ssp_default)"; - - /* This contains cpp options which are not passed when the preprocessor - output will be used by another program. */ -@@ -1301,9 +1310,9 @@ static const struct compiler default_com - %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ - %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ - cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ -- %(cc1_options)}\ -+ %(cc1_options) %(ssp_default)}\ - %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ -- cc1 %(cpp_unique_options) %(cc1_options)}}}\ -+ cc1 %(cpp_unique_options) %(cc1_options) %(ssp_default)}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1}, - {"-", - "%{!E:%e-E or -x required when input is from standard input}\ -@@ -1328,7 +1337,7 @@ static const struct compiler default_com - %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0}, - {".i", "@cpp-output", 0, 0, 0}, - {"@cpp-output", -- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(ssp_default) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {".s", "@assembler", 0, 0, 0}, - {"@assembler", - "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, -@@ -1560,6 +1569,7 @@ static struct spec_list static_specs[] = - INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec), - INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec), - INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec), -+ INIT_STATIC_SPEC ("ssp_default", &ssp_default_spec), - INIT_STATIC_SPEC ("endfile", &endfile_spec), - INIT_STATIC_SPEC ("link", &link_spec), - INIT_STATIC_SPEC ("lib", &lib_spec), -Index: b/gcc/cp/lang-specs.h -=================================================================== ---- a/gcc/cp/lang-specs.h -+++ b/gcc/cp/lang-specs.h -@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:-o %g.s \ - %{!fdump-ada-spec*:%{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}}%V}}}}", -@@ -58,11 +58,11 @@ along with GCC; see the file COPYING3. - %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ - cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".ii", "@c++-cpp-output", 0, 0, 0}, - {"@c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1plus -fpreprocessed %i %(cc1_options) %2\ -+ cc1plus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -Index: b/gcc/params.def -=================================================================== ---- a/gcc/params.def -+++ b/gcc/params.def -@@ -673,7 +673,7 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, - DEFPARAM (PARAM_SSP_BUFFER_SIZE, - "ssp-buffer-size", - "The lower bound for a buffer to be considered for stack smashing protection.", -- 8, 1, 0) -+ 4, 1, 0) - - DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING, - "min-size-for-stack-sharing", -Index: b/gcc/objc/lang-specs.h -=================================================================== ---- a/gcc/objc/lang-specs.h -+++ b/gcc/objc/lang-specs.h -@@ -29,9 +29,9 @@ along with GCC; see the file COPYING3. - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ -+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objective-c-header", - "%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\ -@@ -40,18 +40,18 @@ along with GCC; see the file COPYING3. - %{traditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ -- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj -fpreprocessed %b.mi %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}\ - %{!save-temps*:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, - {".mi", "@objective-c-cpp-output", 0, 0, 0}, - {"@objective-c-cpp-output", -- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc-cpp-output", - "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\ -- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(ssp_default) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -Index: b/gcc/objcp/lang-specs.h -=================================================================== ---- a/gcc/objcp/lang-specs.h -+++ b/gcc/objcp/lang-specs.h -@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(ssp_default) %2\ - -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {"@objective-c++", -@@ -46,16 +46,16 @@ along with GCC; see the file COPYING3. - %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ - cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ - %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2\ -+ %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".mii", "@objective-c++-cpp-output", 0, 0, 0}, - {"@objective-c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc++-cpp-output", - "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\ - %{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(ssp_default) %2\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -Index: b/gcc/doc/invoke.texi -=================================================================== ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -9247,6 +9247,9 @@ - The minimum size of variables taking part in stack slot sharing when not - optimizing. The default value is 32. - -+The Alpine Linux default is "4", to increase -+the number of functions protected by the stack protector. -+ - @item max-jump-thread-duplication-stmts - Maximum number of statements allowed in a block that needs to be - duplicated when threading jumps. -@@ -10185,6 +10188,11 @@ - Like @option{-fstack-protector} but includes additional functions to - be protected --- those that have local array definitions, or have - references to local frame addresses. -+ -+NOTE: In Alpine Linux, -+@option{-fstack-protector-strong} is enabled by default for C, -+C++, ObjC, ObjC++, if none of @option{-fno-stack-protector}, -+@option{-nostdlib}, nor @option{-ffreestanding} are found. - - @item -fstack-protector-explicit - @opindex fstack-protector-explicit diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD index f95655eb6..fdac8dbf6 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -146,7 +146,6 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz 0011-m68k.patch 0012-static-pie.patch - 001_all_default-ssp-strong.patch 002_all_default-relro.patch 005_all_default-as-needed.patch 011_all_default-warn-format-security.patch @@ -288,11 +287,13 @@ build() { --enable-checking=release \ --disable-fixed-point \ --disable-libstdcxx-pch \ + --disable-multiarch \ --disable-multilib \ --disable-werror \ $_symvers \ --enable-__cxa_atexit \ --enable-default-pie \ + --enable-default-ssp \ --enable-cloog-backend \ --enable-languages=$_languages \ $_arch_configure \ @@ -535,7 +536,6 @@ b8207c1be82b20fdad2596bb0a60469db52257456d0925bacf48b44899f4c6ece93c501347e1ffe9 66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch cd3ba928121e8578ba9f73215e4d81ee3ebbab33e00b04cdfd62b46d21f9536297ae12dc021aad6e56f3b28d9d544727331bbe6db1e3438d7b9545b2c3250906 0011-m68k.patch 45d5bc11a89e5af77503ca06eec52d6d84e6fea0be021aaee1bcc39f8dd3c7b4baa4200cfa2b0688faa0f207d005db89c029eff32f362207aa3d2365b2f2363e 0012-static-pie.patch -a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch 625c02e03c2f1db04da12cc6a086ec85790a031a13df36486243fd9569cd17f7c8ebeec91ac16cc1f87c3ec1ffe4c421153e98a9aeb5eea35943a6f015d81f50 002_all_default-relro.patch 02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch 622fdbcbbf2feb86bd839af627ec3613c6d2c77b14d37d31165b19f73f45b3663a203efff5d224f194edb15eb62d3d5885e32f85d1b584f071e580fea4e12664 011_all_default-warn-format-security.patch -- cgit v1.2.3-70-g09d2 From d9b28767785c07ec37d1f7ad880b5a1df2932042 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 5 Mar 2019 03:49:21 +0000 Subject: system/gcc: fix 32-bit PowerPC issue --- system/gcc/APKBUILD | 2 ++ system/gcc/disable-multiarch-ppc32.patch | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 system/gcc/disable-multiarch-ppc32.patch (limited to 'system/gcc/APKBUILD') diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD index fdac8dbf6..a8ac557b5 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -175,6 +175,7 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz 337-gccgo-signal-sig34.patch add-classic_table-support.patch + disable-multiarch-ppc32.patch gcc-5.4.0-locale.patch " @@ -560,4 +561,5 @@ e755072a3c71ada6cde354dd258fae029919e1116048068368d38411ca28a6ad8856702498d6667b de0cc0f9356c9ee5ea7b0f954441b59115f4a8f8f63573d0c17b6537e6f37641cf137531b496fc192d38035c2c4ba8175d36cbd7da15cbfcf8dc18c049c0f111 336-gccgo-mmap64.patch c2916948b028e1e990e1953875b884561c0f8dd105c1ec03073795df9a47ec2c627cbc95ca0ec98ab9177bf2b7c8458bf3fd09f780fa6c301995846f6317e366 337-gccgo-signal-sig34.patch 1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch +db8c4ab3eae7c01943a61e9e3e20af45d4f6d196184eee5b94068b212900ccdeecaf4fb4145983226954f64e7c989fcd13e0b506176d2b3e781c2e9dc8b5a5a8 disable-multiarch-ppc32.patch 67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch" diff --git a/system/gcc/disable-multiarch-ppc32.patch b/system/gcc/disable-multiarch-ppc32.patch new file mode 100644 index 000000000..5ca9a1d0d --- /dev/null +++ b/system/gcc/disable-multiarch-ppc32.patch @@ -0,0 +1,15 @@ +--- gcc-8.3.0/gcc/config/rs6000/t-linux.old 2019-03-04 07:18:12.770000000 +0000 ++++ gcc-8.3.0/gcc/config/rs6000/t-linux 2019-03-05 03:22:15.030000000 +0000 +@@ -5,10 +5,10 @@ + MULTILIB_OSDIRNAMES := m64=../lib + MULTILIB_OSDIRNAMES += m32=../lib32 + else +-MULTIARCH_DIRNAME := powerpc-linux-gnu ++MULTIARCH_DIRNAME = $(call if_multiarch,powerpc-linux-gnu) + endif + ifneq (,$(findstring powerpcle,$(target))) +-MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) ++MULTIARCH_DIRNAME := $(call if_multiarch,$(subst -linux,le-linux,$(MULTIARCH_DIRNAME))) + endif + ifneq (,$(findstring powerpc64le,$(target))) + MULTILIB_OSDIRNAMES := m64=../lib -- cgit v1.2.3-70-g09d2 From 89573ea3c2e8ec27ad4433a00fa238f7be475c54 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 6 Mar 2019 23:16:01 +0000 Subject: system/gcc: Fix ppc32 kernel build; POSIXise builtin snprintf --- system/gcc/APKBUILD | 7 +- ...ackport-r267157-posix-conformant-snprintf.patch | 80 ++++++++++++++++++++++ system/gcc/backport-r268048-memcpy-bounds.patch | 21 ++++++ 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 system/gcc/backport-r267157-posix-conformant-snprintf.patch create mode 100644 system/gcc/backport-r268048-memcpy-bounds.patch (limited to 'system/gcc/APKBUILD') diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD index a8ac557b5..96bd3f8df 100644 --- a/system/gcc/APKBUILD +++ b/system/gcc/APKBUILD @@ -177,6 +177,9 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz add-classic_table-support.patch disable-multiarch-ppc32.patch gcc-5.4.0-locale.patch + + backport-r267157-posix-conformant-snprintf.patch + backport-r268048-memcpy-bounds.patch " # we build out-of-tree @@ -562,4 +565,6 @@ de0cc0f9356c9ee5ea7b0f954441b59115f4a8f8f63573d0c17b6537e6f37641cf137531b496fc19 c2916948b028e1e990e1953875b884561c0f8dd105c1ec03073795df9a47ec2c627cbc95ca0ec98ab9177bf2b7c8458bf3fd09f780fa6c301995846f6317e366 337-gccgo-signal-sig34.patch 1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch db8c4ab3eae7c01943a61e9e3e20af45d4f6d196184eee5b94068b212900ccdeecaf4fb4145983226954f64e7c989fcd13e0b506176d2b3e781c2e9dc8b5a5a8 disable-multiarch-ppc32.patch -67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch" +67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch +65a4d8bf9cefcbc79e86015ef4376b2794492d6cae77065359b35bb4ed630dde6256982cd5e43ed837cbbdab366ea376da9f1c83f80ddf6dc53ab017b378c3cd backport-r267157-posix-conformant-snprintf.patch +23c20f258d1a21d0d706945376df8b93c0277a8dcd5183cc0b15c9f22250ef179833c725f877279f74e89364d772148526af5544ab7758172bfb758618554ad3 backport-r268048-memcpy-bounds.patch" diff --git a/system/gcc/backport-r267157-posix-conformant-snprintf.patch b/system/gcc/backport-r267157-posix-conformant-snprintf.patch new file mode 100644 index 000000000..adedf0ce9 --- /dev/null +++ b/system/gcc/backport-r267157-posix-conformant-snprintf.patch @@ -0,0 +1,80 @@ +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 %", +- dstsize); ++ { ++ warning_at (gimple_location (info.callstmt), info.warnopt (), ++ "specified bound %wu exceeds %", ++ 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 " ++ "%", ++ 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/backport-r268048-memcpy-bounds.patch b/system/gcc/backport-r268048-memcpy-bounds.patch new file mode 100644 index 000000000..eebecd832 --- /dev/null +++ b/system/gcc/backport-r268048-memcpy-bounds.patch @@ -0,0 +1,21 @@ +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88273 + +GCC 8.2+ fails to build 32-bit PowerPC kernel due to this. + +--- trunk/gcc/gimple-ssa-warn-restrict.c 2019/01/17 16:33:55 268037 ++++ trunk/gcc/gimple-ssa-warn-restrict.c 2019/01/17 22:52:47 268048 +@@ -319,13 +319,9 @@ + offrange[0] += offset_int::from (min, SIGNED); + offrange[1] += offset_int::from (max, SIGNED); + } +- else if (rng == VR_ANTI_RANGE) +- { +- offrange[0] += offset_int::from (max + 1, SIGNED); +- offrange[1] += offset_int::from (min - 1, SIGNED); +- } + else + { ++ /* Handle an anti-range the same as no range at all. */ + gimple *stmt = SSA_NAME_DEF_STMT (offset); + tree type; + if (is_gimple_assign (stmt) -- cgit v1.2.3-70-g09d2