diff options
author | Iain Sandoe <iain@codesourcery.com> | 2016-11-27 14:29:36 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2016-11-27 14:29:36 +0000 |
commit | eb89c82f46a10585c98e2019d775d920cf2fdea0 (patch) | |
tree | 3025ca76070f4fc7fb893b3a09ca0f62f3d28227 /gcc/config/darwin.h | |
parent | 7881b63fef5c682fb6c4e5b4009f5afc7971595b (diff) | |
download | gcc-eb89c82f46a10585c98e2019d775d920cf2fdea0.tar.gz |
[Darwin, config] Arrange for ld64 to be detected as Darwin's linker.
This is an initial patch in a series that converts Darwin's configury
to detect ld64 features, rather than the current process of hard-coding
them on target system version.
A ld64-compatible linker is currently required and assumed by Darwin.
If a DEFAULT_LINKER is set via --with-ld= then this will be tested to
see if it is ld64.
The ld64 version is determined for the chosen ld and this is exported for
use in setting a default value for -mtarget-linker (needed for run-time
code-gen changes to section choices).
The support for -rdynamic is converted to be detected at config time, or
by the ld64 version if that is found.
gcc/
2016-11-27 Iain Sandoe <iain@codesourcery.com>
PR target/71767
* configure.ac (with-ld64): New var, set for Darwin, set on
detection of ld64, gcc_cv_ld64_export_dynamic: New, New test.
* config/darwin.h: Use LD64_HAS_DYNAMIC export. DEF_LD64: New,
define.
* config/darwin10.h(DEF_LD64): Update for this target version.
* config/darwin12.h(LINK_GCC_C_SEQUENCE_SPEC): Remove rdynamic
test. (DEF_LD64): Update for this target version.
* configure: Regenerated.
* config.in: Regenerated.
From-SVN: r242894
Diffstat (limited to 'gcc/config/darwin.h')
-rw-r--r-- | gcc/config/darwin.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 045f70b2abb..541bcb3c8e5 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -165,6 +165,12 @@ extern GTY(()) int darwin_ms_struct; specifying the handling of options understood by generic Unix linkers, and for positional arguments like libraries. */ +#if LD64_HAS_EXPORT_DYNAMIC +#define DARWIN_EXPORT_DYNAMIC " %{rdynamic:-export_dynamic}" +#else +#define DARWIN_EXPORT_DYNAMIC " %{rdynamic: %nrdynamic is not supported}" +#endif + #define LINK_COMMAND_SPEC_A \ "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker)" \ @@ -185,7 +191,9 @@ extern GTY(()) int darwin_ms_struct; %{!nostdlib:%{!nodefaultlibs:\ %{%:sanitize(address): -lasan } \ %{%:sanitize(undefined): -lubsan } \ - %(link_ssp) %(link_gcc_c_sequence)\ + %(link_ssp) \ + " DARWIN_EXPORT_DYNAMIC " %<rdynamic \ + %(link_gcc_c_sequence) \ }}\ %{!nostdlib:%{!nostartfiles:%E}} %{T*} %{F*} }}}}}}}" @@ -932,4 +940,10 @@ extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **); fall-back default. */ #define DEF_MIN_OSX_VERSION "10.5" +#ifndef LD64_VERSION +#define LD64_VERSION "85.2" +#else +#define DEF_LD64 LD64_VERSION +#endif + #endif /* CONFIG_DARWIN_H */ |