aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2019-07-03 18:43:55 +0000
committerIain Sandoe <iains@gcc.gnu.org>2019-07-03 18:43:55 +0000
commit03eddfb3b57152121154cf64fcd5c145000ee7f3 (patch)
tree941ec8ffc2065e4cb26e569a13d6414ab18b2258
parent179c7ef523f4331036fe70c298c2f5f46e4ba3b1 (diff)
downloadgcc-03eddfb3b57152121154cf64fcd5c145000ee7f3.zip
gcc-03eddfb3b57152121154cf64fcd5c145000ee7f3.tar.gz
gcc-03eddfb3b57152121154cf64fcd5c145000ee7f3.tar.bz2
[Darwin] Revise pie,no-pie and rdynamic driver specs.
Processing these early and pushing the corresponding Xlinker lines has the effect that the driver then supposes that there are linker inputs, and causes a link line to be created when it is not needed The solution is to place these drive specs into the link spec and claim them at the end of that. 2019-07-03 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases. (RDYNAMIC): Rename to, DARWIN_RDYNAMIC. (DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker clauses. (LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and DARWIN_NOPIE_SPEC. From-SVN: r273017
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/darwin.h24
2 files changed, 20 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f1794c8..d22753d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
2019-07-03 Iain Sandoe <iain@sandoe.co.uk>
+ * config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases.
+ (RDYNAMIC): Rename to, DARWIN_RDYNAMIC.
+ (DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker
+ clauses.
+ (LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and
+ DARWIN_NOPIE_SPEC.
+
+2019-07-03 Iain Sandoe <iain@sandoe.co.uk>
+
* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
(STARTFILE_SPEC): Split crt3 into a separate spec.
(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 72215ce..e17bc64 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -124,30 +124,25 @@ extern GTY(()) int darwin_ms_struct;
"%{fapple-kext|mkernel:-static}", \
"%{shared:-Zdynamiclib} %<shared", \
"%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} \
- %<gsplit-dwarf", \
- DARWIN_PIE_SPEC, \
- DARWIN_NOPIE_SPEC, \
- RDYNAMIC
+ %<gsplit-dwarf"
#if LD64_HAS_EXPORT_DYNAMIC
-#define RDYNAMIC "%{rdynamic:-Xlinker -export_dynamic} %<rdynamic"
+#define DARWIN_RDYNAMIC "%{rdynamic:-export_dynamic}"
#else
-#define RDYNAMIC "%{rdynamic:%nrdynamic is not supported} %<rdynamic"
+#define DARWIN_RDYNAMIC "%{rdynamic:%nrdynamic is not supported}"
#endif
/* FIXME: we should check that the linker supports the -pie and -no_pie.
options. */
#define DARWIN_PIE_SPEC \
-"%{pie|fpie|fPIE: \
+"%{pie|fpie|fPIE:\
%{mdynamic-no-pic: \
- %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
- : %:version-compare(>= 10.5 mmacosx-version-min= -Xlinker) \
- %:version-compare(>= 10.5 mmacosx-version-min= -pie) }} %<pie "
+ %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
+ :%:version-compare(>= 10.5 mmacosx-version-min= -pie) }} "
#define DARWIN_NOPIE_SPEC \
"%{no-pie|fno-pie|fno-PIE: \
- %:version-compare(>= 10.7 mmacosx-version-min= -Xlinker ) \
- %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %<no-pie "
+ %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) }"
#define DARWIN_CC1_SPEC \
"%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \
@@ -227,8 +222,11 @@ extern GTY(()) int darwin_ms_struct;
%(link_gcc_c_sequence) \
}}}\
%{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\
+ DARWIN_PIE_SPEC \
+ DARWIN_NOPIE_SPEC \
+ DARWIN_RDYNAMIC \
DARWIN_NOCOMPACT_UNWIND \
- "}}}}}}}"
+ "}}}}}}} %<pie %<no-pie %<rdynamic "
#define DSYMUTIL "\ndsymutil"