From: Magnus Granberg Date: Sat, 18 Nov 2017 17:16:48 +0000 (+0100) Subject: toolchain.eclass: Add -no-pie to stage1 LDFLAGS when building =gcc6... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ff4fba46149d5e5e2db6b923fa70881ff4ca58ff;p=gentoo.git toolchain.eclass: Add -no-pie to stage1 LDFLAGS when building =gcc6, bug 618908 Closes: https://bugs.gentoo.org/618908 --- diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 9dca44439c9d..503f7dbe94ff 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -641,6 +641,14 @@ do_gcc_PIE_patches() { make_gcc_hard() { local gcc_hard_flags="" + + # If we use gcc-6 or newer with pie enable to compile older gcc we need to pass -no-pie + # to stage1; bug 618908 + if ! tc_version_is_at_least 6.0 && [[ $(gcc-major-version) -ge 6 ]] ; then + einfo "Disabling PIE in stage1 (only) ..." + sed -i -e "/^STAGE1_LDFLAGS/ s/$/ -no-pie/" "${S}"/Makefile.in || die + fi + # Gcc >= 6.X we can use configurations options to turn pie/ssp on as default if tc_version_is_at_least 6.0 ; then if use pie ; then