dev-libs/gmp: work around broken clang during noexecstack detection
authorMike Frysinger <vapier@gentoo.org>
Wed, 24 Feb 2016 19:49:22 +0000 (04:49 +0900)
committerMike Frysinger <vapier@gentoo.org>
Wed, 24 Feb 2016 22:08:56 +0000 (07:08 +0900)
dev-libs/gmp/files/gmp-6.1.0-noexecstack-detect.patch [new file with mode: 0644]
dev-libs/gmp/gmp-6.1.0.ebuild

diff --git a/dev-libs/gmp/files/gmp-6.1.0-noexecstack-detect.patch b/dev-libs/gmp/files/gmp-6.1.0-noexecstack-detect.patch
new file mode 100644 (file)
index 0000000..558ba60
--- /dev/null
@@ -0,0 +1,23 @@
+gmp's -Wa,--noexecstack check is based on glibc's, so backport a change
+that went into it there:
+https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=215a87451d1fd623fd2699fa57f16f8ab6f6a2f3
+https://sourceware.org/bugzilla/show_bug.cgi?id=6428
+
+this is to workaround broken clang assembler that fails w/CFLAGS=-g:
+http://crbug.com/585930
+https://llvm.org/bugs/show_bug.cgi?id=11740
+
+patch has been sent upstream too:
+https://gmplib.org/list-archives/gmp-bugs/2016-February/003916.html
+
+--- a/configure
++++ b/configure
+@@ -11339,7 +11339,7 @@ EOF
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; } \
+      && grep .note.GNU-stack conftest.s >/dev/null \
+-     && { ac_try='${CC} $CFLAGS $CPPFLAGS -Wa,--noexecstack
++     && { ac_try='${CC} $ASMFLAGS -Wa,--noexecstack
+                        -c -o conftest.o conftest.s >/dev/null'
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
index 6bc3b8fff4d54f941996bea661eb9fdd7e0f024f..e97c46f7cb2b939b0f3b84432e0b2e89171d919b 100644 (file)
@@ -38,6 +38,8 @@ src_prepare() {
        # note: we cannot run autotools here as gcc depends on this package
        elibtoolize
 
+       epatch "${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch
+
        # GMP uses the "ABI" env var during configure as does Gentoo (econf).
        # So, to avoid patching the source constantly, wrap things up.
        mv configure configure.wrapped || die