From 1c19e88d2123f0cbffa737c7dbe983b7d8905fd5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 30 Sep 2015 01:20:14 +0000 Subject: [PATCH] update gcc static PIE patch to work with all targets since -E is no longer passed to the linker, musl commit 6fc30c2493fcfedec89e45088bea87766a1e3286 is now necessary to get a version of rcrt1.o that works with the new static PIE support, or -Wl,-E can be passed manually to work with old rcrt1.o. --- patches/gcc-5.2.0/0005-staticpie.diff | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/patches/gcc-5.2.0/0005-staticpie.diff b/patches/gcc-5.2.0/0005-staticpie.diff index c012017..2668462 100644 --- a/patches/gcc-5.2.0/0005-staticpie.diff +++ b/patches/gcc-5.2.0/0005-staticpie.diff @@ -11,14 +11,14 @@ %{fvtable-verify=none:%s; \ fvtable-verify=preinit:vtv_start_preinit.o%s; \ fvtable-verify=std:vtv_start.o%s}" ---- gcc-5.2.0.orig/gcc/config/sh/linux.h 2015-01-05 12:33:28.000000000 +0000 -+++ gcc-5.2.0/gcc/config/sh/linux.h 2015-08-25 07:57:14.161690536 +0000 -@@ -53,7 +75,7 @@ - %{!static: \ - %{rdynamic:-export-dynamic} \ - -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ -- %{static:-static}" -+ %{static:-static -E --no-dynamic-linker}" +--- gcc-5.2.0.orig/gcc/gcc.c 2015-03-10 09:37:41.000000000 +0000 ++++ gcc-5.2.0/gcc/gcc.c 2015-09-30 00:25:33.225927941 +0000 +@@ -739,7 +739,7 @@ - /* Output assembler code to STREAM to call the profiler. */ - #undef FUNCTION_PROFILER + #ifndef LINK_PIE_SPEC + #ifdef HAVE_LD_PIE +-#define LINK_PIE_SPEC "%{pie:-pie} " ++#define LINK_PIE_SPEC "%{pie:-pie %{static:--no-dynamic-linker}} " + #else + #define LINK_PIE_SPEC "%{pie:} " + #endif