diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-03-09 13:48:32 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-03-16 13:10:29 +0000 |
commit | 067a4f28825478911bb62be3b8da758d9722753e (patch) | |
tree | 0407ceec0212072e4e873a0139dac5576d53c574 /main/gcc | |
parent | ffe8d64b56a7276d1b0aa7d6186d51e25535936b (diff) | |
download | aports-067a4f28825478911bb62be3b8da758d9722753e.tar.bz2 aports-067a4f28825478911bb62be3b8da758d9722753e.tar.xz |
main/gcc: add musl/fortify support, and enable it by default
Diffstat (limited to 'main/gcc')
-rw-r--r-- | main/gcc/10_all_default-fortify-source.patch | 31 | ||||
-rw-r--r-- | main/gcc/APKBUILD | 10 | ||||
-rw-r--r-- | main/gcc/gcc-4.9-musl-fortify.patch | 11 |
3 files changed, 51 insertions, 1 deletions
diff --git a/main/gcc/10_all_default-fortify-source.patch b/main/gcc/10_all_default-fortify-source.patch new file mode 100644 index 0000000000..e74d60cc2c --- /dev/null +++ b/main/gcc/10_all_default-fortify-source.patch @@ -0,0 +1,31 @@ +Enable -D_FORTIFY_SOURCE=2 by default. + +Original patch from: +http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.2/gentoo/10_all_default-fortify-source.patch + +--- a/gcc/c-family/c-cppbuiltin.c ++++ b/gcc/c-family/c-cppbuiltin.c +@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); + ++ /* Fortify Source enabled by default w/optimization. */ ++ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); ++ + /* Misc. */ + if (flag_gnu89_inline) + cpp_define (pfile, "__GNUC_GNU_INLINE__"); +--- a/gcc/doc/gcc.info ++++ b/gcc/doc/gcc.info +@@ -6255,6 +6255,11 @@ find out the exact set of optimizations that are enabled at each level. + Please note the warning under '-fgcse' about invoking '-O2' on + programs that use computed gotos. + ++ NOTE: In Alpine Linux, `-D_FORTIFY_SOURCE=2' is set by default, and is ++ activated when `-Os' or `-O1' or higher is used. This enables additional ++ compile-time and run-time checks for several libc functions. To disable, ++ specify either `-U_FORTIFY_SOURCE' or `-D_FORTIFY_SOURCE=0'. ++ + '-O3' + Optimize yet more. '-O3' turns on all optimizations specified by + '-O2' and also turns on the '-finline-functions', diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index 33f19a88b2..936fbea014 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -8,7 +8,7 @@ _cross="" && _cross="-$CTARGET" pkgname="$pkgname$_cross" -pkgrel=3 +pkgrel=4 pkgdesc="The GNU Compiler Collection" url="http://gcc.gnu.org" arch="all" @@ -155,6 +155,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2 40_all_gcc49_config_esp.patch 41_all_gcc49_config_esp_alpine.patch + 10_all_default-fortify-source.patch 12_all_default-warn-trampolines.patch 15_all_libgfortran-Werror.patch 16_all_libgomp-Werror.patch @@ -171,6 +172,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2 gcc-4.9-musl.patch gcc-4.8-musl-fix-iteratephdr.patch gcc-4.8-musl-libssp.patch + gcc-4.9-musl-fortify.patch boehm-gc-uclibc.patch boehm-gc-musl.patch gcc-pure64.patch @@ -641,6 +643,7 @@ b0910da9f2eb4fe6a684e680f6336491 34_all_gcc48_config_i386.patch adcc78e93f54b80210bc436041c1a6e7 35_all_gcc48_config_arm.patch f972492ebb115777ee099f6d779a7a2d 40_all_gcc49_config_esp.patch 965a029d968eec0695191e3f148040f9 41_all_gcc49_config_esp_alpine.patch +51ffc4915fb1dfc24c84ac3a5d81d941 10_all_default-fortify-source.patch f28e9334c58ce14f69a9e988026bc772 12_all_default-warn-trampolines.patch 7eb9ad894dfdf1b3d4a8a407a339a6f1 15_all_libgfortran-Werror.patch 452e457a0ac45e6f8f75eb6d6ba4d04b 16_all_libgomp-Werror.patch @@ -656,6 +659,7 @@ a695d7648509b4f8e18b389a19e6037c gcc-spec-env.patch 39c75e44e138a5d558b3027b8e97e416 gcc-4.9-musl.patch 6e5c32243a86ff35b7b47d18c95b31bd gcc-4.8-musl-fix-iteratephdr.patch 0d0a41c02802b85c8f1b78ce28544f92 gcc-4.8-musl-libssp.patch +9e658e590bc51be611f39945183f6aa2 gcc-4.9-musl-fortify.patch 2c6cb49bb9bfd8b6e690222e66ccc901 boehm-gc-uclibc.patch 0ea0f556d4ef9c260d1353b7fd33970c boehm-gc-musl.patch 2e2b787bb988d9007c9f7ce42178dfe6 gcc-pure64.patch @@ -688,6 +692,7 @@ fded7088ad66eaa2c18890c1317492d1004229b485b200d4fbd882859e37d20d 20_all_gcc49_c 48e22b2794ae70985c418832f7845814d65e78abcf56d38205db4b760a1c5ffa 35_all_gcc48_config_arm.patch e4ae7a4ac9c08775311fec84d800511f3409f1b5e9f25f0dd39cc0571d03846c 40_all_gcc49_config_esp.patch b36f44331ca0204234263a4e3d953b741f114a8e6d05270ba0b9dc270faa0475 41_all_gcc49_config_esp_alpine.patch +538d3d2de8a1bf89c74fcff308dfb320d9d00e1f4d335a0e66968f9f6dd261d7 10_all_default-fortify-source.patch ce7774aa13be5da274220258772ccbdd6f54abdad97a3798ba282865c809f042 12_all_default-warn-trampolines.patch 8b1450d5a7756af2b890588005690785a663601e2b1533671b609aa8cce0f718 15_all_libgfortran-Werror.patch 1f106fe03cede7c697bde7d81732e0d3bb2c7197e4967789182a5fd8db532900 16_all_libgomp-Werror.patch @@ -703,6 +708,7 @@ c3272ceb67eebcc2dad7b5509573a55610b6ca6ba3fd28638662a36ea9cd85b6 67_all_gcc-poi 9ab8fdc56e64d44c83fd18cbeb472bd3d1554b5059fa6bf49f33488208de1417 gcc-4.9-musl.patch 151c11c3303233e6ff06e27aa6dc889140bc46a7b5e4870587c40e37d36ede2c gcc-4.8-musl-fix-iteratephdr.patch 80b76ca30dcaf07481ab102869d741f044c7e5235f462182bc27467baacda9a4 gcc-4.8-musl-libssp.patch +dc93f97dff28b872f9c7e241fb87a3eca0271f706534d196b3517781b05667fa gcc-4.9-musl-fortify.patch 02751ccf223dcfc898c0ce2214cd0859d275e90b742f1a66e38db5c50f94b38c boehm-gc-uclibc.patch 6ccca88695ef84c0d038cd315cad5ae5b799672ecb009fdaab34e68ba60b733c boehm-gc-musl.patch f5473c6aea96d5137defd68898ba31042944a3f3ed26c05b964a40bd876c6f47 gcc-pure64.patch @@ -735,6 +741,7 @@ dd5b9b30eb7716cb3c010ca79a83ed6219ff6e6f2557deb4e1d26cecac0f2b14c4ef7bf4dc5c2aec 8829f85323d8b11e26e3c19ced4a51875fc63f1483cfdc4d0f579a6cb37e1b6e23fcf33a87a574a6e0007250374ea46d117a136e73a40fbe43f0e39d9b2dd1a8 35_all_gcc48_config_arm.patch 976994900d20a448b97fa91e1d758b6da6d8ad9121b3dbc2e8f66ff8006d8e496cd3dddc41394db6c4d20366d56fe12375b97f494d6fb9abb8e64ab626acc2ef 40_all_gcc49_config_esp.patch e2d027be2e76a64a607ae44566d163bcc2a03c9e14d5bd20cd8bb15c2e9e395d8964b747a6a9c49541a5d1613d721855b73d60cce7c834427b44788fa92d44dc 41_all_gcc49_config_esp_alpine.patch +6cdac0741568b418af1e267a69b487e48a98e319f5ec8ab2bad293f2520ceced40c7df7ddef84963f5b101b94f34e441574c501ef3993ded097beb7c9d3b205f 10_all_default-fortify-source.patch 5069e4b741488913a646a9b5d871af8e7f7a606158ea09305d0ddd46257c5b659770627bc2ca3abeaae039da1717b3ba6c9cd90554a441da74eb4ecf24c13074 12_all_default-warn-trampolines.patch c18a99b7303a734fe4dca9d4e90e21d18e5bd71c7d91e1a26c86b1354c73f567590a875941bfe64ce59f0393023b91c606c96b30885c55b98a790c3ab0c84ca7 15_all_libgfortran-Werror.patch 433404fd9bfa172d69fff4a5505e8648cbbbf5f052d2b4235608ff7af0c4063d557d25d80c85c5bd0d1e1ed64b568e7bbc0cdbce11cc74db4c0189af3a01634a 16_all_libgomp-Werror.patch @@ -750,6 +757,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2 e2be926c0ed4d67587857652678253a2a4e42294009a0c4b9fc420e53b0e6d44d1a2c6c2c62db837bc010470e9e62eb4af1ba7f51ff507c41e40922cd022dd26 gcc-4.9-musl.patch b5b0210dfaccfe0b06f0a9090666b1fae2a3faa4140b7930146b29531f0da9beb1f2c1f7e7bc2bd29179f9fe05dc30e246e96220b8ff75a90f75e8350c9058a1 gcc-4.8-musl-fix-iteratephdr.patch e6d9b103c128e5d4eca515b1496d78b05708de770597c883daddd95ea41e77b5ef1be613b989357cc870a7efd9e43b011022c2d302e7056cff7b69e764906ff2 gcc-4.8-musl-libssp.patch +600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehm-gc-uclibc.patch bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch 4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch diff --git a/main/gcc/gcc-4.9-musl-fortify.patch b/main/gcc/gcc-4.9-musl-fortify.patch new file mode 100644 index 0000000000..daae954c80 --- /dev/null +++ b/main/gcc/gcc-4.9-musl-fortify.patch @@ -0,0 +1,11 @@ +--- 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 @@ + + #ifdef NATIVE_SYSTEM_HEADER_DIR + #define INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, + #else |