Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/darwin.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Target definitions for Darwin (Mac OS X) systems. | 1 /* Target definitions for Darwin (Mac OS X) systems. |
2 Copyright (C) 1989-2017 Free Software Foundation, Inc. | 2 Copyright (C) 1989-2018 Free Software Foundation, Inc. |
3 Contributed by Apple Computer Inc. | 3 Contributed by Apple Computer Inc. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify | 7 GCC is free software; you can redistribute it and/or modify |
40 like a.out and partly like COFF, with additional features like | 40 like a.out and partly like COFF, with additional features like |
41 multi-architecture binary support. */ | 41 multi-architecture binary support. */ |
42 | 42 |
43 #define DARWIN_X86 0 | 43 #define DARWIN_X86 0 |
44 #define DARWIN_PPC 0 | 44 #define DARWIN_PPC 0 |
45 | |
46 /* Don't assume anything about the header files. */ | |
47 #define NO_IMPLICIT_EXTERN_C | |
48 | 45 |
49 /* Suppress g++ attempt to link in the math library automatically. */ | 46 /* Suppress g++ attempt to link in the math library automatically. */ |
50 #define MATH_LIBRARY "" | 47 #define MATH_LIBRARY "" |
51 | 48 |
52 /* We have atexit. */ | 49 /* We have atexit. */ |
123 | 120 |
124 #define DRIVER_SELF_SPECS \ | 121 #define DRIVER_SELF_SPECS \ |
125 "%{gfull:-g -fno-eliminate-unused-debug-symbols} %<gfull", \ | 122 "%{gfull:-g -fno-eliminate-unused-debug-symbols} %<gfull", \ |
126 "%{gused:-g -feliminate-unused-debug-symbols} %<gused", \ | 123 "%{gused:-g -feliminate-unused-debug-symbols} %<gused", \ |
127 "%{fapple-kext|mkernel:-static}", \ | 124 "%{fapple-kext|mkernel:-static}", \ |
128 "%{shared:-Zdynamiclib} %<shared" | 125 "%{shared:-Zdynamiclib} %<shared", \ |
126 "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } \ | |
127 %<gsplit-dwarf" | |
129 | 128 |
130 #define DARWIN_CC1_SPEC \ | 129 #define DARWIN_CC1_SPEC \ |
131 "%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \ | 130 "%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \ |
132 "%{fterminated-vtables: -fapple-kext} %<fterminated-vtables " \ | 131 "%{fterminated-vtables: -fapple-kext} %<fterminated-vtables " \ |
133 "%<filelist* %<framework*" | 132 "%<filelist* %<framework*" |
174 #define LINK_COMMAND_SPEC_A \ | 173 #define LINK_COMMAND_SPEC_A \ |
175 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ | 174 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ |
176 %(linker)" \ | 175 %(linker)" \ |
177 LINK_PLUGIN_SPEC \ | 176 LINK_PLUGIN_SPEC \ |
178 "%{flto*:%<fcompare-debug*} \ | 177 "%{flto*:%<fcompare-debug*} \ |
179 %{flto*} \ | 178 %{flto} %{fno-lto} %{flto=*} \ |
180 %l " LINK_COMPRESS_DEBUG_SPEC \ | 179 %l " LINK_COMPRESS_DEBUG_SPEC \ |
181 "%X %{s} %{t} %{Z} %{u*} \ | 180 "%X %{s} %{t} %{Z} %{u*} \ |
182 %{e*} %{r} \ | 181 %{e*} %{r} \ |
183 %{o*}%{!o:-o a.out} \ | 182 %{o*}%{!o:-o a.out} \ |
184 %{!nostdlib:%{!nostartfiles:%S}} \ | 183 %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ |
185 %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ | 184 %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \ |
186 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \ | 185 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \ |
187 %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ | 186 %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ |
188 %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\ | |
189 %{fgnu-tm: \ | 187 %{fgnu-tm: \ |
190 %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \ | 188 %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \ |
191 %{!nostdlib:%{!nodefaultlibs:\ | 189 %{!nostdlib:%{!r:%{!nodefaultlibs:\ |
192 %{%:sanitize(address): -lasan } \ | 190 %{%:sanitize(address): -lasan } \ |
193 %{%:sanitize(undefined): -lubsan } \ | 191 %{%:sanitize(undefined): -lubsan } \ |
194 %(link_ssp) \ | 192 %(link_ssp) \ |
195 " DARWIN_EXPORT_DYNAMIC " %<rdynamic \ | 193 " DARWIN_EXPORT_DYNAMIC " %<rdynamic \ |
196 %(link_gcc_c_sequence) \ | 194 %(link_gcc_c_sequence) \ |
197 }}\ | 195 }}}\ |
198 %{!nostdlib:%{!nostartfiles:%E}} %{T*} %{F*} }}}}}}}" | 196 %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}" |
199 | 197 |
200 #define DSYMUTIL "\ndsymutil" | 198 #define DSYMUTIL "\ndsymutil" |
201 | 199 |
202 #define DSYMUTIL_SPEC \ | 200 #define DSYMUTIL_SPEC \ |
203 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ | 201 "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ |
212 #define COLLECT_RUN_DSYMUTIL 1 | 210 #define COLLECT_RUN_DSYMUTIL 1 |
213 | 211 |
214 /* We only want one instance of %G, since libSystem (Darwin's -lc) does not depend | 212 /* We only want one instance of %G, since libSystem (Darwin's -lc) does not depend |
215 on libgcc. */ | 213 on libgcc. */ |
216 #undef LINK_GCC_C_SEQUENCE_SPEC | 214 #undef LINK_GCC_C_SEQUENCE_SPEC |
217 #define LINK_GCC_C_SEQUENCE_SPEC "%G %L" | 215 #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L}" |
218 | 216 |
219 /* ld64 supports a sysroot, it just has a different name and there's no easy | 217 /* ld64 supports a sysroot, it just has a different name and there's no easy |
220 way to check for it at config time. */ | 218 way to check for it at config time. */ |
221 #undef HAVE_LD_SYSROOT | 219 #undef HAVE_LD_SYSROOT |
222 #define HAVE_LD_SYSROOT 1 | 220 #define HAVE_LD_SYSROOT 1 |
423 | 421 |
424 /* Default ASM_DEBUG_SPEC. Darwin's as cannot currently produce dwarf | 422 /* Default ASM_DEBUG_SPEC. Darwin's as cannot currently produce dwarf |
425 debugging data. */ | 423 debugging data. */ |
426 | 424 |
427 #define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}" | 425 #define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}" |
426 #define ASM_FINAL_SPEC \ | |
427 "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform } %<gsplit-dwarf" | |
428 | 428 |
429 /* We still allow output of STABS if the assembler supports it. */ | 429 /* We still allow output of STABS if the assembler supports it. */ |
430 #ifdef HAVE_AS_STABS_DIRECTIVE | 430 #ifdef HAVE_AS_STABS_DIRECTIVE |
431 #define DBX_DEBUGGING_INFO 1 | 431 #define DBX_DEBUGGING_INFO 1 |
432 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG | 432 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG |
433 #endif | 433 #endif |
434 | 434 |
435 #define DWARF2_DEBUGGING_INFO 1 | 435 #define DWARF2_DEBUGGING_INFO 1 |
436 | 436 |
437 #define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" | 437 #define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug" |
438 #define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug" | 438 #define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug" |
439 #define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug" | 439 #define DEBUG_ABBREV_SECTION "__DWARF,__debug_abbrev,regular,debug" |
440 #define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug" | 440 #define DEBUG_ARANGES_SECTION "__DWARF,__debug_aranges,regular,debug" |
441 #define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug" | 441 #define DEBUG_MACINFO_SECTION "__DWARF,__debug_macinfo,regular,debug" |
442 #define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug" | 442 #define DEBUG_LINE_SECTION "__DWARF,__debug_line,regular,debug" |
443 #define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug" | 443 #define DEBUG_LOC_SECTION "__DWARF,__debug_loc,regular,debug" |
444 #define DEBUG_PUBNAMES_SECTION "__DWARF,__debug_pubnames,regular,debug" | 444 #define DEBUG_LOCLISTS_SECTION "__DWARF,__debug_loclists,regular,debug" |
445 #define DEBUG_PUBTYPES_SECTION "__DWARF,__debug_pubtypes,regular,debug" | 445 |
446 #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" | 446 #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" |
447 #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" | 447 #define DEBUG_STR_OFFSETS_SECTION "__DWARF,__debug_str_offs,regular,debug" |
448 #define DEBUG_MACRO_SECTION "__DWARF,__debug_macro,regular,debug" | 448 #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" |
449 #define DEBUG_RNGLISTS_SECTION "__DWARF,__debug_rnglists,regular,debug" | |
450 #define DEBUG_MACRO_SECTION "__DWARF,__debug_macro,regular,debug" | |
449 | 451 |
450 #define DEBUG_LTO_INFO_SECTION "__GNU_DWARF_LTO,__debug_info,regular,debug" | 452 #define DEBUG_LTO_INFO_SECTION "__GNU_DWARF_LTO,__debug_info,regular,debug" |
451 #define DEBUG_LTO_ABBREV_SECTION "__GNU_DWARF_LTO,__debug_abbrev,regular,debug" | 453 #define DEBUG_LTO_ABBREV_SECTION "__GNU_DWARF_LTO,__debug_abbrev,regular,debug" |
452 #define DEBUG_LTO_MACINFO_SECTION "__GNU_DWARF_LTO,__debug_macinfo,regular,debug" | 454 #define DEBUG_LTO_MACINFO_SECTION "__GNU_DWARF_LTO,__debug_macinfo,regular,debug" |
453 #define DEBUG_LTO_LINE_SECTION "__GNU_DWARF_LTO,__debug_line,regular,debug" | 455 #define DEBUG_LTO_LINE_SECTION "__GNU_DWARF_LTO,__debug_line,regular,debug" |
454 #define DEBUG_LTO_STR_SECTION "__GNU_DWARF_LTO,__debug_str,regular,debug" | 456 #define DEBUG_LTO_STR_SECTION "__GNU_DWARF_LTO,__debug_str,regular,debug" |
455 #define DEBUG_LTO_MACRO_SECTION "__GNU_DWARF_LTO,__debug_macro,regular,debug" | 457 #define DEBUG_LTO_MACRO_SECTION "__GNU_DWARF_LTO,__debug_macro,regular,debug" |
456 | 458 |
457 #define TARGET_WANT_DEBUG_PUB_SECTIONS true | 459 #define TARGET_WANT_DEBUG_PUB_SECTIONS true |
460 #define DEBUG_PUBNAMES_SECTION ((debug_generate_pub_sections == 2) \ | |
461 ? "__DWARF,__debug_gnu_pubn,regular,debug" \ | |
462 : "__DWARF,__debug_pubnames,regular,debug") | |
463 | |
464 #define DEBUG_PUBTYPES_SECTION ((debug_generate_pub_sections == 2) \ | |
465 ? "__DWARF,__debug_gnu_pubt,regular,debug" \ | |
466 : "__DWARF,__debug_pubtypes,regular,debug") | |
458 | 467 |
459 /* When generating stabs debugging, use N_BINCL entries. */ | 468 /* When generating stabs debugging, use N_BINCL entries. */ |
460 | 469 |
461 #define DBX_USE_BINCL | 470 #define DBX_USE_BINCL |
462 | 471 |
710 #define TARGET_ASM_SELECT_SECTION machopic_select_section | 719 #define TARGET_ASM_SELECT_SECTION machopic_select_section |
711 | 720 |
712 #undef TARGET_ASM_FUNCTION_SECTION | 721 #undef TARGET_ASM_FUNCTION_SECTION |
713 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section | 722 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section |
714 | 723 |
715 #undef TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS | |
716 #define TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS \ | |
717 darwin_function_switched_text_sections | |
718 | |
719 #undef TARGET_ASM_SELECT_RTX_SECTION | 724 #undef TARGET_ASM_SELECT_RTX_SECTION |
720 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section | 725 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section |
721 #undef TARGET_ASM_UNIQUE_SECTION | 726 #undef TARGET_ASM_UNIQUE_SECTION |
722 #define TARGET_ASM_UNIQUE_SECTION darwin_unique_section | 727 #define TARGET_ASM_UNIQUE_SECTION darwin_unique_section |
723 #undef TARGET_ASM_FUNCTION_RODATA_SECTION | 728 #undef TARGET_ASM_FUNCTION_RODATA_SECTION |
739 #undef TARGET_ASM_ASSEMBLE_VISIBILITY | 744 #undef TARGET_ASM_ASSEMBLE_VISIBILITY |
740 #define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility | 745 #define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility |
741 | 746 |
742 /* Extra attributes for Darwin. */ | 747 /* Extra attributes for Darwin. */ |
743 #define SUBTARGET_ATTRIBUTE_TABLE \ | 748 #define SUBTARGET_ATTRIBUTE_TABLE \ |
744 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler, \ | 749 /* { name, min_len, max_len, decl_req, type_req, fn_type_req, \ |
745 affects_type_identity } */ \ | 750 affects_type_identity, handler, exclude } */ \ |
746 { "apple_kext_compatibility", 0, 0, false, true, false, \ | 751 { "apple_kext_compatibility", 0, 0, false, true, false, false, \ |
747 darwin_handle_kext_attribute, false }, \ | 752 darwin_handle_kext_attribute, NULL }, \ |
748 { "weak_import", 0, 0, true, false, false, \ | 753 { "weak_import", 0, 0, true, false, false, false, \ |
749 darwin_handle_weak_import_attribute, false } | 754 darwin_handle_weak_import_attribute, NULL } |
750 | 755 |
751 /* Make local constant labels linker-visible, so that if one follows a | 756 /* Make local constant labels linker-visible, so that if one follows a |
752 weak_global constant, ld64 will be able to separate the atoms. */ | 757 weak_global constant, ld64 will be able to separate the atoms. */ |
753 #undef ASM_GENERATE_INTERNAL_LABEL | 758 #undef ASM_GENERATE_INTERNAL_LABEL |
754 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | 759 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ |