Changeset 1418
- Timestamp:
- May 1, 2004, 10:57:23 AM (21 years ago)
- Location:
- trunk/src/gcc/gcc/config/i386
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/config/i386/emx.c
-
Property cvs2svn:cvs-rev
changed from
1.27
to1.28
r1417 r1418 31 31 #include "flags.h" 32 32 #include "i386-protos.h" 33 #include "ggc.h" 33 34 34 35 /* The size of the target's pointer type. */ … … 41 42 42 43 #ifdef BIRD_DEBUG 43 static const char *code(tree node) 44 static const char *code(node) 45 tree node; 44 46 { 45 47 if (node) … … 73 75 74 76 const char *birddump_callingconv(tree node); 75 const char *birddump_callingconv(tree node) 77 const char *birddump_callingconv(node) 78 tree node; 76 79 { 77 80 static const char *apsz[] = {"system", "optlink", "stdcall"}; … … 95 98 } 96 99 97 void birddump ( tree node);98 void birddump (tree node) 100 void birddump (node) 101 tree node; 99 102 { 100 103 tree type, type2, context, name; … … 122 125 #endif 123 126 124 int emx_c_set_decl_assembler_name (tree decl, bool fclass) 127 int emx_c_set_decl_assembler_name (decl, fclass) 128 tree decl; 129 int fclass; 125 130 { 126 131 static int recurse; … … 296 301 /* This is the working version which we belive duplicate some which could be 297 302 done by the generic attribute stuff in GCC... */ 298 tree emx_handle_vacpp_attribute ( tree *node, tree name, tree args,299 int flags, bool *no_add_attrs)303 tree emx_handle_vacpp_attribute (node, name, args, flags, no_add_attrs) 304 tree *node, name, args; int flags; bool *no_add_attrs; 300 305 { 301 306 tree type; … … 401 406 data_section (); 402 407 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE)); 403 fputs ("\t.stabs\t\"___eh_frame__\",24,0,0,Lframe1\n" /* N_SETD */ 404 "\t.stabs\t\"___ehInit\",1,0,0,0\n", /* N_UNDEF | N_EXT */ 405 asm_out_file); 408 fputs ("\t.stabs\t\"___eh_frame__\",24,0,0,Lframe1\n", asm_out_file); /* N_SETD */ 409 fputs ("\t.stabs\t\"___ehInit\",1,0,0,0\n", asm_out_file); /* N_UNDEF | N_EXT */ 406 410 } 407 411 408 412 /* Add a __POST$xxx label before epilogue if -mepilogue specified */ 409 void emx_output_function_begin_epilogue (FILE *f) 413 void emx_output_function_begin_epilogue (f) 414 FILE *f; 410 415 { 411 416 if (TARGET_EPILOGUE && TREE_PUBLIC (current_function_decl)) … … 432 437 don't know. */ 433 438 434 int emx_return_in_memory_with_fntype (tree type, tree fntype) 439 int emx_return_in_memory_with_fntype (type, fntype) 440 tree type, fntype; 435 441 { 436 442 /* (from aggregate_value_p() CVS trunk) */ … … 471 477 } 472 478 479 /* Strip the no-underscore prefix. 480 Also strip the stdcall suffix. */ 481 const char * emx_strip_name_encoding_full (str) 482 const char *str; 483 { 484 const char *p; 485 if (*str == '%') /* don't actually know what this is.. */ 486 str += 2; 487 if (*str == '*') 488 str += 1; 489 490 /* stdcall */ 491 p = strchr (str, '@'); 492 if (p) 493 return ggc_alloc_string (str, p - str); 494 495 return str; 496 } 497 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/emx.h
-
Property cvs2svn:cvs-rev
changed from
1.28
to1.29
r1417 r1418 1 /* Configuration for an i386 running emx (target). */ 2 3 /* Use #ifdef EMX for issues needed by EMX target */ 4 /* Use #ifdef __EMX__ for issues needed on a EMX host */ 5 /* Note that the cross-compiler is untested */ 1 /* Operating system specific defines to be used when targeting GCC for 2 hosting on OS/2, using InnoTek LIBC and tools. 3 Copyright (C) 2000(?)-2003 Andrew Zabolotny 4 Copyright (C) 2003 InnoTek Systemberatung GmbH 5 Copyright (C) 2003-2004 Knut St. Osmundsen 6 7 This file is part of the InnoTek port of GNU CC. 8 9 GNU CC 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 2, or (at your option) 12 any later version. 13 14 GNU CC 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 GNU CC; see the file COPYING. If not, write to 21 the Free Software Foundation, 59 Temple Place - Suite 330, 22 Boston, MA 02111-1307, USA. */ 23 24 /* Use #ifdef EMX for issues needed by EMX target. 25 Use #ifdef __EMX__ for issues needed on a EMX host. 26 Note that the cross-compiler is untested */ 6 27 #define EMX 7 28 … … 10 31 11 32 /* Debug formats */ 12 #define DBX_DEBUGGING_INFO 1 13 #define DWARF2_DEBUGGING_INFO 1 14 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 15 16 #include <stdio.h> /* for FILE* */ 33 #define DEFAULT_GDB_EXTENSIONS 1 34 #define DBX_DEBUGGING_INFO 1 35 #define DWARF2_DEBUGGING_INFO 1 36 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 37 38 /* headers */ 39 #include <stdio.h> /* for FILE* */ 17 40 #include "i386/i386.h" 18 41 #include "i386/unix.h" 19 42 #include "i386/bsd.h" 20 #include "i386/gstabs.h" 43 #include "i386/gstabs.h" /* GAS stabs */ 21 44 #include "i386/gas.h" 22 #include "aoutos.h" 45 #include "aoutos.h" /* constructors/destructors/garbage collectors */ 23 46 24 47 /* Some additional system-dependent includes... */ … … 26 49 #include <sys/uflags.h> 27 50 28 /* EMX does not define strcasecmp but has stricmp instead */ 29 #define strcasecmp stricmp 30 31 /* Define an additional switch -m(no-)probe for backward compatibility */ 32 /* Also define the -m(no-)epilogue switch */ 33 34 #define MASK_EPILOGUE 0x40000000 /* Use FUNCTION_EPILOGUE */ 35 36 #undef SUBTARGET_SWITCHES 37 #define SUBTARGET_SWITCHES \ 38 { "probe", MASK_STACK_PROBE, N_("Do stack probing")}, \ 39 { "no-probe", -MASK_STACK_PROBE, N_("Don't do stack probing")}, \ 40 { "epilogue", MASK_EPILOGUE, N_("Generate prologue/epilogue labels")}, \ 41 { "no-epilogue", -MASK_EPILOGUE, N_("Don't generate prologue/epilogue labels") }, 42 43 /* By default, target has a 80387, uses IEEE compatible arithmetic, 44 and returns float values in the 387 and needs stack probes */ 45 #undef TARGET_SUBTARGET_DEFAULT 46 #define TARGET_SUBTARGET_DEFAULT \ 47 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE) 48 49 /* Use FUNCTION_EPILOGUE */ 50 #define TARGET_EPILOGUE (target_flags & MASK_EPILOGUE) 51 52 /* OS/2 executables ends with .exe */ 53 #define TARGET_EXECUTABLE_SUFFIX ".exe" 51 /* Generate stack probes for allocations bigger than 4000. */ 52 #define CHECK_STACK_LIMIT 4000 53 54 /* OS/2 executables ends with .exe, but it's only enforced sometimes... */ 55 #define TARGET_EXECUTABLE_SUFFIX ".exe" 54 56 #define NO_FORCE_EXEOBJ_SUFFIX 55 57 … … 61 63 62 64 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */ 63 #define HANDLE_PRAGMA_PACK_PUSH_POP 1 64 65 /* Enable #pragma weak (in the limited way OS/2 supports them, however) */ 66 #define HANDLE_PRAGMA_WEAK 1 67 68 /* Use `#' instead of `/' as assembler comments */ 69 #undef ASM_COMMENT_START 70 #define ASM_COMMENT_START "#" 71 #undef ASM_APP_ON 72 #define ASM_APP_ON "#APP\n" 73 #undef ASM_APP_OFF 74 #define ASM_APP_OFF "#NO_APP\n" 65 #define HANDLE_PRAGMA_PACK_PUSH_POP 1 66 67 /* Enable #pragma weak (in the limited way OS/2 supports them). */ 68 #define HANDLE_PRAGMA_WEAK 1 69 70 /* We support kind of weak symbols */ 71 #define SUPPORTS_WEAK 1 72 73 /* We support weak style link-once semantics. */ 74 #define SUPPORTS_ONE_ONLY 1 75 76 /* Enabling aliasing. This is wanted especially for weak externals with 77 defaults. (#483) */ 78 #define SET_ASM_OP "\t.set\t" 75 79 76 80 /* Support for C++ templates. */ 77 81 #undef MAKE_DECL_ONE_ONLY 78 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)82 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) 79 83 80 84 /* This is how we tell the assembler that a symbol is weak. */ 81 #define ASM_WEAKEN_LABEL(FILE, NAME) 82 do 83 { 84 fputs ("\t.weak\t", (FILE)); 85 assemble_name ((FILE), (NAME)); 86 fputc ('\n', (FILE)); 87 } 85 #define ASM_WEAKEN_LABEL(FILE, NAME) \ 86 do \ 87 { \ 88 fputs ("\t.weak\t", (FILE)); \ 89 assemble_name ((FILE), (NAME)); \ 90 fputc ('\n', (FILE)); \ 91 } \ 88 92 while (0) 89 90 /* We support kind of weak symbols */91 #define SUPPORTS_WEAK 192 93 93 94 /* Define this macro if in some cases global symbols from one translation … … 95 96 without user intervention. For instance, under Microsoft Windows 96 97 symbols must be explicitly imported from shared libraries (DLLs). */ 97 #define MULTIPLE_SYMBOL_SPACES 198 #define MULTIPLE_SYMBOL_SPACES 1 98 99 99 100 /* We want DWARF2 frame unwind info for exception handling */ 100 #define DWARF2_UNWIND_INFO 1 101 #define DWARF2_UNWIND_INFO 1 102 103 /* This macros will stick a label to exception table for current file, 104 and also will put it in a 'ctor/dtor' - like list (using .stabs - this uses 105 same technique used in aoutos.h) which ld will collect into a single table 106 and then __ctordtorInit will use this table to make a call to 107 __register_frame_tableb. */ 108 #define TARGET_ASM_EH_FRAME_SECTION emx_eh_frame_section 109 extern void emx_eh_frame_section (void); 110 111 /* Put exception tables into .data section */ 112 #define TARGET_ASM_EXCEPTION_SECTION data_section 113 114 /* Terminate DWARF frame unwind info with a closing zero */ 115 #define DWARF2_FRAMEINFO_NULL_TERMINATED 1 116 117 /* Define the type for size_t. */ 118 #define SIZE_TYPE "unsigned int" 119 #define PTRDIFF_TYPE "int" 120 121 /* wchar_t is unsigned short. */ 122 #define WCHAR_TYPE "short unsigned int" 123 #define WCHAR_TYPE_SIZE 16 101 124 102 125 /* This function handles both _System and _Optlink attributes */ … … 105 128 /* We want the _System attribute */ 106 129 #define TARGET_SYSTEM_DECL_ATTRIBUTES 107 #define ix86_handle_system_attribute emx_handle_vacpp_attribute130 #define ix86_handle_system_attribute emx_handle_vacpp_attribute 108 131 109 132 /* We want the _Optlink attribute */ 110 133 #define TARGET_OPTLINK_DECL_ATTRIBUTES 111 #define ix86_handle_optlink_attribute emx_handle_vacpp_attribute134 #define ix86_handle_optlink_attribute emx_handle_vacpp_attribute 112 135 113 136 /* Do our own mangling on some kinds of decls */ 114 extern int emx_c_set_decl_assembler_name PARAMS ((tree, _Bool));137 extern int emx_c_set_decl_assembler_name PARAMS ((tree, int)); 115 138 #define TARGET_C_SET_DECL_ASSEMBLER_NAME(decl) \ 116 139 emx_c_set_decl_assembler_name (decl, 0) … … 121 144 _System functions which returns structures. (breaks some tcpip stuff.) */ 122 145 extern int emx_return_in_memory_with_fntype PARAMS ((tree type, tree fntype)); 123 #define RETURN_IN_MEMORY_WITH_FNTYPE emx_return_in_memory_with_fntype 124 125 /* This macros will stick a label to exception table for current file, 126 * and also will put it in a 'ctor/dtor' - like list (using .stabs - this uses 127 * same technique used in aoutos.h) which ld will collect into a single table 128 * and then __ctordtorInit will use this table to make a call to 129 * __register_frame_table 130 */ 131 #define TARGET_ASM_EH_FRAME_SECTION emx_eh_frame_section 132 extern void emx_eh_frame_section (void); 133 134 /* Put exception tables into .data section */ 135 #define TARGET_ASM_EXCEPTION_SECTION data_section 136 137 /* Terminate DWARF frame unwind info with a closing zero */ 138 #define DWARF2_FRAMEINFO_NULL_TERMINATED 1 139 140 /* Generate stack probes for allocations bigger than */ 141 #define CHECK_STACK_LIMIT 0x1000 142 143 /* Define the type for size_t */ 144 #define SIZE_TYPE "unsigned int" 145 #define PTRDIFF_TYPE "int" 146 147 /* wchar_t is unsigned short. */ 148 #define WCHAR_TYPE "short unsigned int" 149 #define WCHAR_TYPE_SIZE 16 150 151 /* For Win32 ABI compatibility */ 152 #define DEFAULT_PCC_STRUCT_RETURN 0 146 #define RETURN_IN_MEMORY_WITH_FNTYPE emx_return_in_memory_with_fntype 147 148 /* For Win32 ABI compatibility. */ 149 #define DEFAULT_PCC_STRUCT_RETURN 0 153 150 154 151 /* No data type wants to be aligned rounder than this. */ 155 #define BIGGEST_ALIGNMENT 128152 #define BIGGEST_ALIGNMENT 128 156 153 157 154 /* Win32 complier aligns internal doubles in structures on dword boundaries. 158 155 We need to emulate this behaviour for easier porting. */ 159 #define BIGGEST_FIELD_ALIGNMENT 64156 #define BIGGEST_FIELD_ALIGNMENT 64 160 157 161 158 /* If bit field type is int, don't let it cross an int, 162 159 and give entire struct the alignment of an int. */ 163 160 /* Required on the 386 since it doesn't have bitfield insns. */ 164 #define PCC_BITFIELD_TYPE_MATTERS 1161 #define PCC_BITFIELD_TYPE_MATTERS 1 165 162 166 163 /* Don't continue symbols. I think all relevant tools can handle … … 168 165 continued symbols: it sometimes emits another symbol before the 169 166 continuation. */ 170 #define DBX_CONTIN_LENGTH 0167 #define DBX_CONTIN_LENGTH 0 171 168 172 169 /* If defined, a C expression whose value is a string containing the … … 178 175 used. */ 179 176 #undef BSS_SECTION_ASM_OP 180 #define BSS_SECTION_ASM_OP "\t.bss"177 #define BSS_SECTION_ASM_OP "\t.bss" 181 178 182 179 /* A C statement (sans semicolon) to output to the stdio stream … … 191 188 bird: Pad using int 3. */ 192 189 #undef ASM_OUTPUT_ALIGN 193 #define ASM_OUTPUT_ALIGN(FILE,LOG) 190 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ 194 191 if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0xcc\n", LOG) 195 192 196 /* Enabling aliasing. This is wanted especially for weak externals with 197 defaults. (#483) */ 198 #define SET_ASM_OP "\t.set\t" 199 200 201 /******************************************************************* 202 stdcall labels get a suffix consisting of an at-sign '@' and 203 the size of parameters in bytes rounded to next multiple of 4. 204 *******************************************************************/ 193 /* Output a reference to a label. */ 194 #undef ASM_OUTPUT_LABELREF 195 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \ 196 fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, NAME) 197 198 /* Write a function name in assembly (bad i386.c forces this here). */ 199 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 200 ASM_OUTPUT_LABEL (FILE, NAME); 201 202 /* Use `#' instead of `/' as assembler comments */ 203 #undef ASM_COMMENT_START 204 #define ASM_COMMENT_START "#" 205 #undef ASM_APP_ON 206 #define ASM_APP_ON "#APP\n" 207 #undef ASM_APP_OFF 208 #define ASM_APP_OFF "#NO_APP\n" 205 209 206 210 /* This macro gets just the user-specified name out of the string … … 208 212 This is used to generate unique section names from function names 209 213 (if -ffunction-sections is given). */ 210 #undef STRIP_NAME_ENCODING 211 #define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \ 212 do { \ 213 const char *_p; \ 214 const char *_name = SYMBOL_NAME; \ 215 for (_p = _name; *_p && *_p != '@'; ++_p) \ 216 ; \ 217 if (*_p == '@') \ 218 { \ 219 int _len = _p - _name; \ 220 char *_new_name = (char *) alloca (_len + 1); \ 221 strncpy (_new_name, _name, _len); \ 222 _new_name[_len] = '\0'; \ 223 (VAR) = _new_name; \ 224 } \ 225 else \ 226 (VAR) = _name; \ 227 } while (0) 228 229 /* Output a reference to a label. */ 230 #undef ASM_OUTPUT_LABELREF 231 #define ASM_OUTPUT_LABELREF(STREAM, NAME) \ 232 fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, NAME) 214 #undef TARGET_STRIP_NAME_ENCODING 215 #define TARGET_STRIP_NAME_ENCODING emx_strip_name_encoding_full 216 extern const char * emx_strip_name_encoding_full (const char *); 217 233 218 234 219 /****************************************************************************** … … 236 221 ******************************************************************************/ 237 222 223 /* Define an additional switch -m(no-)probe for backward compatibility. 224 Also define the -m(no-)epilogue switch. */ 225 #define MASK_EPILOGUE 0x40000000 /* Use FUNCTION_EPILOGUE */ 226 227 #undef SUBTARGET_SWITCHES 228 #define SUBTARGET_SWITCHES \ 229 { "probe", MASK_STACK_PROBE, N_("Do stack probing") }, \ 230 { "no-probe", -MASK_STACK_PROBE, N_("Don't do stack probing") }, \ 231 { "epilogue", MASK_EPILOGUE, N_("Generate prologue/epilogue labels") }, \ 232 { "no-epilogue", -MASK_EPILOGUE, N_("Don't generate prologue/epilogue labels") }, 233 234 /* Use FUNCTION_EPILOGUE */ 235 #define TARGET_EPILOGUE (target_flags & MASK_EPILOGUE) 236 237 238 /* By default, target has a 80387, uses IEEE compatible arithmetic, 239 and returns float values in the 387 and needs stack probes */ 240 #undef TARGET_SUBTARGET_DEFAULT 241 #define TARGET_SUBTARGET_DEFAULT \ 242 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE) 243 244 238 245 /* The -Zstack option takes an argument. */ 239 #define WORD_SWITCH_TAKES_ARG(STR) (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) 246 #define WORD_SWITCH_TAKES_ARG(STR) (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 240 247 || !strcmp (STR, "Zstack")) 241 248 … … 249 256 250 257 #undef FUNCTION_PROFILER 251 #define FUNCTION_PROFILER(FILE, LABELNO) 252 { 253 fprintf (FILE, "\tcall __mcount\n"); 258 #define FUNCTION_PROFILER(FILE, LABELNO) \ 259 { \ 260 fprintf (FILE, "\tcall __mcount\n"); \ 254 261 } 262 255 263 256 264 /****************************************************************************** … … 261 269 * 262 270 ******************************************************************************/ 271 272 #define TARGET_OS_CPP_BUILTINS() \ 273 do \ 274 { \ 275 builtin_define ("_X86_=1"); \ 276 builtin_define ("__i386"); \ 277 builtin_define ("__i386__"); \ 278 builtin_define ("__32BIT__"); \ 279 builtin_define ("__OS2__"); \ 280 builtin_define ("__EMX__"); \ 281 builtin_define ("__MT__"); \ 282 builtin_assert ("system=unix"); \ 283 builtin_assert ("system=posix"); \ 284 builtin_assert ("system=emx"); \ 285 builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ 286 builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ 287 builtin_define ("_Optlink=__attribute__((__optlink__))"); \ 288 builtin_define ("_System=__attribute__((__system__))"); \ 289 if (!flag_iso) \ 290 { \ 291 builtin_define ("_stdcall=__attribute__((__stdcall__))"); \ 292 builtin_define ("_cdecl=__attribute__((__cdecl__))"); \ 293 builtin_define ("_Cdecl=__attribute__((__cdecl__))"); \ 294 } \ 295 } \ 296 while (0) 297 263 298 #if 1 264 299 /*------------------------------------------------------------------------------ … … 268 303 /* Predefine symbols. */ 269 304 #undef CPP_PREDEFINES 270 #define CPP_PREDEFINES "-D__32BIT__ -D__EMX__ -D__OS2__ -D__i386__ -D__i386 " \ 271 "-Dunix -D__MT__ -D__INNOTEK_LIBC__=0x005 -Asystem=unix -Asystem=posix -Asystem=emx" 305 #define CPP_PREDEFINES "-D__INNOTEK_LIBC__=0x006" 272 306 273 307 /* Provide extra args to the C preprocessor and extra switch-translations. */ 274 308 #undef CPP_SPEC 275 #define CPP_SPEC \ 276 "%(cpp_cpu) " \ 277 "%{posix:-D_POSIX_SOURCE} " \ 278 "%{Zmt*:} %{Zlow-mem:} " \ 279 "%{pg:-D__GPROF__} " \ 280 "%{mepilogue:-D__EPILOGUE__} " \ 281 "%{mprobe|mstack-arg-probe:-D__STACK_PROBE__} " \ 282 "-D__cdecl=__attribute__((__cdecl__)) " \ 283 "-D__stdcall=__attribute__((__stdcall__)) " \ 284 "-D_Optlink=__attribute__((__optlink__)) " \ 285 "-D_System=__attribute__((__system__))" \ 286 "%{!ansi: " \ 287 "-D_cdecl=__attribute__((__cdecl__)) " \ 288 "-D_stdcall=__attribute__((__stdcall__)) " \ 289 "-D_Cdecl=__attribute__((__cdecl__)) }" 309 #define CPP_SPEC \ 310 "%(cpp_cpu) " \ 311 "%{posix:-D_POSIX_SOURCE} " \ 312 "%{Zmt*:} %{Zlow-mem:} " \ 313 "%{pg:-D__GPROF__} " \ 314 "%{mepilogue:-D__EPILOGUE__} " \ 315 "%{mprobe|mstack-arg-probe:-D__STACK_PROBE__} " 290 316 291 317 /* -s to -Zstrip and -Zomf must be passed down. */ … … 298 324 299 325 /* Provide extra args to the linker and extra switch-translations. */ 300 #define LINK_SPEC 301 "%{Zexe} %{Zstack*} %{Zmap*} %{Zomf:%{Zdll}} " 302 "%{!o*:-o %b%{Zdll:.dll}%{!Zdll:%{!Zexe:.exe}}} " 303 "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}" 304 "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}" 305 "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" 306 "%{shared:%{Zexe:%e-shared and -Zexe are incompatible}}" 326 #define LINK_SPEC \ 327 "%{Zexe} %{Zstack*} %{Zmap*} %{Zomf:%{Zdll}} " \ 328 "%{!o*:-o %b%{Zdll:.dll}%{!Zdll:%{!Zexe:.exe}}} " \ 329 "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}" \ 330 "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}" \ 331 "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" \ 332 "%{shared:%{Zexe:%e-shared and -Zexe are incompatible}}" \ 307 333 "%{Zsmall-conv:%{Zcrtdll*:%e-Zsmall-conv and -Zcrtdll are incompatible}}" \ 308 334 "%{shared:-Zdll} %{static:-static}" \ 309 335 310 336 /* Override how and when libgcc.a is included (%G). */ 311 #define LIBGCC_SPEC \ 337 #if 1 /* shared lib == libcXY.dll (not bootstrapping issues here!) */ 338 #define LIBGCC_SPEC \ 312 339 "%{static|static-libgcc:%{shared-libgcc:%e-static-libgcc and -shared-libgcc are incompatible}}"\ 313 "%{shared-libgcc:-lgcc %v1%v2%v3}"\314 "%{!shared-libgcc:%{!static-libgcc:%{!static*:-l gcc%v1%v2%v3}}}"\340 "%{shared-libgcc:-lgcclib_so_d}" \ 341 "%{!shared-libgcc:%{!static-libgcc:%{!static*:-lc_dll}}}" \ 315 342 "%{!shared-libgcc:%{static-libgcc|static:-lgcc_eh -lgcc}}" 343 #else /* shared lib == gcc333.dll */ 344 #define LIBGCC_SPEC \ 345 "%{static|static-libgcc:%{shared-libgcc:%e-static-libgcc and -shared-libgcc are incompatible}}"\ 346 "%{shared-libgcc:-lgcc%v1%v2%v3}" \ 347 "%{!shared-libgcc:%{!static-libgcc:%{!static*:-lgcc%v1%v2%v3}}}" \ 348 "%{!shared-libgcc:%{static-libgcc|static:-lgcc_eh -lgcc}}" 349 #endif 316 350 317 351 /* We have a shared libgcc, but don't need this extra handling. */ … … 319 353 320 354 /* Override the default libraries (%L). */ 321 #define LIB_SPEC 355 #define LIB_SPEC \ 322 356 "-lc_alias " \ 323 357 "%{!static:-lc_dll}" \ 324 "%{static:-lc%{p|pg:_p}_s %{!Zdll:-lc_app%{pg:_p}}} " 358 "%{static:-lc%{p|pg:_p}_s %{!Zdll:-lc_app%{pg:_p}}} " \ 325 359 "-los2%{p|pg:_p}" 326 360 327 /* Override the default crt0 files. */ 328 #define STARTFILE_SPEC \ 329 "%{Zdll:dll0%{Zhigh-mem:hi}%O%{Zomf:bj}%s}" \ 330 "%{!Zdll:%{pg:gcrt0%O%{Zomf:bj}%s}" \ 331 "%{!pg:%{pn:gcrt0%O%{Zomf:bj}%s}%{!pn:%{p:mcrt0%O%{Zomf:bj}%s}%{!p:crt0%{Zhigh-mem:hi}%O%{Zomf:bj}%s}}}"\ 332 " %{Zbin-files:binmode%O%{Zomf:bj}%s} %{Zsmall-conv:smallcnv%O%{Zomf:bj}%s}}" 361 /* Override the default crt0 files. 362 bird: we might consider kicking gcrt & mcrt stuff now... */ 363 #define STARTFILE_SPEC \ 364 "%{Zdll:dll0%{Zhigh-mem:hi}%{Zfork:fork}%O%{Zomf:bj}%s}" \ 365 "%{!Zdll:%{pg:gcrt0%O%{Zomf:bj}%s}" \ 366 "%{!pg:%{pn:gcrt0%O%{Zomf:bj}%s}" \ 367 "%{!pn:%{p:mcrt0%O%{Zomf:bj}%s}" \ 368 "%{!p:crt0%{Zhigh-mem:hi}%{Zfork:fork}%O%{Zomf:bj}%s}}}" \ 369 " %{Zbin-files:binmode%O%{Zomf:bj}%s}" \ 370 " %{Zsmall-conv:smallcnv%O%{Zomf:bj}%s}}" 333 371 334 372 /* Prefer symbols in %L (-lc) over %G (libcAB.dll includes gcc3XY.dll). 335 373 For the GNU linker we need to repeate everything as it doesn't 336 374 restart the library search as the IBM and M$ linkers do. */ 337 #define LINK_GCC_C_SEQUENCE_SPEC "%L %G %L %{!Zomf:%G %L %G %L %G %L}"338 339 #define ENDFILE_SPEC "%{Zomf:-lend}"375 #define LINK_GCC_C_SEQUENCE_SPEC "%L %G %L %{!Zomf:%G %L %G %L %G %L}" 376 377 #define ENDFILE_SPEC "%{Zomf:-lend}" 340 378 341 379 /* Override the default linker program (collect2). */ 342 #define LINKER_NAME "%{Zomf:emxomf}ld.exe"380 #define LINKER_NAME "%{Zomf:emxomf}ld.exe" 343 381 344 382 345 383 346 384 #else 347 #if 1 /* disabled by above #if */348 385 /*------------------------------------------------------------------------------ 349 386 * As the above specs but defaults to OMF. 387 * Note: this is not updated lately. 350 388 *-----------------------------------------------------------------------------*/ 351 389 352 390 /* Predefine symbols. */ 353 391 #undef CPP_PREDEFINES 354 #define CPP_PREDEFINES "-D__32BIT__ -D__EMX__ -D__OS2__ -D__i386__ -D__i386 " \ 355 "-Dunix -D__MT__ -Asystem=unix -Asystem=posix -Asystem=emx" 392 #define CPP_PREDEFINES "" 356 393 357 394 /* Provide extra args to the C preprocessor and extra switch-translations. */ 358 395 #undef CPP_SPEC 359 #define CPP_SPEC \ 360 "%(cpp_cpu) " \ 361 "%{posix:-D_POSIX_SOURCE} " \ 362 "%{Zmt*:} %{Zlow-mem:} " \ 363 "%{pg:-D__GPROF__} " \ 364 "%{mepilogue:-D__EPILOGUE__} " \ 365 "%{mprobe|mstack-arg-probe:-D__STACK_PROBE__} " \ 366 "-D__cdecl=__attribute__((__cdecl__)) " \ 367 "-D__stdcall=__attribute__((__stdcall__)) " \ 368 "-D_Optlink=__attribute__((__optlink__)) " \ 369 "-D_System=__attribute__((__system__))" \ 370 "%{!ansi: " \ 371 "-D_cdecl=__attribute__((__cdecl__)) " \ 372 "-D_stdcall=__attribute__((__stdcall__)) " \ 373 "-D_Cdecl=__attribute__((__cdecl__)) }" 396 #define CPP_SPEC \ 397 "%(cpp_cpu) " \ 398 "%{posix:-D_POSIX_SOURCE} " \ 399 "%{Zmt*:} %{Zlow-mem:} " \ 400 "%{pg:-D__GPROF__} " \ 401 "%{mepilogue:-D__EPILOGUE__} " \ 402 "%{mprobe|mstack-arg-probe:-D__STACK_PROBE__} " 374 403 375 404 /* -s to -Zstrip and -Zomf must be passed down. */ … … 382 411 383 412 /* Provide extra args to the linker and extra switch-translations. */ 384 #define LINK_SPEC 385 "%{Zexe} %{Zstack*} %{Zmap*} %{!Zaout:%{Zdll}} " 386 "%{!o*:-o %b%{Zdll:.dll}%{!Zdll:%{!Zexe:.exe}}} " 387 "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}" 388 "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}" 389 "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" 413 #define LINK_SPEC \ 414 "%{Zexe} %{Zstack*} %{Zmap*} %{!Zaout:%{Zdll}} " \ 415 "%{!o*:-o %b%{Zdll:.dll}%{!Zdll:%{!Zexe:.exe}}} " \ 416 "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}" \ 417 "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}" \ 418 "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" \ 390 419 "%{Zsmall-conv:%{Zcrtdll*:%e-Zsmall-conv and -Zcrtdll are incompatible}}" 391 420 392 421 /* Override how and when libgcc.a is included (%G). */ 393 #define LIBGCC_SPEC 422 #define LIBGCC_SPEC \ 394 423 "%{static|static-libgcc:%{shared-libgcc:%e-static-libgcc and -shared-libgcc are incompatible}}"\ 395 "%{shared-libgcc:-lgcc%v1%v2%v3}" 396 "%{!shared-libgcc:%{!static-libgcc:%{!static:-lgcc%v1%v2%v3}}}" 424 "%{shared-libgcc:-lgcc%v1%v2%v3}" \ 425 "%{!shared-libgcc:%{!static-libgcc:%{!static:-lgcc%v1%v2%v3}}}" \ 397 426 "%{!shared-libgcc:%{static-libgcc|static:-lgcc_eh -lgcc}}" 398 427 … … 401 430 402 431 /* Override the default libraries (%L). */ 403 #define LIB_SPEC 432 #define LIB_SPEC \ 404 433 "-lc_alias " \ 405 434 "%{!static:-lc_dll}" \ … … 407 436 408 437 /* Override the default crt0 files. */ 409 #define STARTFILE_SPEC 410 "%{Zdll:dll0%{Zhigh-mem:hi}%O%{!Zaout:bj}%s}" 411 "%{!Zdll:%{pg:gcrt0%O%{!Zaout:bj}%s}" 438 #define STARTFILE_SPEC \ 439 "%{Zdll:dll0%{Zhigh-mem:hi}%O%{!Zaout:bj}%s}" \ 440 "%{!Zdll:%{pg:gcrt0%O%{!Zaout:bj}%s}" \ 412 441 "%{!pg:%{pn:gcrt0%O%{!Zaout:bj}%s}%{!pn:%{p:mcrt0%O%{!Zaout:bj}%s}%{!p:crt0%{Zhigh-mem:hi}%O%{!Zaout:bj}%s}}}"\ 413 442 " %{Zbin-files:binmode%O%{!Zaout:bj}%s} %{Zsmall-conv:smallcnv%O%{!Zaout:bj}%s}}" … … 423 452 #define LINKER_NAME "%{!Zaout:emxomf}ld.exe" 424 453 425 426 427 428 #else429 /*------------------------------------------------------------------------------430 * Older proprosal which doesn't define __EMX__ (to be removed?)431 *-----------------------------------------------------------------------------*/432 433 /* Predefine symbols `__32BIT__', `__EMX__', `i386' and __MT__ (not -Zmt). */434 #undef CPP_PREDEFINES435 #define CPP_PREDEFINES "-D__32BIT__ -D__OS2__ -D__i386__ -D__i386 " \436 "-Dunix -D__MT__ -Asystem=unix -Asystem=posix -Asystem=emx"437 438 #undef CPP_SPEC439 #define CPP_SPEC \440 "%(cpp_cpu) " \441 "%{posix:-D_POSIX_SOURCE} " \442 "%{Zmt*:} " \443 "%{pg:-D__GPROF__} " \444 "%{mepilogue:-D__EPILOGUE__} " \445 "%{mprobe|mstack-arg-probe:-D__STACK_PROBE__} " \446 "-D__cdecl=__attribute__((__cdecl__)) " \447 "-D__stdcall=__attribute__((__stdcall__)) " \448 "%{!ansi: " \449 "-D_cdecl=__attribute__((__cdecl__)) " \450 "-D_stdcall=__attribute__((__stdcall__)) " \451 "-D_Cdecl=__attribute__((__cdecl__)) " \452 "-D_Optlink=__attribute__((__optlink__)) " \453 "-D_System=__attribute__((__system__))}"454 455 /* Pass -s (as -Zstrip) to the assembler. */456 #define ASM_SPEC "%{Zomf} %{s:-Zstrip}"457 458 #define LINK_SPEC \459 "%{Zexe} %{Zstack*} %{Zmap*} %{Zomf:%{Zdll}} " \460 "%{!o*:-o %b%{Zdll:.dll}%{!Zdll:%{!Zexe:.exe}}} " \461 "%{Zomf:%{Zaout:%e-Zomf and -Zaout are incompatible}}" \462 "%{static:%{Zcrtdll*:%e-static and -Zcrtdll are incompatible}}" \463 "%{Zdll:%{Zexe:%e-Zdll and -Zexe are incompatible}}" \464 "%{Zsmall-conv:%{Zcrtdll*:%e-Zsmall-conv and -Zcrtdll are incompatible}}"465 466 /* Actually we're using shared libgcc, but we use it a lot differently ... */467 #undef ENABLE_SHARED_LIBGCC468 #define LIBGCC_SPEC \469 "%{static|static-libgcc:%{shared-libgcc:%e-static-libgcc and -shared-libgcc are incompatible}}"\470 "%{shared-libgcc:-lgcc%v1%v2%v3}" \471 "%{!shared-libgcc:%{!static-libgcc:%{Zcrtdll*:-lgcc%v1%v2%v3}}}" \472 "%{!shared-libgcc:%{static-libgcc|!Zcrtdll*:-lgcc_eh -lgcc}}"473 474 #define LIB_SPEC \475 "%{p|pg:-lc_p} -lc " \476 "%{Zdll:%{Zso:-lc_dllso}%{Zno-rte:-lc_dllnrt}" \477 "%{!Zso:%{!Zno-rte:-lc_dllrt}}}" \478 "%{!Zdll:-lc_app%{pg:_p}} " \479 "%G %{p|pg:-lc_p} -lc " \480 "%{Zdll:%{!Zso:%{!Zno-rte:-lc_dllrt}}}"481 482 #define STARTFILE_SPEC \483 "%{Zdll:dll0%O%{Zomf:bj}%s}" \484 "%{!Zdll:%{pg:gcrt0%O%{Zomf:bj}%s}" \485 "%{!pg:%{pn:gcrt0%O%{Zomf:bj}%s}%{!pn:%{p:mcrt0%O%{Zomf:bj}%s}%{!p:crt0%O%{Zomf:bj}%s}}}"\486 " %{Zsysv-signals:sigsysv%O%{Zomf:bj}%s} %{Zbsd-signals:sigbsd%O%{Zomf:bj}%s}"\487 " %{Zbin-files:binmode%O%{Zomf:bj}%s}%{Zsmall-conv:smallcnv%O%{Zomf:bj}%s}}"488 489 #define LINK_COMMAND_SPEC \490 "%{!fsyntax-only: " \491 "%{!c:%{!M:%{!MM:%{!E:%{!S:%{!Zomf:ld}%{Zomf:emxomfld} " \492 "%l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} " \493 "%{r} %{s} %{t} %{u*} %{x} %{z} %{Z} " \494 "%{!A:%{!nostdlib:%{!nostartfiles:%S}}} " \495 "%{static:} %{L*} %D %{T*} %o " \496 "%{!nostdlib:%{!nodefaultlibs:" \497 "-lc_alias %G " \498 "%{Zcrtdll=*:-lc_static -l%* -los2%{pg:_p} -lemx2}" \499 "%{!Zcrtdll*:%L " \500 "%{Zno-rte:-los2%{pg:_p}} " \501 "%{!Zno-rte:%{Zsys:-lsys -los2} " \502 "%{!Zsys:-lemx -los2%{pg:_p} -lemx2} " \503 "}" \504 "}" \505 "%{Zomf:-lend}}" \506 "}" \507 "%{!A:%{!nostdlib:%{!nostartfiles:%E}}} " \508 "}}}}}}"509 #endif510 454 #endif 511 455 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/i386.c
-
Property cvs2svn:cvs-rev
changed from
1.16
to1.17
r1417 r1418 24 24 #include "rtl.h" 25 25 #include "tree.h" 26 #include "diagnostic.h" 26 27 #include "tm_p.h" 27 28 #include "regs.h" … … 41 42 #include "basic-block.h" 42 43 #include "ggc.h" 43 #include "diagnostic.h"44 44 #include "target.h" 45 45 #include "target-def.h" … … 809 809 static int ix86_fntype_regparm PARAMS ((tree)); 810 810 const struct attribute_spec ix86_attribute_table[]; 811 #ifndef EMX 811 812 static tree ix86_handle_cdecl_attribute PARAMS ((tree *, tree, tree, int, bool *)); 813 #endif 812 814 static tree ix86_handle_regparm_attribute PARAMS ((tree *, tree, tree, int, bool *)); 813 815 static int ix86_value_regno PARAMS ((enum machine_mode)); … … 974 976 {&k6_cost, 0, 0, 32, 7, 32, 7, 32, 1, 5}, 975 977 {&athlon_cost, 0, 0, 16, 7, 64, 7, 16, 1, 5}, 976 {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0, 0,1, 0}978 {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0, 1, 0} 977 979 }; 978 980 … … 1482 1484 /* Check if we don't have incompatible calling conversion attributes */ 1483 1485 int 1484 ix86_check_append_attr (tree type, tree name, bool *no_add_attrs) 1486 ix86_check_append_attr (type, name, no_add_attrs) 1487 tree type, name; 1488 bool *no_add_attrs; 1485 1489 { 1486 1490 /* ??? use ix86_comp_type_attributes maybe ??? */ … … 1524 1528 } 1525 1529 1530 #ifndef EMX 1526 1531 /* Handle a "cdecl" or "stdcall" attribute; 1527 1532 arguments as in struct attribute_spec.handler. */ … … 1556 1561 return NULL_TREE; 1557 1562 } 1563 #endif 1558 1564 1559 1565 /* Handle a "regparm" attribute; … … 1603 1609 1604 1610 /* Adds calling convention to a function dump. (diagnostic) */ 1605 void ix86_print_attributes (tree type, struct output_buffer *scratch_buffer) 1611 void ix86_print_attributes (type, scratch_buffer) 1612 tree type; 1613 struct output_buffer *scratch_buffer; 1606 1614 { 1607 1615 tree attr; … … 1850 1858 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES 1851 1859 if (cum->optlink) 1860 { 1852 1861 if (INTEGRAL_TYPE_P (TREE_VALUE (param)) 1853 1862 || POINTER_TYPE_P (TREE_VALUE (param))) … … 1855 1864 else if (TREE_CODE (TREE_VALUE (param)) == REAL_TYPE) 1856 1865 cum->fpu_nregs++; 1866 } 1857 1867 #endif 1858 1868 next_param = TREE_CHAIN (param); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/t-emx
-
Property cvs2svn:cvs-rev
changed from
1.26
to1.27
r1417 r1418 29 29 SHLIB_DLLNAME = $(SHLIB_MULTINAME).dll 30 30 SHLIB_LINK = export DLLAR_CMDLINE="@shlib_objs@" && \ 31 $(REXX) dllar.cmd -o $ $(@D)/$(SHLIB_DLLNAME) \31 $(REXX) dllar.cmd -o $(SHLIB_DLLNAME) \ 32 32 -ordinal @multilib_flags@ -nocrtdll \ 33 33 -flags "-Zhigh-mem -Zomf -g" \ … … 35 35 -d "GNU GCC Runtime Version $(gcc_version)" \ 36 36 -libf "INITINSTANCE TERMGLOBAL" -lc_alias -lc_dll \ 37 && ar rs $$(@D)/$(SHLIB_BASENAME).a libgcc/$$(@D)/__main.o libgcc/$$(@D)/emx-ctordtor.o libgcc/$$(@D)/emx-eh.o \ 37 && ar rs $(SHLIB_BASENAME).a libgcc/__main.o libgcc/emx-ctordtor.o libgcc/emx-eh.o \ 38 && emximp -o libgcc_so_d.a $(srcdir)/config/i386/emx-libgcc_so_d.def \ 39 && ar rs libgcc_so_d.a libgcc/__main.o libgcc/emx-ctordtor.o libgcc/emx-eh.o \ 38 40 && touch $$@ 39 41 SHLIB_SUBDIR = . 40 42 SHLIB_INSTALL = $$(INSTALL_DATA) $(SHLIB_SUBDIR)/$(SHLIB_DLLNAME) $$(DESTDIR)$$(slibdir)/ \ 41 && $$(INSTALL_DATA) $(SHLIB_SUBDIR)/$(SHLIB_BASENAME).a $$(DESTDIR)$$(libsubdir)/$(SHLIB_SUBDIR)/ 43 && $$(INSTALL_DATA) $(SHLIB_SUBDIR)/$(SHLIB_BASENAME).a $$(DESTDIR)$$(libsubdir)/$(SHLIB_SUBDIR)/ \ 44 && $$(INSTALL_DATA) $(SHLIB_SUBDIR)/libgcc_so_d.a $$(DESTDIR)$$(libsubdir)/$(SHLIB_SUBDIR)/ 42 45 43 46 # Dont use collect2 … … 62 65 $(srcdir)/config/i386/emx-eh.c \ 63 66 $(srcdir)/config/i386/emx-dllinit.c \ 64 $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ 65 $(srcdir)/unwind-sjlj.c 67 $(srcdir)/unwind-dw2.c \ 68 $(srcdir)/unwind-dw2-fde.c \ 69 $(srcdir)/unwind-sjlj.c \ 70 $(srcdir)/unwind-c.c 66 71 #LIB2ADDEHDEP 67 72 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.