1
0
mirror of https://github.com/pmmp/musl-cross-make.git synced 2024-11-18 04:37:40 +00:00
musl-cross-make/patches/gcc-4.2.1/0005-staticpie.diff
Rich Felker 06a1f34243 add support for gcc 4.2.1 (last gplv2 version)
patch set consists of:

0001 full musl libc target support
0002 fixes for wrong optimizations of weak defs/aliases
0003 various sh breakage in configure scripts
0005 static pie support
0006 --enable-default-pie support
0008 fix for cross compiling bug in build system
0009 fix for wrong default div strategy for sh2 (missing libgcc code)
0010 fix failure to build on modern host gcc due to gnu-inline
0011 fix sh & alpha bootstrap failures before libc is built
0012 fix broken local-exec TLS with -fPIE on sh
2015-11-06 06:23:54 +00:00

29 lines
1022 B
Diff

diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 1967b46..39f8cb4 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -41,8 +41,8 @@ Boston, MA 02110-1301, USA. */
#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
- "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:%{static:rcrt1.o%s;:Scrt1.o%s};:crt1.o%s}} \
+ crti.o%s %{shared|pie:crtbeginS.o%s;static:crtbeginT.o%s;:crtbegin.o%s}"
#else
#define STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0b5ee4b..41d17a5 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -684,7 +684,7 @@ proper position among the other output files. */
#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