OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [i386/] [cygming.h] - Blame information for rev 868

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* Operating system specific defines to be used when targeting GCC for
2
   hosting on Windows32, using a Unix style C library and tools.
3
   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4
   2004, 2005, 2007
5
   Free Software Foundation, Inc.
6
 
7
This file is part of GCC.
8
 
9
GCC is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 3, or (at your option)
12
any later version.
13
 
14
GCC is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
GNU General Public License for more details.
18
 
19
You should have received a copy of the GNU General Public License
20
along with GCC; see the file COPYING3.  If not see
21
<http://www.gnu.org/licenses/>.  */
22
 
23
#define DBX_DEBUGGING_INFO 1
24
#define SDB_DEBUGGING_INFO 1
25
#undef PREFERRED_DEBUGGING_TYPE
26
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
27
 
28
#ifdef HAVE_GAS_PE_SECREL32_RELOC
29
#define DWARF2_DEBUGGING_INFO 1
30
 
31
#undef DBX_REGISTER_NUMBER
32
#define DBX_REGISTER_NUMBER(n) (write_symbols == DWARF2_DEBUG   \
33
                                ? svr4_dbx_register_map[n]      \
34
                                : dbx_register_map[n])
35
 
36
/* Use section relative relocations for debugging offsets.  Unlike
37
   other targets that fake this by putting the section VMA at 0, PE
38
   won't allow it.  */
39
#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION)     \
40
  do {                                                          \
41
    if (SIZE != 4)                                              \
42
      abort ();                                                 \
43
                                                                \
44
    fputs ("\t.secrel32\t", FILE);                              \
45
    assemble_name (FILE, LABEL);                                \
46
  } while (0)
47
#endif
48
 
49
#define TARGET_EXECUTABLE_SUFFIX ".exe"
50
 
51
#include <stdio.h>
52
 
53
#define MAYBE_UWIN_CPP_BUILTINS() /* Nothing.  */
54
 
55
#define TARGET_OS_CPP_BUILTINS()                                        \
56
  do                                                                    \
57
    {                                                                   \
58
        builtin_define ("_X86_=1");                                     \
59
        builtin_assert ("system=winnt");                                \
60
        builtin_define ("__stdcall=__attribute__((__stdcall__))");      \
61
        builtin_define ("__fastcall=__attribute__((__fastcall__))");    \
62
        builtin_define ("__cdecl=__attribute__((__cdecl__))");          \
63
        if (!flag_iso)                                                  \
64
          {                                                             \
65
            builtin_define ("_stdcall=__attribute__((__stdcall__))");   \
66
            builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
67
            builtin_define ("_cdecl=__attribute__((__cdecl__))");       \
68
          }                                                             \
69
        /* Even though linkonce works with static libs, this is needed  \
70
            to compare typeinfo symbols across dll boundaries.  */      \
71
        builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0");               \
72
        MAYBE_UWIN_CPP_BUILTINS ();                                     \
73
        EXTRA_OS_CPP_BUILTINS ();                                       \
74
  }                                                                     \
75
  while (0)
76
 
77
/* Get tree.c to declare a target-specific specialization of
78
   merge_decl_attributes.  */
79
#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 1
80
 
81
/* This macro defines names of additional specifications to put in the specs
82
   that can be used in various specifications like CC1_SPEC.  Its definition
83
   is an initializer with a subgrouping for each command option.
84
 
85
   Each subgrouping contains a string constant, that defines the
86
   specification name, and a string constant that used by the GCC driver
87
   program.
88
 
89
   Do not define this macro if it does not need to do anything.  */
90
 
91
#undef  SUBTARGET_EXTRA_SPECS
92
#define SUBTARGET_EXTRA_SPECS                                           \
93
  { "mingw_include_path", DEFAULT_TARGET_MACHINE }
94
 
95
#undef MATH_LIBRARY
96
#define MATH_LIBRARY ""
97
 
98
#define SIZE_TYPE "unsigned int"
99
#define PTRDIFF_TYPE "int"
100
#define WCHAR_TYPE_SIZE 16
101
#define WCHAR_TYPE "short unsigned int"
102
 
103
 
104
/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop).  */
105
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
106
 
