Commit c8d7958
Darwin, Arm64 : Initial definitions for the port.
This is enough to make a buildable cross-compiler on x86_64
Darwin and compile trivial codes. Although the link phase might
not succeed - one can link objects manually and get an exe
that works.
There's an initial implementation of the rule changes for darwinpcs.
There's an initial (pretty hacky) set of changes to deal with the
post-fix assembly notation for Mach-O relocs.
There are a few places where ELF was assumed, and we need to
prevent incompatible output for Mach-O (probably there are other
ways to do this).
+ Pick up atomic builtins from the libgcc.a
CHECKME: should these be exported from the shared lib? (at
present, that doesn't seem to be ideal). Look at what's done for
the clang toolchain.
+ long double is DF not TF :(
We will need to figure out what to do about supporting XXX*16 a some point.
+ Fix ptrdiff type.
This was wrong (the size needs to track the 64-bitness and was failing
to do so.
+ Add in driver sef-specs.
Ensure that we issue the Darwin driver self specs and set the
mabi and little-endian flags. clang accepts -mabi=darwinpcs
so we allow that (but it means the same as lp64 at present since
the target is determined at configuration time).
+ Fix an other build error for Darwin.
Since we don't emit ELF function decorations this means that
some of the variables are unused.
+ Initial implementation for EH without .cfi_xxxx
While we can (most likely) make the .cfi_ codegen work, there are
comments in the Ada code that suggest the capabilities of the unwinder
are somewhat restricted. At least this option allows for the case of using
libgcc_eh when an exe is self-contained.
+ Just whitespace fixes NFC.
+ We don't yet support TF, so reject 'q' suffix.
The floating point literal suffix 'q' is specifically stated to be used
for _float128, which we don't yet support.
+ Connect up the subtarget builtins i.e. __builtin_cfstring.
The idea of OS-specific subtarget builtins doesn't fit too well with
the general organisation of the aarch64 ones.
What this does is to add it into the "GENERAL" class (but the
darwin-specific code has no idea that the builtin code number has
subfields).
+ Build fix for subtarget builtins.
One either needs to define SUBTARGET_INIT_BUILTINS to empty
or conditionalize its use
+ Connect up the sub-target attribute table.
Darwin has some Mach-O / OS attributes, add these to the end of
the aarch64 set..
+ Connect up the pragma table.
Darwin has some Mach-O / OS-specific pragmas, connected these to
the end of the aarch64 table.
gcc/ChangeLog:
* config.gcc: Handle aarch64 and arm64 darwin.
* config/aarch64/aarch64-protos.h (enum aarch64_symbol_type):
Provide for symbol classifications for Mach-O.
* config/aarch64/aarch64.c (aarch64_elf_asm_destructor):
Don't define these for Mach-O (it's not ELF!).
(handle_aarch64_vector_pcs_attribute):
Handle darwinpcs.
(aarch64_reg_save_mode): Likewise.
(aarch64_load_symref_appropriately): Handle Mach-O.
(aarch64_expand_mov_immediate): Likewise.
(aarch64_layout_arg): Handle darwinpcs rules.
(aarch64_function_arg): Likewise.
(aarch64_init_cumulative_args): Likewise.
(aarch64_function_arg_advance): Likewise.
(aarch64_print_operand): Likewise (we can probably do
better).
(aarch64_print_address_internal): Likewise.
(aarch64_asm_output_labelref): Likewise.
(initialize_aarch64_code_model): Accept large PIC for
Mach-O - of course, that doesn't mean it works.
(aarch64_classify_symbol): Only emit ELF directives if they
are available.
(aarch64_declare_function_name): Likewise.
(aarch64_asm_output_alias): Likewise.
(aarch64_sls_emit_shared_blr_thunks): Likewise.
(TARGET_ASM_UNALIGNED_HI_OP): New.
(TARGET_ASM_UNALIGNED_SI_OP): New.
(TARGET_ASM_UNALIGNED_DI_OP): New.
* config/aarch64/aarch64.h (TARGET_MACHO): Declare as 0.
(enum arm_pcs): Add darwinpcs.
(SUBTARGET_EXTRA_SPECS): New.
(EXTRA_SPECS): Allow for sub-target specs.
* config/aarch64/aarch64.md (unspec enum): Add UNSPEC_MACHOPIC_OFFSET.
(ldr_got_small_<mode>): Allow for postfix assembler syntax.
(ldr_got_small_<mode>): Likewise.
* config/aarch64/darwin.h: New file.
* config/aarch64/t-aarch64-darwin: New file.1 parent 1da8c29 commit c8d7958
File tree
10 files changed
+407
-15
lines changed- gcc
- config/aarch64
10 files changed
+407
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1124 | 1129 | | |
1125 | 1130 | | |
1126 | 1131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
526 | 528 | | |
527 | 529 | | |
528 | 530 | | |
| |||
1461 | 1463 | | |
1462 | 1464 | | |
1463 | 1465 | | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1464 | 1474 | | |
1465 | 1475 | | |
1466 | 1476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
364 | 368 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| |||
952 | 960 | | |
953 | 961 | | |
954 | 962 | | |
| 963 | + | |
955 | 964 | | |
956 | 965 | | |
957 | 966 | | |
| |||
0 commit comments