|
| 1 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.c gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.c |
| 2 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64.c 2018-03-15 08:55:04.000000000 +0000 |
| 3 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.c 2018-05-08 11:09:01.247467815 +0100 |
| 4 | +@@ -11963,8 +11963,24 @@ |
| 5 | + || !register_operand (target, Pmode)) |
| 6 | + target = gen_reg_rtx (Pmode); |
| 7 | + |
| 8 | +- /* Can return in any reg. */ |
| 9 | +- emit_insn (gen_aarch64_load_tp_hard (target)); |
| 10 | ++ if (TARGET_HARD_TP) |
| 11 | ++ { |
| 12 | ++ /* Can return in any reg. */ |
| 13 | ++ emit_insn (gen_aarch64_load_tp_hard (target)); |
| 14 | ++ } |
| 15 | ++ else |
| 16 | ++ { |
| 17 | ++ /* Always returned in r0. Immediately copy the result into a pseudo, |
| 18 | ++ otherwise other uses of r0 (e.g. setting up function arguments) may |
| 19 | ++ clobber the value. */ |
| 20 | ++ |
| 21 | ++ rtx tmp; |
| 22 | ++ |
| 23 | ++ emit_insn (gen_aarch64_load_tp_soft ()); |
| 24 | ++ |
| 25 | ++ tmp = gen_rtx_REG (DImode, R0_REGNUM); |
| 26 | ++ emit_move_insn (target, tmp); |
| 27 | ++ } |
| 28 | + return target; |
| 29 | + } |
| 30 | + |
| 31 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64-elf-raw.h gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-elf-raw.h |
| 32 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64-elf-raw.h 2018-01-03 10:03:58.000000000 +0000 |
| 33 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-elf-raw.h 2018-05-08 11:09:01.247467815 +0100 |
| 34 | +@@ -22,6 +22,7 @@ |
| 35 | + #ifndef GCC_AARCH64_ELF_RAW_H |
| 36 | + #define GCC_AARCH64_ELF_RAW_H |
| 37 | + |
| 38 | ++#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group" |
| 39 | + #define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s" |
| 40 | + #define ENDFILE_SPEC \ |
| 41 | + " crtend%O%s crtn%O%s " \ |
| 42 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.h gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.h |
| 43 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64.h 2018-02-21 14:05:45.000000000 +0000 |
| 44 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.h 2018-05-08 11:09:01.255467862 +0100 |
| 45 | +@@ -957,6 +957,10 @@ |
| 46 | + /* Check TLS Descriptors mechanism is selected. */ |
| 47 | + #define TARGET_TLS_DESC (aarch64_tls_dialect == TLS_DESCRIPTORS) |
| 48 | + |
| 49 | ++/* Check selected thread pointer access sequence to use. */ |
| 50 | ++#define TARGET_HARD_TP (target_thread_pointer == TP_HARD) |
| 51 | ++#define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT) |
| 52 | ++ |
| 53 | + extern enum aarch64_code_model aarch64_cmodel; |
| 54 | + |
| 55 | + /* When using the tiny addressing model conditional and unconditional branches |
| 56 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.md gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.md |
| 57 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64.md 2018-04-24 17:58:49.000000000 +0100 |
| 58 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.md 2018-05-08 11:09:01.255467862 +0100 |
| 59 | +@@ -5693,11 +5693,22 @@ |
| 60 | + (define_insn "aarch64_load_tp_hard" |
| 61 | + [(set (match_operand:DI 0 "register_operand" "=r") |
| 62 | + (unspec:DI [(const_int 0)] UNSPEC_TLS))] |
| 63 | +- "" |
| 64 | +- "mrs\\t%0, tpidr_el0" |
| 65 | ++ "TARGET_HARD_TP" |
| 66 | ++ "mrs\\t%0, tpidr_el0\\t// aarch64_load_tp_hard" |
| 67 | + [(set_attr "type" "mrs")] |
| 68 | + ) |
| 69 | + |
| 70 | ++(define_insn "aarch64_load_tp_soft" |
| 71 | ++ [(set (reg:DI 0) (unspec:DI [(const_int 0)] UNSPEC_TLS)) |
| 72 | ++ (clobber (reg:DI IP0_REGNUM)) |
| 73 | ++ (clobber (reg:DI IP1_REGNUM)) |
| 74 | ++ (clobber (reg:DI LR_REGNUM)) |
| 75 | ++ (clobber (reg:CC CC_REGNUM))] |
| 76 | ++ "TARGET_SOFT_TP" |
| 77 | ++ "bl\\t__aarch64_read_tp\\t// aarch64_load_tp_soft" |
| 78 | ++ [(set_attr "type" "branch")] |
| 79 | ++) |
| 80 | ++ |
| 81 | + ;; The TLS ABI specifically requires that the compiler does not schedule |
| 82 | + ;; instructions in the TLS stubs, in order to enable linker relaxation. |
| 83 | + ;; Therefore we treat the stubs as an atomic sequence. |
| 84 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.opt gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.opt |
| 85 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64.opt 2018-01-13 17:50:35.000000000 +0000 |
| 86 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.opt 2018-05-08 11:09:01.255467862 +0100 |
| 87 | +@@ -115,6 +115,20 @@ |
| 88 | + EnumValue |
| 89 | + Enum(aarch64_tls_size) String(48) Value(48) |
| 90 | + |
| 91 | ++mtp= |
| 92 | ++Target RejectNegative Joined Enum(aarch64_tp_type) Var(target_thread_pointer) Init(TP_HARD) |
| 93 | ++Specify how to access the thread pointer. |
| 94 | ++ |
| 95 | ++Enum |
| 96 | ++Name(aarch64_tp_type) Type(enum aarch64_tp_type) |
| 97 | ++Valid arguments to -mtp=: |
| 98 | ++ |
| 99 | ++EnumValue |
| 100 | ++Enum(aarch64_tp_type) String(hard) Value(TP_HARD) |
| 101 | ++ |
| 102 | ++EnumValue |
| 103 | ++Enum(aarch64_tp_type) String(soft) Value(TP_SOFT) |
| 104 | ++ |
| 105 | + march= |
| 106 | + Target RejectNegative ToLower Joined Var(aarch64_arch_string) |
| 107 | + -march=ARCH Use features of architecture ARCH. |
| 108 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64-opts.h gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-opts.h |
| 109 | +--- gcc-8.1.0/gcc/config/aarch64/aarch64-opts.h 2018-01-13 17:50:35.000000000 +0000 |
| 110 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-opts.h 2018-05-08 11:09:01.255467862 +0100 |
| 111 | +@@ -48,6 +48,12 @@ |
| 112 | + TLS_DESCRIPTORS |
| 113 | + }; |
| 114 | + |
| 115 | ++/* Which thread pointer access sequence to use. */ |
| 116 | ++enum aarch64_tp_type { |
| 117 | ++ TP_HARD, |
| 118 | ++ TP_SOFT |
| 119 | ++}; |
| 120 | ++ |
| 121 | + /* The code model defines the address generation strategy. |
| 122 | + Most have a PIC and non-PIC variant. */ |
| 123 | + enum aarch64_code_model { |
| 124 | +diff -NBaur gcc-8.1.0/gcc/config/aarch64/t-aarch64 gcc-8.1.0-aarch64/gcc/config/aarch64/t-aarch64 |
| 125 | +--- gcc-8.1.0/gcc/config/aarch64/t-aarch64 2018-01-03 10:03:58.000000000 +0000 |
| 126 | ++++ gcc-8.1.0-aarch64/gcc/config/aarch64/t-aarch64 2018-05-08 11:09:01.255467862 +0100 |
| 127 | +@@ -68,5 +68,7 @@ |
| 128 | + $(srcdir)/config/aarch64/cortex-a57-fma-steering.c |
| 129 | + |
| 130 | + comma=, |
| 131 | +-MULTILIB_OPTIONS = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG)))) |
| 132 | +-MULTILIB_DIRNAMES = $(subst $(comma), ,$(TM_MULTILIB_CONFIG)) |
| 133 | ++MULTILIB_OPTIONS = mcmodel=large fPIC |
| 134 | ++MULTILIB_DIRNAMES = large pic |
| 135 | ++MULTILIB_REQUIRED = mcmodel=large fPIC |
| 136 | ++MULTILIB_MATCHES = fPIC=fpic fPIC=fpie fPIC=fPIE |
| 137 | +diff -NBaur gcc-8.1.0/gcc/gcc.c gcc-8.1.0-aarch64/gcc/gcc.c |
| 138 | +--- gcc-8.1.0/gcc/gcc.c 2018-02-09 06:44:06.000000000 +0000 |
| 139 | ++++ gcc-8.1.0-aarch64/gcc/gcc.c 2018-05-08 11:09:01.259467885 +0100 |
| 140 | +@@ -786,6 +786,11 @@ |
| 141 | + #endif |
| 142 | + #endif |
| 143 | + |
| 144 | ++#ifndef LIBGLOSS_SPEC |
| 145 | ++# define LIBGLOSS_SPEC "-lsysbase" |
| 146 | ++#endif |
| 147 | ++ |
| 148 | ++ |
| 149 | + /* config.h can define STARTFILE_SPEC to override the default crt0 files. */ |
| 150 | + #ifndef STARTFILE_SPEC |
| 151 | + #define STARTFILE_SPEC \ |
| 152 | +@@ -1081,6 +1086,7 @@ |
| 153 | + static const char *lib_spec = LIB_SPEC; |
| 154 | + static const char *link_gomp_spec = ""; |
| 155 | + static const char *libgcc_spec = LIBGCC_SPEC; |
| 156 | ++static const char *libgloss_spec = LIBGLOSS_SPEC; |
| 157 | + static const char *endfile_spec = ENDFILE_SPEC; |
| 158 | + static const char *startfile_spec = STARTFILE_SPEC; |
| 159 | + static const char *linker_name_spec = LINKER_NAME; |
| 160 | +@@ -1577,6 +1583,7 @@ |
| 161 | + INIT_STATIC_SPEC ("lib", &lib_spec), |
| 162 | + INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec), |
| 163 | + INIT_STATIC_SPEC ("libgcc", &libgcc_spec), |
| 164 | ++ INIT_STATIC_SPEC ("libgloss", &libgloss_spec), |
| 165 | + INIT_STATIC_SPEC ("startfile", &startfile_spec), |
| 166 | + INIT_STATIC_SPEC ("cross_compile", &cross_compile), |
| 167 | + INIT_STATIC_SPEC ("version", &compiler_version), |
| 168 | +diff -NBaur gcc-8.1.0/libgcc/crtstuff.c gcc-8.1.0-aarch64/libgcc/crtstuff.c |
| 169 | +--- gcc-8.1.0/libgcc/crtstuff.c 2018-01-03 10:03:58.000000000 +0000 |
| 170 | ++++ gcc-8.1.0-aarch64/libgcc/crtstuff.c 2018-05-08 11:09:01.259467885 +0100 |
| 171 | +@@ -47,6 +47,7 @@ |
| 172 | + |
| 173 | + /* Target machine header files require this define. */ |
| 174 | + #define IN_LIBGCC2 |
| 175 | ++#define USED_FOR_TARGET |
| 176 | + |
| 177 | + /* FIXME: Including auto-host is incorrect, but until we have |
| 178 | + identified the set of defines that need to go into auto-target.h, |
| 179 | +diff -NBaur gcc-8.1.0/libgcc/Makefile.in gcc-8.1.0-aarch64/libgcc/Makefile.in |
| 180 | +--- gcc-8.1.0/libgcc/Makefile.in 2018-01-03 10:03:58.000000000 +0000 |
| 181 | ++++ gcc-8.1.0-aarch64/libgcc/Makefile.in 2018-05-08 11:09:01.259467885 +0100 |
| 182 | +@@ -847,7 +847,7 @@ |
| 183 | + # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and |
| 184 | + # LIB2ADDEHSHARED matter. (Usually all three are identical.) |
| 185 | + |
| 186 | +-c_flags := -fexceptions |
| 187 | ++c_flags := -fno-exceptions |
| 188 | + |
| 189 | + ifeq ($(enable_shared),yes) |
| 190 | + |
0 commit comments