/* Operating system specific defines to be used when targeting GCC for
hosting on Windows32, using a Unix style C library and tools.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2007
+ 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#endif
#undef TARGET_64BIT_MS_ABI
-#define TARGET_64BIT_MS_ABI TARGET_64BIT
+#define TARGET_64BIT_MS_ABI (!cfun ? ix86_abi == MS_ABI : TARGET_64BIT && cfun->machine->call_abi == MS_ABI)
+
+#undef DEFAULT_ABI
+#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
target, always use the svr4_dbx_register_map for DWARF .eh_frame
even if we don't use DWARF .debug_frame. */
#undef DWARF_FRAME_REGNUM
-#define DWARF_FRAME_REGNUM(n) TARGET_64BIT \
- ? dbx64_register_map[(n)] : svr4_dbx_register_map[(n)]
+#define DWARF_FRAME_REGNUM(n) \
+ (TARGET_64BIT ? dbx64_register_map[(n)] \
+ : svr4_dbx_register_map[(n)])
#ifdef HAVE_GAS_PE_SECREL32_RELOC
/* Use section relative relocations for debugging offsets. Unlike
won't allow it. */
#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \
do { \
- if (SIZE != 4) \
+ if (SIZE != 4 && (!TARGET_64BIT || SIZE != 8)) \
abort (); \
\
fputs ("\t.secrel32\t", FILE); \
#include <stdio.h>
-#define MAYBE_UWIN_CPP_BUILTINS() /* Nothing. */
-
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("_X86_=1"); \
+ if (!TARGET_64BIT) \
+ builtin_define ("_X86_=1"); \
builtin_assert ("system=winnt"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
+ builtin_define ("__thiscall=__attribute__((__thiscall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
if (!flag_iso) \
{ \
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
+ builtin_define ("_thiscall=__attribute__((__thiscall__))"); \
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
} \
/* Even though linkonce works with static libs, this is needed \
to compare typeinfo symbols across dll boundaries. */ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
- MAYBE_UWIN_CPP_BUILTINS (); \
EXTRA_OS_CPP_BUILTINS (); \
} \
while (0)
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 32
\f
-#undef REG_PARM_STACK_SPACE
-#define REG_PARM_STACK_SPACE(FNDECL) (TARGET_64BIT_MS_ABI ? 32 : 0)
-
-#undef OUTGOING_REG_PARM_STACK_SPACE
-#define OUTGOING_REG_PARM_STACK_SPACE (TARGET_64BIT_MS_ABI ? 1 : 0)
-
-#undef REGPARM_MAX
-#define REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : 3)
-
-#undef SSE_REGPARM_MAX
-#define SSE_REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : TARGET_SSE ? 3 : 0)
-\f
/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
-/* Enable push_macro & pop_macro */
-#define HANDLE_PRAGMA_PUSH_POP_MACRO 1
union tree_node;
#define TREE union tree_node *
ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
} while (0)
+/* Output a reference to a label. Fastcall function symbols
+ keep their '@' prefix, while other symbols are prefixed
+ with user_label_prefix. */
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
+do { \
+ if ((NAME)[0] != FASTCALL_PREFIX) \
+ fputs (user_label_prefix, (STREAM)); \
+ fputs ((NAME), (STREAM)); \
+} while (0)
+
\f
/* Emit code to check the stack when allocating more than 4000
bytes in one go. */
#define CHECK_STACK_LIMIT 4000
#undef STACK_BOUNDARY
-#define STACK_BOUNDARY (TARGET_64BIT_MS_ABI ? 128 : BITS_PER_WORD)
+#define STACK_BOUNDARY (ix86_abi == MS_ABI ? 128 : BITS_PER_WORD)
/* By default, target has a 80387, uses IEEE compatible arithmetic,
returns float values in the 387 and needs stack probes.
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS \
| MASK_STACK_PROBE | MASK_ALIGN_DOUBLE)
+#undef TARGET_SUBTARGET64_DEFAULT
+#define TARGET_SUBTARGET64_DEFAULT \
+ MASK_128BIT_LONG_DOUBLE
+
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
#define ASM_COMMENT_START " #"
#ifndef DWARF2_UNWIND_INFO
-/* 64-bit target uses DWARF2 unwind by default. If 32-bit target
- configured with --disable-sjlj-exceptions, use DWARF2, else default
- to SJLJ. */
-#if TARGET_64BIT_DEFAULT \
- || (defined (CONFIG_SJLJ_EXCEPTIONS) && !CONFIG_SJLJ_EXCEPTIONS)
+/* If configured with --disable-sjlj-exceptions, use DWARF2, else
+ default to SJLJ. */
+#if (defined (CONFIG_SJLJ_EXCEPTIONS) && !CONFIG_SJLJ_EXCEPTIONS)
+/* The logic of this #if must be kept synchronised with the logic
+ for selecting the tmake_eh_file fragment in config.gcc. */
#define DWARF2_UNWIND_INFO 1
+/* If multilib is selected break build as sjlj is required. */
+#if defined (TARGET_BI_ARCH)
+#error For 64-bit windows and 32-bit based multilib version of gcc just SJLJ exceptions are supported.
+#endif
#else
#define DWARF2_UNWIND_INFO 0
#endif
#undef MS_AGGREGATE_RETURN
#define MS_AGGREGATE_RETURN 1
-/* No data type wants to be aligned rounder than this. */
-#undef BIGGEST_ALIGNMENT
-#define BIGGEST_ALIGNMENT 128
-
/* Biggest alignment supported by the object file format of this
machine. Use this macro to limit the alignment which can be
specified using the `__attribute__ ((aligned (N)))' construct. If
{ \
const char *alias \
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ i386_pe_maybe_record_exported_symbol (DECL, alias, 0); \
if (TREE_CODE (DECL) == FUNCTION_DECL) \
i386_pe_declare_function_type (STREAM, alias, \
TREE_PUBLIC (DECL)); \
/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
but for .jcr section to work we also need crtbegin and crtend
objects. */
-#define TARGET_USE_JCR_SECTION 0
+#define TARGET_USE_JCR_SECTION 1
/* Decide whether it is safe to use a local alias for a virtual function
when constructing thunks. */