summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2015-05-23 00:45:51 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2015-05-23 00:45:51 +0200
commit44bdb4d96b11da7dfa3292aab10ee7f826156277 (patch)
tree7c4337ac16b334938632eb44775eb58adcc30056
parentb5bc75b7becf184fd56dea10d32bcb68a69dcf45 (diff)
downloadgentoo-overlay-44bdb4d96b11da7dfa3292aab10ee7f826156277.tar.gz
gentoo-overlay-44bdb4d96b11da7dfa3292aab10ee7f826156277.tar.bz2
gentoo-overlay-44bdb4d96b11da7dfa3292aab10ee7f826156277.tar.xz
gentoo-overlay-44bdb4d96b11da7dfa3292aab10ee7f826156277.zip
Test PR65873 workaround.
-rw-r--r--sys-devel/gcc/Manifest8
-rw-r--r--sys-devel/gcc/files/Work-around-PR65873.patch136
-rw-r--r--sys-devel/gcc/gcc-5.1.0.ebuild47
3 files changed, 191 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 0000000..0ba872f
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,8 @@
+AUX Work-around-PR65873.patch 6838 SHA256 fc1dc0a1799e8f4bcdc64041f83ef34786f7d48afb37e28a5bc4eaf033e25369 SHA512 c27aa676be6a771aae4aafceaf0fef168d09723385da363fa2ce95426f232e1d85fb9c796bf788dbd63c2280ace7b97cdd787c5302c7a97d75fe451e7ac79ee7 WHIRLPOOL 898f55e47e10634ce70fe0d04adff956d2a517989d9e583d005218e13514d4204a1783648d0d509699631ce8a9956e9515d3401ed79730a9d4cf3ca47113406d
+DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad
+DIST gcc-4.4.3-specs-0.2.0.tar.bz2 2004 SHA256 f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 SHA512 779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 WHIRLPOOL 8a1e45aad9d306cb19de93c63b5854a97e629d90852feb6861dcfca042b6257705304fc13ad65655a4cb227d36b83fc6063648c94f270821574ee0e85307094e
+DIST gcc-5.1.0-patches-1.0.tar.bz2 20588 SHA256 69f1e8601ff6977b1e972e66ff12191642a31cc5b3088cce73d6d3017f6c0f9c SHA512 01f4a29d06b1fec43fb515c2527394328b83f35723713add53599ed2066d13fffd26502750585b65816cf9c17d3042eb854fc62dc37aa86d09e91e9fba23bc6f WHIRLPOOL 13d84451f4e4c284c541dcdc7ca90d110954ec4af66db957139243f679714f47277e39370e8c4a54414f4e12a718879397e69108e785d4fb3258d260c6bc4ae9
+DIST gcc-5.1.0-piepatches-v0.6.3.tar.bz2 14363 SHA256 85841929655d9bfce92676acc681f29935b16b95ad260fa6726fadf6382fa81b SHA512 a3d5a7df114b17eba6d8de7cc1c20c67264a821a3032c04c80344ea74b18af7a8db000c353016ab9e0f795b4efd65dba39506ca28f11b5a8e3039984eca1fb8a WHIRLPOOL f72fd4260d2f85a4f95fe347b86e626f2df20aee7af26e6fce1a5437362cef3479af9938a240e97fd4ad821a143ebca55a9ba7579f95988c3dc5f68005f98a92
+DIST gcc-5.1.0-uclibc-patches-1.0.tar.bz2 2531 SHA256 1e8557d6b9952ff3e16d16b11b8e5dbae33bd37539d24d771436a7dc3a6e948f SHA512 e90aa58111368d5e6fbeb4818ecf5485ea4cefe5f3c4906c207c977b93e2b182f26987e955d03f988f59e5f056cdd71dde65f50ddb9909f8d1fac92383a3a6cf WHIRLPOOL bc04762db9b1324bd837c1e3fe440f787a7e38dae0e7eee099eefadda6a927f894246586608520a11fab138ffc825084b9d03e6e2065f8860accc2d3c803d778
+DIST gcc-5.1.0.tar.bz2 94954411 SHA256 b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad SHA512 30f6a94d3adb25bc51fcaddf32a6c41429f569eeb9ed64330445b1296f99998fbfa03277b375be4f7b2b80f519910ef88e4149db7cd9031e2c61a49f501bde94 WHIRLPOOL c824ab1b4a801d11ca184ab93b3d7ec195dc0d869204cda08d6239b22832b597431f7eac3e22ffb1f13c2e4a6ef85edb3a954ad5b7754c447aa3fa6fccc21e63
+EBUILD gcc-5.1.0.ebuild 1421 SHA256 0d9680982d322b8abd641ca9986d48ec392b79dc3d918055b81ade130e12af07 SHA512 4b695bd4e1b27c12e312b7a7ae173439633cf358dfac39fc27a264bdaf5179d65d3d7819ec2a46e79a8e41510ee960a4a522874b6152a187c4a2cdb7c7c4f604 WHIRLPOOL 1a7d3f4ac545b5f607a604862922a340d0d65836b3bac0fac7043e608c57467bd3107cc9be436f3bdb0f0f630f3d2abe3c681e141fd404d9b008c11375f754ab
diff --git a/sys-devel/gcc/files/Work-around-PR65873.patch b/sys-devel/gcc/files/Work-around-PR65873.patch
new file mode 100644
index 0000000..653de21
--- /dev/null
+++ b/sys-devel/gcc/files/Work-around-PR65873.patch
@@ -0,0 +1,136 @@
+diff -Naur gcc-5.1.0.orig/gcc/ipa-inline.c gcc-5.1.0/gcc/ipa-inline.c
+--- gcc-5.1.0.orig/gcc/ipa-inline.c 2015-04-03 20:09:13.000000000 +0200
++++ gcc-5.1.0/gcc/ipa-inline.c 2015-05-23 00:42:48.649818542 +0200
+@@ -427,49 +427,58 @@
+ && lookup_attribute ("always_inline",
+ DECL_ATTRIBUTES (callee->decl)));
+
++ /* Until GCC 4.9 we did not check the semantics alterning flags
++ bellow and inline across optimization boundry.
++ Enabling checks bellow breaks several packages by refusing
++ to inline library always_inline functions. See PR65873.
++ Disable the check for early inlining for now until better solution
++ is found. */
++ if (always_inline && early)
++ ;
+ /* There are some options that change IL semantics which means
+ we cannot inline in these cases for correctness reason.
+ Not even for always_inline declared functions. */
+ /* Strictly speaking only when the callee contains signed integer
+ math where overflow is undefined. */
+- if ((check_maybe_up (flag_strict_overflow)
+- /* this flag is set by optimize. Allow inlining across
+- optimize boundary. */
+- && (!opt_for_fn (caller->decl, optimize)
+- == !opt_for_fn (callee->decl, optimize) || !always_inline))
+- || check_match (flag_wrapv)
+- || check_match (flag_trapv)
+- /* Strictly speaking only when the callee contains memory
+- accesses that are not using alias-set zero anyway. */
+- || check_maybe_down (flag_strict_aliasing)
+- /* Strictly speaking only when the callee uses FP math. */
+- || check_maybe_up (flag_rounding_math)
+- || check_maybe_up (flag_trapping_math)
+- || check_maybe_down (flag_unsafe_math_optimizations)
+- || check_maybe_down (flag_finite_math_only)
+- || check_maybe_up (flag_signaling_nans)
+- || check_maybe_down (flag_cx_limited_range)
+- || check_maybe_up (flag_signed_zeros)
+- || check_maybe_down (flag_associative_math)
+- || check_maybe_down (flag_reciprocal_math)
+- /* We do not want to make code compiled with exceptions to be brought
+- into a non-EH function unless we know that the callee does not
+- throw. This is tracked by DECL_FUNCTION_PERSONALITY. */
+- || (check_match (flag_non_call_exceptions)
+- /* TODO: We also may allow bringing !flag_non_call_exceptions
+- to flag_non_call_exceptions function, but that may need
+- extra work in tree-inline to add the extra EH edges. */
+- && (!opt_for_fn (callee->decl, flag_non_call_exceptions)
+- || DECL_FUNCTION_PERSONALITY (callee->decl)))
+- || (check_maybe_up (flag_exceptions)
+- && DECL_FUNCTION_PERSONALITY (callee->decl))
+- /* Strictly speaking only when the callee contains function
+- calls that may end up setting errno. */
+- || check_maybe_up (flag_errno_math)
+- /* When devirtualization is diabled for callee, it is not safe
+- to inline it as we possibly mangled the type info.
+- Allow early inlining of always inlines. */
+- || (!early && check_maybe_down (flag_devirtualize)))
++ else if ((check_maybe_up (flag_strict_overflow)
++ /* this flag is set by optimize. Allow inlining across
++ optimize boundary. */
++ && (!opt_for_fn (caller->decl, optimize)
++ == !opt_for_fn (callee->decl, optimize) || !always_inline))
++ || check_match (flag_wrapv)
++ || check_match (flag_trapv)
++ /* Strictly speaking only when the callee contains memory
++ accesses that are not using alias-set zero anyway. */
++ || check_maybe_down (flag_strict_aliasing)
++ /* Strictly speaking only when the callee uses FP math. */
++ || check_maybe_up (flag_rounding_math)
++ || check_maybe_up (flag_trapping_math)
++ || check_maybe_down (flag_unsafe_math_optimizations)
++ || check_maybe_down (flag_finite_math_only)
++ || check_maybe_up (flag_signaling_nans)
++ || check_maybe_down (flag_cx_limited_range)
++ || check_maybe_up (flag_signed_zeros)
++ || check_maybe_down (flag_associative_math)
++ || check_maybe_down (flag_reciprocal_math)
++ /* We do not want to make code compiled with exceptions to be
++ brought into a non-EH function unless we know that the callee
++ does not throw.
++ This is tracked by DECL_FUNCTION_PERSONALITY. */
++ || (check_match (flag_non_call_exceptions)
++ /* TODO: We also may allow bringing !flag_non_call_exceptions
++ to flag_non_call_exceptions function, but that may need
++ extra work in tree-inline to add the extra EH edges. */
++ && (!opt_for_fn (callee->decl, flag_non_call_exceptions)
++ || DECL_FUNCTION_PERSONALITY (callee->decl)))
++ || (check_maybe_up (flag_exceptions)
++ && DECL_FUNCTION_PERSONALITY (callee->decl))
++ /* Strictly speaking only when the callee contains function
++ calls that may end up setting errno. */
++ || check_maybe_up (flag_errno_math)
++ /* When devirtualization is diabled for callee, it is not safe
++ to inline it as we possibly mangled the type info.
++ Allow early inlining of always inlines. */
++ || (!early && check_maybe_down (flag_devirtualize)))
+ {
+ e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
+ inlinable = false;
+@@ -484,6 +493,17 @@
+ e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
+ inlinable = false;
+ }
++ /* If explicit optimize attribute are not used, the mismatch is caused
++ by different command line options used to build different units.
++ Do not care about COMDAT functions - those are intended to be
++ optimized with the optimization flags of module they are used in.
++ Also do not care about mixing up size/speed optimization when
++ DECL_DISREGARD_INLINE_LIMITS is set. */
++ else if ((callee->merged
++ && !lookup_attribute ("optimize",
++ DECL_ATTRIBUTES (caller->decl)))
++ || DECL_DISREGARD_INLINE_LIMITS (callee->decl))
++ ;
+ /* If mismatch is caused by merging two LTO units with different
+ optimizationflags we want to be bit nicer. However never inline
+ if one of functions is not optimized at all. */
+diff -Naur gcc-5.1.0.orig/gcc/testsuite/gcc.c-torture/compile/pr65873.c gcc-5.1.0/gcc/testsuite/gcc.c-torture/compile/pr65873.c
+--- gcc-5.1.0.orig/gcc/testsuite/gcc.c-torture/compile/pr65873.c 1970-01-01 01:00:00.000000000 +0100
++++ gcc-5.1.0/gcc/testsuite/gcc.c-torture/compile/pr65873.c 2015-05-23 00:30:54.869819620 +0200
+@@ -0,0 +1,14 @@
++typedef __SIZE_TYPE__ size_t;
++
++extern inline __attribute__ ((__always_inline__, __gnu_inline__, __artificial__, __nothrow__, __leaf__)) void *
++memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len)
++{
++ return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
++}
++
++__attribute__((optimize ("Ofast"))) void
++bar (void *d, void *s, size_t l)
++{
++ memcpy (d, s, l);
++}
++
diff --git a/sys-devel/gcc/gcc-5.1.0.ebuild b/sys-devel/gcc/gcc-5.1.0.ebuild
new file mode 100644
index 0000000..f0aebec
--- /dev/null
+++ b/sys-devel/gcc/gcc-5.1.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-5.1.0.ebuild,v 1.3 2015/05/11 03:13:06 vapier Exp $
+
+EAPI="4"
+
+PATCH_VER="1.0"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.3"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit toolchain
+
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+ is_crosscompile && EPATCH_EXCLUDE+=" 05_all_gcc-spec-env.patch"
+
+ toolchain_src_prepare
+
+ epatch "${FILESDIR}"/Work-around-PR65873.patch
+}