aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/darwin.h
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2006-10-16 19:53:29 +0000
committerMike Stump <mrs@gcc.gnu.org>2006-10-16 19:53:29 +0000
commitf475fd3c9e74adce232dbc3e82333d2c574a2ef8 (patch)
treeda708a8ea1a1ba16e416d1932eea2803f1bfd735 /gcc/config/rs6000/darwin.h
parentcc5c274102f86b028c67b4e2adbd95fbb214a87b (diff)
downloadgcc-f475fd3c9e74adce232dbc3e82333d2c574a2ef8.zip
gcc-f475fd3c9e74adce232dbc3e82333d2c574a2ef8.tar.gz
gcc-f475fd3c9e74adce232dbc3e82333d2c574a2ef8.tar.bz2
darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Add -mkernel support.
* config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Add -mkernel support. (C_COMMON_OVERRIDE_OPTIONS): Add -mkernel support. Add SUBTARGET_C_COMMON_OVERRIDE_OPTIONS callout. (CC1_SPEC): Don't turn on -fPIC when -mkernel is given. (OS_MISSING_ALTIVEC): Add. * config/i386/i386.c (override_options): Add SUBSUBTARGET_OVERRIDE_OPTIONS callout. * config/i386/darwin.h (CC1_SPEC): Don't turn on -fPIC when -mkernel, -static or -mdynamic-no-pic is given. (C_COMMON_OVERRIDE_OPTIONS): Add. * config/darwin.opt (fapple-kext): Add. (mkernel): Add. * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -fapple-kext, -findirect-virtual-calls, -fterminated-vtables and -mkernel support. (SUBSUBTARGET_OVERRIDE_OPTIONS): Add. (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): Add. (CPP_SPEC): Move defines for __DYNAMIC__ and __STATIC__ from here... (SUBTARGET_ATTRIBUTE_TABLE): Add apple_kext_compatibility. (TARGET_CXX_CDTOR_RETURNS_THIS): Add. (flag_mkernel): Add. (flag_apple_kext): Add. (TARGET_KEXTABI): Add. * config/darwin.c (darwin_handle_kext_attribute): Add. (DARWIN_VTABLE_P): Add. (darwin_binds_local_p): Add partial support for rebinding vtables in kexts. (darwin_kextabi_p): Add. (darwin_override_options): Add. * config/darwin-protos.h (darwin_handle_kext_attribute): Add. (darwin_kextabi_p): Add. (darwin_override_options): Add. * config/darwin-c.c (darwin_cpp_builtins): ... move defines for __DYNAMIC__ and __STATIC__ here. From-SVN: r117793
Diffstat (limited to 'gcc/config/rs6000/darwin.h')
-rw-r--r--gcc/config/rs6000/darwin.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 763cf56..374f001 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -91,6 +91,11 @@ do { \
target_flags |= MASK_POWERPC64; \
warning (0, "-m64 requires PowerPC64 architecture, enabling"); \
} \
+ if (flag_mkernel) \
+ { \
+ rs6000_default_long_calls = 1; \
+ target_flags |= MASK_SOFT_FLOAT; \
+ } \
} while(0)
#define C_COMMON_OVERRIDE_OPTIONS do { \
@@ -100,6 +105,9 @@ do { \
|| 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) \
+ flag_no_builtin = 1; \
+ SUBTARGET_C_COMMON_OVERRIDE_OPTIONS; \
} while (0)
/* Darwin has 128-bit long double support in libc in 10.4 and later.
@@ -114,9 +122,9 @@ do { \
the kernel or some such. */
#define CC1_SPEC "\
-%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
-%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
-%{!static:%{!mdynamic-no-pic:-fPIC}}"
+ %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
+ %{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
+ %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}}"
#define DARWIN_SUBARCH_SPEC " \
%{m64: ppc64} \
@@ -440,3 +448,7 @@ do { \
(TARGET_64BIT \
|| (darwin_macosx_version_min \
&& 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. */
+#define OS_MISSING_ALTIVEC (flag_mkernel || flag_apple_kext)