#define DARWIN_RDYNAMIC "%{rdynamic:%nrdynamic is not supported}"
#endif
+#if LD64_HAS_PLATFORM_VERSION
+#define DARWIN_PLATFORM_ID \
+ "%{mmacosx-version-min=*: -platform_version macos %* 0.0} "
+#else
+#define DARWIN_PLATFORM_ID \
+ "%{mmacosx-version-min=*:-macosx_version_min %*} "
+#endif
+
/* Code built with mdynamic-no-pic does not support PIE/PIC, so we disallow
these combinations; we also ensure that the no_pie option is passed to
ld64 on system versions that default to PIE when mdynamic-no-pic is given.
LINK_PLUGIN_SPEC \
"%{flto*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} \
- %l " LINK_COMPRESS_DEBUG_SPEC \
+ %l " \
+ DARWIN_PLATFORM_ID \
+ LINK_COMPRESS_DEBUG_SPEC \
"%X %{s} %{t} %{Z} %{u*} \
%{e*} %{r} \
%{o*}%{!o:-o a.out} \
%{force_cpusubtype_ALL:-arch %(darwin_arch)} \
%{!force_cpusubtype_ALL:-arch %(darwin_subarch)} "\
LINK_SYSROOT_SPEC \
- "%{mmacosx-version-min=*:-macosx_version_min %*} \
- %{!multiply_defined*:%{shared-libgcc: \
+ "%{!multiply_defined*:%{shared-libgcc: \
%:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
%:version-compare(< 10.5 mmacosx-version-min= suppress) }} \
%{sectalign*} %{sectcreate*} %{sectobjectsymbols*} %{sectorder*} \