cygwin.h revision 117395
152284Sobrien/* Operating system specific defines to be used when targeting GCC for
290075Sobrien   hosting on Windows32, using a Unix style C library and tools.
3117395Skan   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
490075Sobrien   Free Software Foundation, Inc.
552284Sobrien
652284SobrienThis file is part of GNU CC.
752284Sobrien
852284SobrienGNU CC is free software; you can redistribute it and/or modify
952284Sobrienit under the terms of the GNU General Public License as published by
1052284Sobrienthe Free Software Foundation; either version 2, or (at your option)
1152284Sobrienany later version.
1252284Sobrien
1352284SobrienGNU CC is distributed in the hope that it will be useful,
1452284Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1552284SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1652284SobrienGNU General Public License for more details.
1752284Sobrien
1852284SobrienYou should have received a copy of the GNU General Public License
1952284Sobrienalong with GNU CC; see the file COPYING.  If not, write to
2052284Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
2190075SobrienBoston, MA 02111-1307, USA.  */
2252284Sobrien
23117395Skan#define DBX_DEBUGGING_INFO 1
24117395Skan#define SDB_DEBUGGING_INFO 1
2552284Sobrien#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
2652284Sobrien
27117395Skan#define TARGET_VERSION fprintf (stderr, " (x86 Cygwin)");
2890075Sobrien#define TARGET_EXECUTABLE_SUFFIX ".exe"
2990075Sobrien
3090075Sobrien#include <stdio.h>
31117395Skan#include "i386/i386.h"
32117395Skan#include "i386/unix.h"
33117395Skan#include "i386/bsd.h"
3452284Sobrien#include "i386/gas.h"
3552284Sobrien#include "dbxcoff.h"
3652284Sobrien
37117395Skan/* Masks for subtarget switches used by other files.  */
38117395Skan#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions */
3952284Sobrien
40117395Skan/* Used in winnt.c.  */
4152284Sobrien#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT)
4252284Sobrien
4352284Sobrien#undef  SUBTARGET_SWITCHES
4452284Sobrien#define SUBTARGET_SWITCHES \
45117395Skan{ "cygwin",		  0, N_("Use the Cygwin interface") },	\
46117395Skan{ "no-cygwin",		  0, N_("Use the Mingw32 interface") },	\
47117395Skan{ "windows",		  0, N_("Create GUI application") },	\
48117395Skan{ "no-win32",		  0, N_("Don't set Windows defines") },	\
49117395Skan{ "win32",		  0, N_("Set Windows defines") },	\
50117395Skan{ "console",		  0, N_("Create console application") },\
51117395Skan{ "dll",		  0, N_("Generate code for a DLL") },	\
52117395Skan{ "nop-fun-dllimport",	  MASK_NOP_FUN_DLLIMPORT,		\
53117395Skan  N_("Ignore dllimport for functions") }, 			\
54117395Skan{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" },	\
5590075Sobrien{ "threads",		  0, N_("Use Mingw-specific thread support") },
5652284Sobrien
57117395Skan#define MAYBE_UWIN_CPP_BUILTINS() /* Nothing.  */
58117395Skan#define TARGET_OS_CPP_BUILTINS()					\
59117395Skan  do									\
60117395Skan    {									\
61117395Skan	builtin_define ("_X86_=1");					\
62117395Skan	builtin_assert ("system=winnt");				\
63117395Skan	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
64117395Skan	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
65117395Skan	builtin_define ("__declspec(x)=__attribute__((x))");		\
66117395Skan	if (!flag_iso)							\
67117395Skan	  {								\
68117395Skan	    builtin_define ("_stdcall=__attribute__((__stdcall__))");	\
69117395Skan	    builtin_define ("_cdecl=__attribute__((__cdecl__))");	\
70117395Skan	  }								\
71117395Skan	MAYBE_UWIN_CPP_BUILTINS ();					\
72117395Skan    }									\
73117395Skan  while (0)
7452284Sobrien
7590075Sobrien#ifdef CROSS_COMPILE
7690075Sobrien#define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}"
7790075Sobrien#define W32API_INC "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include/w32api}"
7890075Sobrien#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/"
7990075Sobrien#define CYGWIN_LIB CYGWIN_CROSS_DIR "/lib"
8090075Sobrien#define MINGW_LIBS "-L" CYGWIN_CROSS_DIR "/lib/mingw"
8190075Sobrien#define MINGW_INCLUDES "%{!nostdinc:-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++-3 "\
8290075Sobrien		       "-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++ "\
8390075Sobrien		       "-idirafter " CYGWIN_CROSS_DIR "/include/mingw}"
8490075Sobrien#else
8590075Sobrien#define CYGWIN_INCLUDES "%{!nostdinc:-isystem /usr/local/include "\
8690075Sobrien		           "-idirafter " CYGWIN_CROSS_DIR "/include "\
8790075Sobrien		           "-idirafter /usr/include}"
8890075Sobrien#define W32API_INC "%{!nostdinc:"\
8990075Sobrien		      "-idirafter " CYGWIN_CROSS_DIR "/include/w32api "\
9090075Sobrien		      "-idirafter /usr/include/w32api}"
9190075Sobrien#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/ -L/usr/lib/w32api/"
9290075Sobrien#define CYGWIN_LIB "/usr/lib"
9390075Sobrien#define MINGW_LIBS "-L/usr/local/lib/mingw -L/usr/lib/mingw"
9490075Sobrien#define MINGW_INCLUDES "%{!nostdinc:-isystem /usr/include/mingw/g++-3 "\
9590075Sobrien		       "-isystem /usr/include/mingw/g++ "\
9690075Sobrien		       "-isystem /usr/local/include/mingw "\
9790075Sobrien		       "-idirafter " CYGWIN_CROSS_DIR "/include/mingw "\
9890075Sobrien		       "-idirafter /usr/include/mingw}"
9990075Sobrien#endif
10090075Sobrien
10190075Sobrien/* Get tree.c to declare a target-specific specialization of
10290075Sobrien   merge_decl_attributes.  */
10390075Sobrien#define TARGET_DLLIMPORT_DECL_ATTRIBUTES
10490075Sobrien
10552284Sobrien/* Support the __declspec keyword by turning them into attributes.
10652284Sobrien   We currently only support: dllimport and dllexport.
10752284Sobrien   Note that the current way we do this may result in a collision with
10852284Sobrien   predefined attributes later on.  This can be solved by using one attribute,
10952284Sobrien   say __declspec__, and passing args to it.  The problem with that approach
11052284Sobrien   is that args are not accumulated: each new appearance would clobber any
11152284Sobrien   existing args.  */
11252284Sobrien
11390075Sobrien#undef CPP_SPEC
114117395Skan#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
11590075Sobrien  %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
11690075Sobrien  %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
11790075Sobrien    MINGW_INCLUDES "} \
11890075Sobrien  %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix "\
11990075Sobrien    CYGWIN_INCLUDES "}\
12090075Sobrien  %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}\
12190075Sobrien  %{!mno-win32:" W32API_INC "}\
12290075Sobrien"
12352284Sobrien
12490075Sobrien#undef STARTFILE_SPEC
12590075Sobrien#define STARTFILE_SPEC "\
12690075Sobrien  %{shared|mdll: %{mno-cygwin:" MINGW_LIBS " dllcrt2%O%s}}\
12790075Sobrien  %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:" MINGW_LIBS " crt2%O%s}\
12890075Sobrien  %{pg:gcrt0%O%s}}}\
12990075Sobrien"
13090075Sobrien
13152284Sobrien/* Normally, -lgcc is not needed since everything in it is in the DLL, but we
13252284Sobrien   want to allow things to be added to it when installing new versions of
13352284Sobrien   GCC without making a new CYGWIN.DLL, so we leave it.  Profiling is handled
13490075Sobrien   by calling the init function from the prologue.  */
13552284Sobrien
13690075Sobrien#undef LIBGCC_SPEC
137117395Skan#define LIBGCC_SPEC "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32}	\
138117395Skan  -lgcc %{mno-cygwin:-lmoldname -lmingwex -lmsvcrt}"
13952284Sobrien
14052284Sobrien/* This macro defines names of additional specifications to put in the specs
14152284Sobrien   that can be used in various specifications like CC1_SPEC.  Its definition
14252284Sobrien   is an initializer with a subgrouping for each command option.
14352284Sobrien
14452284Sobrien   Each subgrouping contains a string constant, that defines the
14552284Sobrien   specification name, and a string constant that used by the GNU CC driver
14652284Sobrien   program.
14752284Sobrien
14852284Sobrien   Do not define this macro if it does not need to do anything.  */
14952284Sobrien
15052284Sobrien#undef  SUBTARGET_EXTRA_SPECS
15152284Sobrien#define SUBTARGET_EXTRA_SPECS 						\
15252284Sobrien  { "mingw_include_path", DEFAULT_TARGET_MACHINE }
15352284Sobrien
15452284Sobrien/* We have to dynamic link to get to the system DLLs.  All of libc, libm and
15552284Sobrien   the Unix stuff is in cygwin.dll.  The import library is called
15652284Sobrien   'libcygwin.a'.  For Windows applications, include more libraries, but
15752284Sobrien   always include kernel32.  We'd like to specific subsystem windows to
15852284Sobrien   ld, but that doesn't work just yet.  */
15952284Sobrien
16052284Sobrien#undef LIB_SPEC
16190075Sobrien#define LIB_SPEC "\
16290075Sobrien  %{pg:-lgmon} \
16390075Sobrien  %{!mno-cygwin:-lcygwin} \
16490075Sobrien  %{mno-cygwin:%{mthreads:-lmingwthrd} -lmingw32} \
16590075Sobrien  %{mwindows:-lgdi32 -lcomdlg32} \
16690075Sobrien  -luser32 -lkernel32 -ladvapi32 -lshell32"
16752284Sobrien
16890075Sobrien#define LINK_SPEC W32API_LIB "\
16990075Sobrien  %{mwindows:--subsystem windows} \
17090075Sobrien  %{mconsole:--subsystem console} \
17190075Sobrien  %{shared: %{mdll: %eshared and mdll are not compatible}} \
17290075Sobrien  %{shared: --shared} %{mdll:--dll} \
17390075Sobrien  %{static:-Bstatic} %{!static:-Bdynamic} \
17490075Sobrien  %{shared|mdll: -e \
17590075Sobrien    %{mno-cygwin:_DllMainCRTStartup@12} \
17690075Sobrien    %{!mno-cygwin:__cygwin_dll_entry@12}}\
17790075Sobrien  --dll-search-prefix=cyg"
17852284Sobrien
17990075Sobrien#undef MATH_LIBRARY
18090075Sobrien#define MATH_LIBRARY ""
18152284Sobrien
18252284Sobrien#define SIZE_TYPE "unsigned int"
18352284Sobrien#define PTRDIFF_TYPE "int"
18452284Sobrien#define WCHAR_TYPE_SIZE 16
18552284Sobrien#define WCHAR_TYPE "short unsigned int"
18652284Sobrien
18752284Sobrien
18852284Sobrien/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */
18952284Sobrien#define HANDLE_PRAGMA_PACK_PUSH_POP 1
19052284Sobrien
19190075Sobrienunion tree_node;
19290075Sobrien#define TREE union tree_node *
19352284Sobrien
19452284Sobrien#undef EXTRA_SECTIONS
19590075Sobrien#define EXTRA_SECTIONS in_drectve
19652284Sobrien
19752284Sobrien#undef EXTRA_SECTION_FUNCTIONS
19852284Sobrien#define EXTRA_SECTION_FUNCTIONS					\
19952284Sobrien  DRECTVE_SECTION_FUNCTION					\
20052284Sobrien  SWITCH_TO_SECTION_FUNCTION
20152284Sobrien
20252284Sobrien#define DRECTVE_SECTION_FUNCTION \
20352284Sobrienvoid									\
20452284Sobriendrectve_section ()							\
20552284Sobrien{									\
20652284Sobrien  if (in_section != in_drectve)						\
20752284Sobrien    {									\
20852284Sobrien      fprintf (asm_out_file, "%s\n", "\t.section .drectve\n");		\
20952284Sobrien      in_section = in_drectve;						\
21052284Sobrien    }									\
21152284Sobrien}
21290075Sobrienvoid drectve_section PARAMS ((void));
21352284Sobrien
21452284Sobrien/* Switch to SECTION (an `enum in_section').
21552284Sobrien
21652284Sobrien   ??? This facility should be provided by GCC proper.
21752284Sobrien   The problem is that we want to temporarily switch sections in
21852284Sobrien   ASM_DECLARE_OBJECT_NAME and then switch back to the original section
21952284Sobrien   afterwards.  */
22052284Sobrien#define SWITCH_TO_SECTION_FUNCTION 				\
22190075Sobrienvoid switch_to_section PARAMS ((enum in_section, tree));        \
22252284Sobrienvoid 								\
22352284Sobrienswitch_to_section (section, decl) 				\
22452284Sobrien     enum in_section section; 					\
22552284Sobrien     tree decl; 						\
22652284Sobrien{ 								\
22752284Sobrien  switch (section) 						\
22852284Sobrien    { 								\
22952284Sobrien      case in_text: text_section (); break; 			\
23052284Sobrien      case in_data: data_section (); break; 			\
23152284Sobrien      case in_named: named_section (decl, NULL, 0); break; 	\
23252284Sobrien      case in_drectve: drectve_section (); break; 		\
23352284Sobrien      default: abort (); break; 				\
23452284Sobrien    } 								\
23552284Sobrien}
23652284Sobrien
23752284Sobrien/* Don't allow flag_pic to propagate since gas may produce invalid code
23890075Sobrien   otherwise.  */
23952284Sobrien
24052284Sobrien#undef  SUBTARGET_OVERRIDE_OPTIONS
24152284Sobrien#define SUBTARGET_OVERRIDE_OPTIONS					\
24252284Sobriendo {									\
24352284Sobrien  if (flag_pic)								\
24452284Sobrien    {									\
24552284Sobrien      warning ("-f%s ignored for target (all code is position independent)",\
24652284Sobrien	       (flag_pic > 1) ? "PIC" : "pic");				\
24752284Sobrien      flag_pic = 0;							\
24852284Sobrien    }									\
24952284Sobrien} while (0)								\
25052284Sobrien
25152284Sobrien/* Define this macro if references to a symbol must be treated
25252284Sobrien   differently depending on something about the variable or
25352284Sobrien   function named by the symbol (such as what section it is in).
25452284Sobrien
25552284Sobrien   On i386 running Windows NT, modify the assembler name with a suffix
25652284Sobrien   consisting of an atsign (@) followed by string of digits that represents
25752284Sobrien   the number of bytes of arguments passed to the function, if it has the
25852284Sobrien   attribute STDCALL.
25952284Sobrien
26052284Sobrien   In addition, we must mark dll symbols specially. Definitions of
26152284Sobrien   dllexport'd objects install some info in the .drectve section.
26252284Sobrien   References to dllimport'd objects are fetched indirectly via
26352284Sobrien   _imp__.  If both are declared, dllexport overrides.  This is also
26452284Sobrien   needed to implement one-only vtables: they go into their own
26552284Sobrien   section and we need to set DECL_SECTION_NAME so we do that here.
26652284Sobrien   Note that we can be called twice on the same decl.  */
26752284Sobrien
268117395Skan#undef TARGET_ENCODE_SECTION_INFO
269117395Skan#define TARGET_ENCODE_SECTION_INFO  i386_pe_encode_section_info
270117395Skan#undef  TARGET_STRIP_NAME_ENCODING
271117395Skan#define TARGET_STRIP_NAME_ENCODING  i386_pe_strip_name_encoding_full
27252284Sobrien
27352284Sobrien/* Output a reference to a label.  */
27452284Sobrien#undef ASM_OUTPUT_LABELREF
27552284Sobrien#define ASM_OUTPUT_LABELREF(STREAM, NAME)  		\
27652284Sobrien  fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, 		\
277117395Skan	   i386_pe_strip_name_encoding (NAME))		\
27852284Sobrien
27952284Sobrien/* Output a common block.  */
28052284Sobrien#undef ASM_OUTPUT_COMMON
28152284Sobrien#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)	\
28252284Sobriendo {							\
28352284Sobrien  if (i386_pe_dllexport_name_p (NAME))			\
28490075Sobrien    i386_pe_record_exported_symbol (NAME, 1);		\
28552284Sobrien  if (! i386_pe_dllimport_name_p (NAME))		\
28652284Sobrien    {							\
28752284Sobrien      fprintf ((STREAM), "\t.comm\t"); 			\
28852284Sobrien      assemble_name ((STREAM), (NAME));			\
28952284Sobrien      fprintf ((STREAM), ", %d\t%s %d\n",		\
29052284Sobrien	       (ROUNDED), ASM_COMMENT_START, (SIZE));	\
29152284Sobrien    }							\
29252284Sobrien} while (0)
29352284Sobrien
29452284Sobrien/* Output the label for an initialized variable.  */
29552284Sobrien#undef ASM_DECLARE_OBJECT_NAME
29652284Sobrien#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) 	\
29752284Sobriendo {							\
29852284Sobrien  if (i386_pe_dllexport_name_p (NAME))			\
29990075Sobrien    i386_pe_record_exported_symbol (NAME, 1);		\
30052284Sobrien  ASM_OUTPUT_LABEL ((STREAM), (NAME));			\
30152284Sobrien} while (0)
30252284Sobrien
30352284Sobrien
30452284Sobrien/* Emit code to check the stack when allocating more that 4000
30590075Sobrien   bytes in one go.  */
30652284Sobrien
30752284Sobrien#define CHECK_STACK_LIMIT 4000
30852284Sobrien
30952284Sobrien/* By default, target has a 80387, uses IEEE compatible arithmetic,
310117395Skan   returns float values in the 387 and needs stack probes.
311117395Skan   We also align doubles to 64-bits for MSVC default compatibility. */
312117395Skan
31390075Sobrien#undef TARGET_SUBTARGET_DEFAULT
31490075Sobrien#define TARGET_SUBTARGET_DEFAULT \
315117395Skan   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE \
316117395Skan    | MASK_ALIGN_DOUBLE)
31752284Sobrien
31852284Sobrien/* This is how to output an assembler line
31952284Sobrien   that says to advance the location counter
32052284Sobrien   to a multiple of 2**LOG bytes.  */
32152284Sobrien
32252284Sobrien#undef ASM_OUTPUT_ALIGN
32352284Sobrien#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
32452284Sobrien    if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
32552284Sobrien
32652284Sobrien/* Define this macro if in some cases global symbols from one translation
32752284Sobrien   unit may not be bound to undefined symbols in another translation unit
32852284Sobrien   without user intervention.  For instance, under Microsoft Windows
32952284Sobrien   symbols must be explicitly imported from shared libraries (DLLs).  */
33052284Sobrien#define MULTIPLE_SYMBOL_SPACES
33152284Sobrien
33290075Sobrienextern void i386_pe_unique_section PARAMS ((TREE, int));
333117395Skan#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
33452284Sobrien
33552284Sobrien#define SUPPORTS_ONE_ONLY 1
33652284Sobrien
33790075Sobrien/* Switch into a generic section.  */
33890075Sobrien#define TARGET_ASM_NAMED_SECTION  i386_pe_asm_named_section
33952284Sobrien
34090075Sobrien/* Select attributes for named sections.  */
34190075Sobrien#define TARGET_SECTION_TYPE_FLAGS  i386_pe_section_type_flags
34290075Sobrien
34352284Sobrien/* Write the extra assembler code needed to declare a function
34452284Sobrien   properly.  If we are generating SDB debugging information, this
34552284Sobrien   will happen automatically, so we only need to handle other cases.  */
34652284Sobrien#undef ASM_DECLARE_FUNCTION_NAME
34752284Sobrien#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
34852284Sobrien  do									\
34952284Sobrien    {									\
35052284Sobrien      if (i386_pe_dllexport_name_p (NAME))				\
35190075Sobrien	i386_pe_record_exported_symbol (NAME, 0);			\
35252284Sobrien      if (write_symbols != SDB_DEBUG)					\
35352284Sobrien	i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL));	\
35452284Sobrien      ASM_OUTPUT_LABEL (FILE, NAME);					\
35552284Sobrien    }									\
35652284Sobrien  while (0)
35752284Sobrien
35852284Sobrien/* Add an external function to the list of functions to be declared at
35952284Sobrien   the end of the file.  */
36052284Sobrien#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)				\
36152284Sobrien  do									\
36252284Sobrien    {									\
36352284Sobrien      if (TREE_CODE (DECL) == FUNCTION_DECL)				\
36452284Sobrien	i386_pe_record_external_function (NAME);			\
36552284Sobrien    }									\
36652284Sobrien  while (0)
36752284Sobrien
36852284Sobrien/* Declare the type properly for any external libcall.  */
36952284Sobrien#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
37052284Sobrien  i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
37152284Sobrien
37290075Sobrien/* This says out to put a global symbol in the BSS section.  */
37390075Sobrien#undef ASM_OUTPUT_ALIGNED_BSS
37490075Sobrien#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
37590075Sobrien  asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
37690075Sobrien
37752284Sobrien/* Output function declarations at the end of the file.  */
37890075Sobrien#undef ASM_FILE_END
37952284Sobrien#define ASM_FILE_END(FILE) \
38052284Sobrien  i386_pe_asm_file_end (FILE)
38152284Sobrien
38252284Sobrien#undef ASM_COMMENT_START
38352284Sobrien#define ASM_COMMENT_START " #"
38452284Sobrien
385117395Skan/* DWARF2 Unwinding doesn't work with exception handling yet.  To make
386117395Skan   it work, we need to build a libgcc_s.dll, and dcrt0.o should be
387117395Skan   changed to call __register_frame_info/__deregister_frame_info.  */
38896263Sobrien#define DWARF2_UNWIND_INFO 0
38996263Sobrien
39090075Sobrien/* Don't assume anything about the header files.  */
39152284Sobrien#define NO_IMPLICIT_EXTERN_C
39252284Sobrien
393110611Skan#undef PROFILE_HOOK
394110611Skan#define PROFILE_HOOK(LABEL)						\
395110611Skan  if (MAIN_NAME_P (DECL_NAME (current_function_decl)))			\
396110611Skan    {									\
397110611Skan      emit_call_insn (gen_rtx (CALL, VOIDmode,				\
39890075Sobrien	gen_rtx_MEM (FUNCTION_MODE,					\
39990075Sobrien		     gen_rtx_SYMBOL_REF (Pmode, "_monstartup")),	\
40090075Sobrien	const0_rtx));							\
401110611Skan    }
40252284Sobrien
403117395Skan/* Java Native Interface (JNI) methods on Win32 are invoked using the
404117395Skan   stdcall calling convention.  */
405117395Skan#undef MODIFY_JNI_METHOD_CALL
406117395Skan#define MODIFY_JNI_METHOD_CALL(MDECL)					      \
407117395Skan  build_type_attribute_variant ((MDECL),				      \
408117395Skan			       build_tree_list (get_identifier ("stdcall"),   \
409117395Skan						NULL))
410117395Skan
411117395Skan
41252284Sobrien/* External function declarations.  */
41352284Sobrien
41490075Sobrienextern void i386_pe_record_external_function PARAMS ((const char *));
41590075Sobrienextern void i386_pe_declare_function_type PARAMS ((FILE *, const char *, int));
41690075Sobrienextern void i386_pe_record_exported_symbol PARAMS ((const char *, int));
41790075Sobrienextern void i386_pe_asm_file_end PARAMS ((FILE *));
41890075Sobrienextern int i386_pe_dllexport_name_p PARAMS ((const char *));
41990075Sobrienextern int i386_pe_dllimport_name_p PARAMS ((const char *));
42052284Sobrien
42152284Sobrien/* For Win32 ABI compatibility */
42252284Sobrien#undef DEFAULT_PCC_STRUCT_RETURN
42352284Sobrien#define DEFAULT_PCC_STRUCT_RETURN 0
42452284Sobrien
42552284Sobrien/* No data type wants to be aligned rounder than this.  */
42652284Sobrien#undef	BIGGEST_ALIGNMENT
42752284Sobrien#define BIGGEST_ALIGNMENT 128
42852284Sobrien
42990075Sobrien/* Native complier aligns internal doubles in structures on dword boundaries.  */
43090075Sobrien#undef	BIGGEST_FIELD_ALIGNMENT
43190075Sobrien#define BIGGEST_FIELD_ALIGNMENT 64
43290075Sobrien
433117395Skan/* A bit-field declared as `int' forces `int' alignment for the struct.  */
43490075Sobrien#undef PCC_BITFIELD_TYPE_MATTERS
43590075Sobrien#define PCC_BITFIELD_TYPE_MATTERS 1
43690075Sobrien#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
43752284Sobrien
43890075Sobrien
43952284Sobrien/* Enable alias attribute support.  */
44052284Sobrien#ifndef SET_ASM_OP
44190075Sobrien#define SET_ASM_OP "\t.set\t"
44252284Sobrien#endif
44352284Sobrien
44490075Sobrien/* Override GCC's relative pathname lookup (ie., relocatability) unless
44590075Sobrien   otherwise told by other subtargets.  */
44690075Sobrien#ifndef WIN32_NO_ABSOLUTE_INST_DIRS
44790075Sobrien#undef MD_STARTFILE_PREFIX
44890075Sobrien#define MD_STARTFILE_PREFIX     "/usr/lib/"
44990075Sobrien
45090075Sobrien#undef STANDARD_STARTFILE_PREFIX
45190075Sobrien#define STANDARD_STARTFILE_PREFIX     "/usr/lib/mingw/"
45290075Sobrien
45390075Sobrien#ifndef CROSS_COMPILE
45490075Sobrien#undef LOCAL_INCLUDE_DIR
45590075Sobrien#undef TOOL_INCLUDE_DIR
45690075Sobrien#undef SYSTEM_INCLUDE_DIR
45790075Sobrien#undef STANDARD_INCLUDE_DIR
45890075Sobrien#define STANDARD_INCLUDE_DIR 0
45990075Sobrien#endif /* not CROSS_COMPILE */
46090075Sobrien#endif /* not WIN32_NO_ABSOLUTE_INST_DIRS */
46190075Sobrien
46290075Sobrien#undef TREE
46390075Sobrien
46490075Sobrien#ifndef BUFSIZ
46590075Sobrien# undef FILE
46690075Sobrien#endif
467