107
union tree_node;
108
#define TREE union tree_node *
109
 
110
#define drectve_section() \
111
  (fprintf (asm_out_file, "\t.section .drectve\n"), \
112
   in_section = NULL)
113
 
114
/* Older versions of gas don't handle 'r' as data.
115
   Explicitly set data flag with 'd'.  */
116
#define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata,\"dr\""
117
 
118
/* Don't allow flag_pic to propagate since gas may produce invalid code
119
   otherwise.  */
120
 
121
#undef  SUBTARGET_OVERRIDE_OPTIONS
122
#define SUBTARGET_OVERRIDE_OPTIONS                                      \
123
do {                                                                    \
124
  if (flag_pic)                                                         \
125
    {                                                                   \
126
      warning (0, "-f%s ignored for target (all code is position independent)",\
127
               (flag_pic > 1) ? "PIC" : "pic");                         \
128
      flag_pic = 0;                                                      \
129
    }                                                                   \
130
} while (0)                                                              \
131
 
132
/* Define this macro if references to a symbol must be treated
133
   differently depending on something about the variable or
134
   function named by the symbol (such as what section it is in).
135
 
136
   On i386 running Windows NT, modify the assembler name with a suffix
137
   consisting of an atsign (@) followed by string of digits that represents
138
   the number of bytes of arguments passed to the function, if it has the
139
   attribute STDCALL.
140
 
141
   In addition, we must mark dll symbols specially. Definitions of
142
   dllexport'd objects install some info in the .drectve section.
143
   References to dllimport'd objects are fetched indirectly via
144
   _imp__.  If both are declared, dllexport overrides.  This is also
145
   needed to implement one-only vtables: they go into their own
146
   section and we need to set DECL_SECTION_NAME so we do that here.
147
   Note that we can be called twice on the same decl.  */
148
 
149
#undef SUBTARGET_ENCODE_SECTION_INFO
150
#define SUBTARGET_ENCODE_SECTION_INFO  i386_pe_encode_section_info
151
#undef  TARGET_STRIP_NAME_ENCODING
152
#define TARGET_STRIP_NAME_ENCODING  i386_pe_strip_name_encoding_full
153
 
154
/* Output a reference to a label.  */
155
#undef ASM_OUTPUT_LABELREF
156
#define ASM_OUTPUT_LABELREF  i386_pe_output_labelref
157
 
158
#undef  COMMON_ASM_OP
159
#define COMMON_ASM_OP   "\t.comm\t"
160
 
161
/* Output a common block.  */
162
#undef ASM_OUTPUT_COMMON
163
#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)  \
164
do {                                                    \
165
  if (i386_pe_dllexport_name_p (NAME))                  \
166
    i386_pe_record_exported_symbol (NAME, 1);           \
167
  if (! i386_pe_dllimport_name_p (NAME))                \
168
    {                                                   \
169
      fprintf ((STREAM), "\t.comm\t");                  \
170
      assemble_name ((STREAM), (NAME));                 \
171
      fprintf ((STREAM), ", %d\t%s %d\n",               \
172
               (int)(ROUNDED), ASM_COMMENT_START, (int)(SIZE)); \
173
    }                                                   \
174
} while (0)
175
 
176
/* Output the label for an initialized variable.  */
177
#undef ASM_DECLARE_OBJECT_NAME
178
#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL)     \
179
do {                                                    \
180
  if (i386_pe_dllexport_name_p (NAME))                  \
181
    i386_pe_record_exported_symbol (NAME, 1);           \
182
  ASM_OUTPUT_LABEL ((STREAM), (NAME));                  \
183
} while (0)
184
 
185
 
186
/* Emit code to check the stack when allocating more that 4000
187
   bytes in one go.  */
188
 
189
#define CHECK_STACK_LIMIT 4000
190
 
191
/* By default, target has a 80387, uses IEEE compatible arithmetic,
192
   returns float values in the 387 and needs stack probes.
193
   We also align doubles to 64-bits for MSVC default compatibility.  */
194
 
195
#undef TARGET_SUBTARGET_DEFAULT
196
#define TARGET_SUBTARGET_DEFAULT \
197
   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE \
