aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/darwin.h
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2007-02-17 01:47:38 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2007-02-17 01:47:38 +0000
commite4cad568ec6bf80b86288e88edd52e9ded6a1f59 (patch)
treeb54bac4eca8b3eb965931f5a68d3ddea7dbbb03d /gcc/config/rs6000/darwin.h
parent982afe020cd1d11ae7d25162a83810a9b65b7729 (diff)
downloadgcc-e4cad568ec6bf80b86288e88edd52e9ded6a1f59.zip
gcc-e4cad568ec6bf80b86288e88edd52e9ded6a1f59.tar.gz
gcc-e4cad568ec6bf80b86288e88edd52e9ded6a1f59.tar.bz2
darwin.h (LINK_SPEC): Always pass -macosx_version_min to linker.
* config/darwin.h (LINK_SPEC): Always pass -macosx_version_min to linker. (DARWIN_EXTRA_SPECS): Add %(darwin_minversion). * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Just call darwin_rs6000_override_options. (C_COMMON_OVERRIDE_OPTIONS): Expect darwin_macosx_version_min to be non-NULL always. (TARGET_C99_FUNCTIONS): Likewise. (CC1_SPEC): Always pass -mmacosx-version-min to cc1*. (DARWIN_MINVERSION_SPEC): New. * config/rs6000/rs6000.c (darwin_rs6000_override_options): New. * config/i386/darwin.h (CC1_SPEC): Always pass -mmacosx-version-min to cc1*. (DARWIN_MINVERSION_SPEC): New. * config/darwin.opt (mmacosx-version-min): Initialize to non-NULL value. * config/darwin-c.c (darwin_cpp_builtins): Expect darwin_macosx_version_min to be non-NULL always. From-SVN: r122067
Diffstat (limited to 'gcc/config/rs6000/darwin.h')
-rw-r--r--gcc/config/rs6000/darwin.h84
1 files changed, 20 insertions, 64 deletions
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 158b1be..9a000c8 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -55,74 +55,23 @@
/* Translate config/rs6000/darwin.opt to config/darwin.h. */
#define TARGET_DYNAMIC_NO_PIC (TARGET_MACHO_DYNAMIC_NO_PIC)
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- if (!TARGET_64BIT) builtin_define ("__ppc__"); \
- if (TARGET_64BIT) builtin_define ("__ppc64__"); \
- builtin_define ("__POWERPC__"); \
- builtin_define ("__NATURAL_ALIGNMENT__"); \
- darwin_cpp_builtins (pfile); \
- } \
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ if (!TARGET_64BIT) builtin_define ("__ppc__"); \
+ if (TARGET_64BIT) builtin_define ("__ppc64__"); \
+ builtin_define ("__POWERPC__"); \
+ builtin_define ("__NATURAL_ALIGNMENT__"); \
+ darwin_cpp_builtins (pfile); \
+ } \
while (0)
-
-#define SUBTARGET_OVERRIDE_OPTIONS \
-do { \
- /* The Darwin ABI always includes AltiVec, can't be (validly) turned \
- off. */ \
- rs6000_altivec_abi = 1; \
- TARGET_ALTIVEC_VRSAVE = 1; \
- if (DEFAULT_ABI == ABI_DARWIN) \
- { \
- if (MACHO_DYNAMIC_NO_PIC_P) \
- { \
- if (flag_pic) \
- warning (0, "-mdynamic-no-pic overrides -fpic or -fPIC"); \
- flag_pic = 0; \
- } \
- else if (flag_pic == 1) \
- { \
- flag_pic = 2; \
- } \
- } \
- if (TARGET_64BIT && ! TARGET_POWERPC64) \
- { \
- target_flags |= MASK_POWERPC64; \
- warning (0, "-m64 requires PowerPC64 architecture, enabling"); \
- } \
- if (flag_mkernel) \
- { \
- rs6000_default_long_calls = 1; \
- target_flags |= MASK_SOFT_FLOAT; \
- } \
- \
- /* Make -m64 imply -maltivec. Darwin's 64-bit ABI includes \
- Altivec. */ \
- if (!flag_mkernel && !flag_apple_kext \
- && TARGET_64BIT \
- && ! (target_flags_explicit & MASK_ALTIVEC)) \
- target_flags |= MASK_ALTIVEC; \
- \
- /* Unless the user (not the configurer) has explicitly overridden \
- it with -mcpu=G3 or -mno-altivec, then 10.5+ targets default to \
- G4 unless targetting the kernel. */ \
- if (!flag_mkernel \
- && !flag_apple_kext \
- && darwin_macosx_version_min \
- && strverscmp (darwin_macosx_version_min, "10.5") >= 0 \
- && ! (target_flags_explicit & MASK_ALTIVEC) \
- && ! rs6000_select[1].string) \
- { \
- target_flags |= MASK_ALTIVEC; \
- } \
-} while(0)
+#define SUBTARGET_OVERRIDE_OPTIONS darwin_rs6000_override_options ()
#define C_COMMON_OVERRIDE_OPTIONS do { \
/* On powerpc, __cxa_get_exception_ptr is available starting in the \
10.4.6 libstdc++.dylib. */ \
- if ((! darwin_macosx_version_min \
- || strverscmp (darwin_macosx_version_min, "10.4.6") < 0) \
+ if (strverscmp (darwin_macosx_version_min, "10.4.6") < 0 \
&& flag_use_cxa_get_exception_ptr == 2) \
flag_use_cxa_get_exception_ptr = 0; \
if (flag_mkernel) \
@@ -144,6 +93,7 @@ do { \
#define CC1_SPEC "\
%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
+ -mmacosx-version-min=%(darwin_minversion) \
%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}}"
#define DARWIN_ARCH_SPEC "%{m64:ppc64;:ppc}"
@@ -171,6 +121,13 @@ do { \
#define DARWIN_CRT2_SPEC \
"%{!m64:%:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s)}"
+/* Determine a minimum version based on compiler options. */
+#define DARWIN_MINVERSION_SPEC \
+ "%{mmacosx-version-min=*:%*; \
+ m64:10.4; \
+ shared-libgcc:10.3; \
+ :10.1}"
+
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
DARWIN_EXTRA_SPECS \
@@ -473,8 +430,7 @@ do { \
#undef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS \
(TARGET_64BIT \
- || (darwin_macosx_version_min \
- && strverscmp (darwin_macosx_version_min, "10.3") >= 0))
+ || strverscmp (darwin_macosx_version_min, "10.3") >= 0)
/* When generating kernel code or kexts, we don't use Altivec by
default, as kernel code doesn't save/restore those registers. */