commit:     108a86ab528461f7feb43e967a5d94b87921e6f2
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  7 10:49:31 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jun  7 10:49:31 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=108a86ab

sys-devel/gcc: fix usage of -no-pie and -fno-PIE, bug #657522

Closes: https://bugs.gentoo.org/657522
Package-Manager: Portage-2.3.40.1-prefix, Repoman-2.3.9

 sys-devel/gcc/gcc-7.3.0-r3.ebuild | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys-devel/gcc/gcc-7.3.0-r3.ebuild 
b/sys-devel/gcc/gcc-7.3.0-r3.ebuild
index 1448758404..8d4055ed5e 100644
--- a/sys-devel/gcc/gcc-7.3.0-r3.ebuild
+++ b/sys-devel/gcc/gcc-7.3.0-r3.ebuild
@@ -46,6 +46,17 @@ src_configure() {
                powerpc*-darwin*)
                        # bug #381179
                        filter-flags "-mcpu=*" "-mtune=*"
+                       # bug #657522
+                       # A bug in configure checks whether -no-pie works, but 
the
+                       # compiler doesn't pass -no-pie onto the linker if 
-fno-PIE
+                       # isn't passed, so the configure check always finds 
-no-pie
+                       # is accepted.  (Likewise, when -fno-PIE is passed, the
+                       # compiler passes -no_pie onto the linker.)
+                       # Since our linker doesn't grok this, avoid above 
checks to
+                       # be run
+                       # NOTE: later ld64 does grok -no_pie, not -no-pie (as 
checked)
+                       export gcc_cv_c_no_fpie=no
+                       export gcc_cv_no_pie=no
                ;;
                *-solaris*)
                        # todo: some magic for native vs. GNU linking?

Reply via email to