198
    | MASK_ALIGN_DOUBLE)
199
 
200
/* This is how to output an assembler line
201
   that says to advance the location counter
202
   to a multiple of 2**LOG bytes.  */
203
 
204
#undef ASM_OUTPUT_ALIGN
205
#define ASM_OUTPUT_ALIGN(FILE,LOG)      \
206
    if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
207
 
208
/* Windows uses explicit import from shared libraries.  */
209
#define MULTIPLE_SYMBOL_SPACES 1
210
 
211
extern void i386_pe_unique_section (TREE, int);
212
#define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section
213
#define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section
214
 
215
#define SUPPORTS_ONE_ONLY 1
216
 
217
/* Switch into a generic section.  */
218
#define TARGET_ASM_NAMED_SECTION  i386_pe_asm_named_section
219
 
220
/* Select attributes for named sections.  */
221
#define TARGET_SECTION_TYPE_FLAGS  i386_pe_section_type_flags
222
 
223
/* Write the extra assembler code needed to declare a function
224
   properly.  If we are generating SDB debugging information, this
225
   will happen automatically, so we only need to handle other cases.  */
226
#undef ASM_DECLARE_FUNCTION_NAME
227
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
228
  do                                                                    \
229
    {                                                                   \
230
      if (i386_pe_dllexport_name_p (NAME))                              \
231
        i386_pe_record_exported_symbol (NAME, 0);                        \
232
      if (write_symbols != SDB_DEBUG)                                   \
233
        i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
234
      ASM_OUTPUT_LABEL (FILE, NAME);                                    \
235
    }                                                                   \
236
  while (0)
237
 
238
/* Add an external function to the list of functions to be declared at
239
   the end of the file.  */
240
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)                           \
241
  do                                                                    \
242
    {                                                                   \
243
      if (TREE_CODE (DECL) == FUNCTION_DECL)                            \
244
        i386_pe_record_external_function ((DECL), (NAME));              \
245
    }                                                                   \
246
  while (0)
247
 
248
/* Declare the type properly for any external libcall.  */
249
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
250
  i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
251
 
252
/* This says out to put a global symbol in the BSS section.  */
253
#undef ASM_OUTPUT_ALIGNED_BSS
254
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
255
  asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
256
 
257
/* Output function declarations at the end of the file.  */
258
#undef TARGET_ASM_FILE_END
259
#define TARGET_ASM_FILE_END i386_pe_file_end
260
 
261
#undef ASM_COMMENT_START
262
#define ASM_COMMENT_START " #"
263
 
264
/* DWARF2 Unwinding doesn't work with exception handling yet.  To make
265
   it work, we need to build a libgcc_s.dll, and dcrt0.o should be
266
   changed to call __register_frame_info/__deregister_frame_info.  */
267
#define DWARF2_UNWIND_INFO 0
268
 
269
/* Don't assume anything about the header files.  */
270
#define NO_IMPLICIT_EXTERN_C
271
 
272
#undef PROFILE_HOOK
273
#define PROFILE_HOOK(LABEL)                                             \
274
  if (MAIN_NAME_P (DECL_NAME (current_function_decl)))                  \
275
    {                                                                   \
276
      emit_call_insn (gen_rtx_CALL (VOIDmode,                           \
277
        gen_rtx_MEM (FUNCTION_MODE,                                     \
278
                     gen_rtx_SYMBOL_REF (Pmode, "_monstartup")),        \
279
        const0_rtx));                                                   \
280
    }
281
 
282
/* Java Native Interface (JNI) methods on Win32 are invoked using the
283
   stdcall calling convention.  */
284
#undef MODIFY_JNI_METHOD_CALL
285
#define MODIFY_JNI_METHOD_CALL(MDECL)                                         \
286
  build_type_attribute_variant ((MDECL),                                      \
287
                               build_tree_list (get_identifier ("stdcall"),   \
288
                                                NULL))
289
 
290
/* External function declarations.  */
291
 
292
extern void i386_pe_record_external_function (tree, const char *);
293
extern void i386_pe_declare_function_type (FILE *, const char *, int);
294
extern void i386_pe_record_exported_symbol (const char *, int);
295
extern void i386_pe_file_end (void);
296
extern int i386_pe_dllexport_name_p (const char *);
297
extern int i386_pe_dllimport_name_p (const char *);
298
 
