/* Target definitions for x86 running Darwin.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* Enable Mach-O bits in generic x86 code. */
#undef TARGET_MACHO
#define TARGET_MACHO 1
-#define TARGET_VERSION fprintf (stderr, " (i386 Darwin)");
+#define TARGET_VERSION fprintf (stderr, " (i686 Darwin)");
+
+#undef TARGET_FPMATH_DEFAULT
+#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387)
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__i386__"); \
builtin_define ("__LITTLE_ENDIAN__"); \
- builtin_define ("__MACH__"); \
- builtin_define ("__APPLE__"); \
+ darwin_cpp_builtins (pfile); \
} \
while (0)
+#undef FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
+#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN (0)
+
/* We want -fPIC by default, unless we're using -static to compile for
the kernel or some such. */
#undef CC1_SPEC
-#define CC1_SPEC "%{!static:-fPIC}"
+#define CC1_SPEC "%{!static:-fPIC}\
+ %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"
+
+#undef ASM_SPEC
+#define ASM_SPEC "-arch i386 -force_cpusubtype_ALL"
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "darwin_arch", "i386" }, \
+ { "darwin_crt2", "" }, \
+ { "darwin_subarch", "i386" },
+
+/* Use the following macro for any Darwin/x86-specific command-line option
+ translation. */
+#define SUBTARGET_OPTION_TRANSLATE_TABLE \
+ { "", "" }
/* The Darwin assembler mostly follows AT&T syntax. */
#undef ASSEMBLER_DIALECT
#define SHIFT_DOUBLE_OMITS_COUNT 0
+extern void darwin_x86_file_end (void);
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END darwin_x86_file_end
+
/* Define the syntax of pseudo-ops, labels and comments. */
/* String containing the assembler's comment-starter. */
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387. */
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
-
-/* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */
-
-#undef TARGET_DEEP_BRANCH_PREDICTION
-#define TARGET_DEEP_BRANCH_PREDICTION 0
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_128BIT_LONG_DOUBLE | MASK_ALIGN_DOUBLE)
/* For now, disable dynamic-no-pic. We'll need to go through i386.c
with a fine-tooth comb looking for refs to flag_pic! */
#define MASK_MACHO_DYNAMIC_NO_PIC 0
#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC)
+#undef GOT_SYMBOL_NAME
+#define GOT_SYMBOL_NAME (machopic_function_base_name ())
+
/* Define the syntax of pseudo-ops, labels and comments. */
#define LPREFIX "L"
+/* These are used by -fbranch-probabilities */
+#define HOT_TEXT_SECTION_NAME "__TEXT,__text,regular,pure_instructions"
+#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME \
+ "__TEXT,__unlikely,regular,pure_instructions"
+
/* Assembler pseudos to introduce constants of various size. */
#define ASM_BYTE_OP "\t.byte\t"
#define ASM_LONG "\t.long\t"
/* Darwin as doesn't do ".quad". */
+#define SUBTARGET_ENCODE_SECTION_INFO darwin_encode_section_info
+
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if ((LOG) != 0) \
{ \
- if (in_text_section ()) \
+ if (in_section == text_section) \
fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
else \
fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
do { \
if (MACHOPIC_INDIRECT) \
{ \
- const char *name = machopic_stub_name ("*mcount"); \
+ const char *name = machopic_mcount_stub_name (); \
fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \
- machopic_validate_stub_or_non_lazy_ptr (name, /*stub:*/1); \
+ machopic_validate_stub_or_non_lazy_ptr (name); \
} \
else fprintf (FILE, "\tcall mcount\n"); \
} while (0)