From 4d54b1daeefc0acd44a6d8971c70104a534ed853 Mon Sep 17 00:00:00 2001 From: Mark Wright Date: Wed, 1 Mar 2017 23:57:07 +1100 Subject: dev-lisp/sbcl: Fix the detection of -nopie and -no-pie. The change 3403dbaffc0a9bab49b78cf0bb5308cce0a0c153 that upstream did for https://bugs.launchpad.net/sbcl/+bug/1633559 does not work on Gentoo. So it was patched out in the fix for #607302 with sbcl-1.3.14-config.patch, which unfortunately leads to #583930. Thanks to Toralf Forster for reporting, and grozin for testing. Gentoo-bug: 599902, 607302, 583930 Package-Manager: portage-2.3.3 --- dev-lisp/sbcl/files/sbcl-1.3.14-config.patch | 22 ---------------------- ...4-gentoo-fix_nopie_for_hardened_toolchain.patch | 17 +++++++++++++++++ dev-lisp/sbcl/sbcl-1.3.14.ebuild | 11 +++-------- 3 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 dev-lisp/sbcl/files/sbcl-1.3.14-config.patch create mode 100644 dev-lisp/sbcl/files/sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch (limited to 'dev-lisp') diff --git a/dev-lisp/sbcl/files/sbcl-1.3.14-config.patch b/dev-lisp/sbcl/files/sbcl-1.3.14-config.patch deleted file mode 100644 index c12700d0d6f..00000000000 --- a/dev-lisp/sbcl/files/sbcl-1.3.14-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nuar a/src/runtime/GNUmakefile b/src/runtime/GNUmakefile ---- a/src/runtime/GNUmakefile 2017-01-22 20:43:20.000000000 +0100 -+++ b/src/runtime/GNUmakefile 2017-02-09 15:42:22.340029401 +0100 -@@ -39,18 +39,6 @@ - # OS_SRC, OS_LIBS, OS_CLEAN_FILES - include Config - --# Disable PIE when possible --ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e no-pie),) --CFLAGS += -fno-pie --LINKFLAGS += -no-pie --LDFLAGS += -no-pie --endif --ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e -nopie),) --CFLAGS += -fno-pie --LINKFLAGS += -nopie --LDFLAGS += -nopie --endif -- - COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c dynbind.c \ - funcall.c gc-common.c globals.c interr.c interrupt.c \ - largefile.c monitor.c os-common.c parse.c print.c purify.c \ diff --git a/dev-lisp/sbcl/files/sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch b/dev-lisp/sbcl/files/sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch new file mode 100644 index 00000000000..aa74a2d6135 --- /dev/null +++ b/dev-lisp/sbcl/files/sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch @@ -0,0 +1,17 @@ +--- sbcl-1.3.14-orig/src/runtime/GNUmakefile 2017-01-23 06:43:20.000000000 +1100 ++++ sbcl-1.3.14/src/runtime/GNUmakefile 2017-02-28 12:44:37.627161988 +1100 +@@ -40,12 +40,12 @@ + include Config + + # Disable PIE when possible +-ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e no-pie),) ++ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]no-pie'),) + CFLAGS += -fno-pie + LINKFLAGS += -no-pie + LDFLAGS += -no-pie + endif +-ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e -nopie),) ++ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]nopie'),) + CFLAGS += -fno-pie + LINKFLAGS += -nopie + LDFLAGS += -nopie diff --git a/dev-lisp/sbcl/sbcl-1.3.14.ebuild b/dev-lisp/sbcl/sbcl-1.3.14.ebuild index cd554d0f16c..0dcdad37d0b 100644 --- a/dev-lisp/sbcl/sbcl-1.3.14.ebuild +++ b/dev-lisp/sbcl/sbcl-1.3.14.ebuild @@ -1,5 +1,6 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# $Id$ EAPI=6 inherit multilib eutils flag-o-matic pax-utils @@ -100,18 +101,12 @@ src_prepare() { eapply "${FILESDIR}"/bsd-sockets-test-1.3.12.patch # bugs #560276, #561018 eapply "${FILESDIR}"/sb-posix-test-1.2.15.patch - # bug #599902, #607302 - eapply "${FILESDIR}"/${PN}-1.3.14-config.patch + # bug #599902, #607302, #583930 + eapply "${FILESDIR}"/${PN}-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch eapply "${FILESDIR}"/${PN}-1.2.11-solaris.patch eapply "${FILESDIR}"/${PN}-1.2.13-verbose-build.patch - # To make the hardened compiler NOT compile with -fPIE -pie - if gcc-specs-pie ; then - einfo "Disabling PIE..." - eapply "${FILESDIR}"/${PN}-1.1.17-gentoo-fix_nopie_for_hardened_toolchain.patch - fi - eapply_user # bug #526194 -- cgit v1.2.1