summaryrefslogtreecommitdiff
path: root/gcc/config/darwin.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/darwin.h')
-rw-r--r--gcc/config/darwin.h16
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 */