diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-09-07 14:55:46 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2024-09-07 14:55:46 +0000 |
| commit | 1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc (patch) | |
| tree | 8a8d1e0c31e3328c9897c3727a555c693ef8a2fc /musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff | |
| download | ToolchainFactory-1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc.tar.gz | |
Initial commit
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff')
| -rw-r--r-- | musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff b/musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff new file mode 100644 index 0000000..9073217 --- /dev/null +++ b/musl/patches-in-mcm/gcc-13.2.0/0004-static-pie.diff @@ -0,0 +1,89 @@ +diff -rNU3 gcc-13.2.0.old/gcc/common.opt gcc-13.2.0/gcc/common.opt +--- gcc-13.2.0.old/gcc/common.opt 2023-07-27 08:13:04.000000000 +0000 ++++ gcc-13.2.0/gcc/common.opt 2023-08-30 18:18:22.940099965 +0000 +@@ -3669,11 +3669,11 @@ + + no-pie + Driver RejectNegative Negative(shared) +-Don't create a dynamically linked position independent executable. ++Don't create a position independent executable. + + pie + Driver RejectNegative Negative(no-pie) +-Create a dynamically linked position independent executable. ++Create a position independent executable. + + static-pie + Driver RejectNegative Negative(pie) +diff -rNU3 gcc-13.2.0.old/gcc/config/gnu-user.h gcc-13.2.0/gcc/config/gnu-user.h +--- gcc-13.2.0.old/gcc/config/gnu-user.h 2023-07-27 08:13:04.000000000 +0000 ++++ gcc-13.2.0/gcc/config/gnu-user.h 2023-08-30 18:15:07.990098698 +0000 +@@ -51,13 +51,12 @@ + #define GNU_USER_TARGET_STARTFILE_SPEC \ + "%{shared:; \ + pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \ +- static:crt1.o%s; \ +- static-pie:rcrt1.o%s; \ ++ static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \ + " PIE_SPEC ":Scrt1.o%s; \ + :crt1.o%s} " \ + GNU_USER_TARGET_CRTI " \ +- %{static:crtbeginT.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ ++ %{shared|" PIE_SPEC ":crtbeginS.o%s; \ ++ static:crtbeginT.o%s; \ + :crtbegin.o%s} \ + %{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_start_preinit.o%s; \ +@@ -73,11 +72,11 @@ + GNU userspace "finalizer" file, `crtn.o'. */ + + #define GNU_USER_TARGET_ENDFILE_SPEC \ +- "%{!static:%{fvtable-verify=none:%s; \ ++ "%{static|static-pie:; \ ++ fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ +- fvtable-verify=std:vtv_end.o%s}} \ +- %{static:crtend.o%s; \ +- shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ ++ fvtable-verify=std:vtv_end.o%s} \ ++ %{shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} " \ + GNU_USER_TARGET_CRTN " " \ + CRTOFFLOADEND +@@ -106,7 +105,7 @@ + #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " ++#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} " + #endif + + #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ +diff -rNU3 gcc-13.2.0.old/gcc/gcc.cc gcc-13.2.0/gcc/gcc.cc +--- gcc-13.2.0.old/gcc/gcc.cc 2023-07-27 08:13:04.000000000 +0000 ++++ gcc-13.2.0/gcc/gcc.cc 2023-08-30 18:15:11.750098722 +0000 +@@ -1003,7 +1003,7 @@ + #define NO_FPIE_AND_FPIC_SPEC NO_FPIE_SPEC "|" NO_FPIC_SPEC + #define FPIE_OR_FPIC_SPEC NO_FPIE_AND_FPIC_SPEC ":;" + #else +-#define PIE_SPEC "pie" ++#define PIE_SPEC "pie|static-pie" + #define FPIE1_SPEC "fpie" + #define NO_FPIE1_SPEC FPIE1_SPEC ":;" + #define FPIE2_SPEC "fPIE" +@@ -1027,12 +1027,12 @@ + #ifndef LINK_PIE_SPEC + #ifdef HAVE_LD_PIE + #ifndef LD_PIE_SPEC +-#define LD_PIE_SPEC "-pie" ++#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}" + #endif + #else + #define LD_PIE_SPEC "" + #endif +-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " ++#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} " + #endif + + #ifndef LINK_BUILDID_SPEC |