299
/* For Win32 ABI compatibility */
300
#undef DEFAULT_PCC_STRUCT_RETURN
301
#define DEFAULT_PCC_STRUCT_RETURN 0
302
 
303
/* MSVC returns aggregate types of up to 8 bytes via registers.
304
   See i386.c:ix86_return_in_memory.  */
305
#undef MS_AGGREGATE_RETURN
306
#define MS_AGGREGATE_RETURN 1
307
 
308
/* No data type wants to be aligned rounder than this.  */
309
#undef  BIGGEST_ALIGNMENT
310
#define BIGGEST_ALIGNMENT 128
311
 
312
/* Biggest alignment supported by the object file format of this
313
   machine.  Use this macro to limit the alignment which can be
314
   specified using the `__attribute__ ((aligned (N)))' construct.  If
315
   not defined, the default value is `BIGGEST_ALIGNMENT'.  */
316
#undef MAX_OFILE_ALIGNMENT
317
/* IMAGE_SCN_ALIGN_8192BYTES is the largest section alignment flag
318
   specified in the PECOFF60 spec.  Native MS compiler also limits
319
   user-specified alignment to 8192 bytes.  */
320
#define MAX_OFILE_ALIGNMENT (8192 * 8)
321
 
322
/* Native complier aligns internal doubles in structures on dword boundaries.  */
323
#undef  BIGGEST_FIELD_ALIGNMENT
324
#define BIGGEST_FIELD_ALIGNMENT 64
325
 
326
/* A bit-field declared as `int' forces `int' alignment for the struct.  */
327
#undef PCC_BITFIELD_TYPE_MATTERS
328
#define PCC_BITFIELD_TYPE_MATTERS 1
329
#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
330
 
331
/* Enable alias attribute support.  */
332
#ifndef SET_ASM_OP
333
#define SET_ASM_OP "\t.set\t"
334
#endif
335
/* This implements the `alias' attribute, keeping any stdcall or
336
   fastcall decoration.  */
337
#undef  ASM_OUTPUT_DEF_FROM_DECLS
338
#define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET)                 \
339
  do                                                                    \
340
    {                                                                   \
341
      const char *alias;                                                \
342
      rtx rtlname = XEXP (DECL_RTL (DECL), 0);                           \
343
      if (GET_CODE (rtlname) == SYMBOL_REF)                             \
344
        alias = XSTR (rtlname, 0);                                       \
345
      else                                                              \
346
        abort ();                                                       \
347
      if (TREE_CODE (DECL) == FUNCTION_DECL)                            \
348
        i386_pe_declare_function_type (STREAM, alias,                   \
349
                                       TREE_PUBLIC (DECL));             \
350
      ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET));      \
351
    } while (0)
352
 
353
/* GNU as supports weak symbols on PECOFF. */
354
#ifdef HAVE_GAS_WEAK
355
#define ASM_WEAKEN_LABEL(FILE, NAME)  \
356
  do                                  \
357
    {                                 \
358
      fputs ("\t.weak\t", (FILE));    \
359
      assemble_name ((FILE), (NAME)); \
360
      fputc ('\n', (FILE));           \
361
    }                                 \
362
  while (0)
363
#endif /* HAVE_GAS_WEAK */
364
 
365
/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
366
   but for .jcr section to work we also need crtbegin and crtend
367
   objects.  */
368
#define TARGET_USE_JCR_SECTION 0
369
 
370
/* Decide whether it is safe to use a local alias for a virtual function
371
   when constructing thunks.  */
372
#undef TARGET_USE_LOCAL_THUNK_ALIAS_P
373
#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL))
374
 
375
#define SUBTARGET_ATTRIBUTE_TABLE \
376
  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \
377
  { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute }
378
 
379
/*  mcount() does not need a counter variable.  */
380
#undef NO_PROFILE_COUNTERS
381
#define NO_PROFILE_COUNTERS 1
382
 
383
#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p
384
#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
385
 
386
#undef TREE
387
 
388
#ifndef BUFSIZ
389
# undef FILE
390
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.