#define DARWIN_RDYNAMIC "%{rdynamic:%nrdynamic is not supported}"
#endif
-/* FIXME: we should check that the linker supports the -pie and -no_pie.
+/* 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.
+ FIXME: we should check that the linker supports the -pie and -no_pie.
options. */
#define DARWIN_PIE_SPEC \
"%{pie|fpie|fPIE:\
%{mdynamic-no-pic: \
%n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
- :%:version-compare(>= 10.5 mmacosx-version-min= -pie) }} "
+ :%:version-compare(>= 10.5 mmacosx-version-min= -pie) }; \
+ mdynamic-no-pic:%:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } "
#define DARWIN_NOPIE_SPEC \
"%{no-pie|fno-pie|fno-PIE: \