mirror of
https://github.com/devkitPro/buildscripts.git
synced 2026-04-25 15:41:31 -05:00
191 lines
7.4 KiB
Diff
191 lines
7.4 KiB
Diff
diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.c gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.c
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64.c 2018-03-15 08:55:04.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.c 2018-05-08 11:09:01.247467815 +0100
|
|
@@ -11963,8 +11963,24 @@
|
|
|| !register_operand (target, Pmode))
|
|
target = gen_reg_rtx (Pmode);
|
|
|
|
- /* Can return in any reg. */
|
|
- emit_insn (gen_aarch64_load_tp_hard (target));
|
|
+ if (TARGET_HARD_TP)
|
|
+ {
|
|
+ /* Can return in any reg. */
|
|
+ emit_insn (gen_aarch64_load_tp_hard (target));
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ /* Always returned in r0. Immediately copy the result into a pseudo,
|
|
+ otherwise other uses of r0 (e.g. setting up function arguments) may
|
|
+ clobber the value. */
|
|
+
|
|
+ rtx tmp;
|
|
+
|
|
+ emit_insn (gen_aarch64_load_tp_soft ());
|
|
+
|
|
+ tmp = gen_rtx_REG (DImode, R0_REGNUM);
|
|
+ emit_move_insn (target, tmp);
|
|
+ }
|
|
return target;
|
|
}
|
|
|
|
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
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64-elf-raw.h 2018-01-03 10:03:58.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-elf-raw.h 2018-05-08 11:09:01.247467815 +0100
|
|
@@ -22,6 +22,7 @@
|
|
#ifndef GCC_AARCH64_ELF_RAW_H
|
|
#define GCC_AARCH64_ELF_RAW_H
|
|
|
|
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
|
|
#define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
|
|
#define ENDFILE_SPEC \
|
|
" crtend%O%s crtn%O%s " \
|
|
diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.h gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.h
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64.h 2018-02-21 14:05:45.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.h 2018-05-08 11:09:01.255467862 +0100
|
|
@@ -957,6 +957,10 @@
|
|
/* Check TLS Descriptors mechanism is selected. */
|
|
#define TARGET_TLS_DESC (aarch64_tls_dialect == TLS_DESCRIPTORS)
|
|
|
|
+/* Check selected thread pointer access sequence to use. */
|
|
+#define TARGET_HARD_TP (target_thread_pointer == TP_HARD)
|
|
+#define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT)
|
|
+
|
|
extern enum aarch64_code_model aarch64_cmodel;
|
|
|
|
/* When using the tiny addressing model conditional and unconditional branches
|
|
diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.md gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.md
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64.md 2018-04-24 17:58:49.000000000 +0100
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.md 2018-05-08 11:09:01.255467862 +0100
|
|
@@ -5693,11 +5693,22 @@
|
|
(define_insn "aarch64_load_tp_hard"
|
|
[(set (match_operand:DI 0 "register_operand" "=r")
|
|
(unspec:DI [(const_int 0)] UNSPEC_TLS))]
|
|
- ""
|
|
- "mrs\\t%0, tpidr_el0"
|
|
+ "TARGET_HARD_TP"
|
|
+ "mrs\\t%0, tpidr_el0\\t// aarch64_load_tp_hard"
|
|
[(set_attr "type" "mrs")]
|
|
)
|
|
|
|
+(define_insn "aarch64_load_tp_soft"
|
|
+ [(set (reg:DI 0) (unspec:DI [(const_int 0)] UNSPEC_TLS))
|
|
+ (clobber (reg:DI IP0_REGNUM))
|
|
+ (clobber (reg:DI IP1_REGNUM))
|
|
+ (clobber (reg:DI LR_REGNUM))
|
|
+ (clobber (reg:CC CC_REGNUM))]
|
|
+ "TARGET_SOFT_TP"
|
|
+ "bl\\t__aarch64_read_tp\\t// aarch64_load_tp_soft"
|
|
+ [(set_attr "type" "branch")]
|
|
+)
|
|
+
|
|
;; The TLS ABI specifically requires that the compiler does not schedule
|
|
;; instructions in the TLS stubs, in order to enable linker relaxation.
|
|
;; Therefore we treat the stubs as an atomic sequence.
|
|
diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64.opt gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.opt
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64.opt 2018-01-13 17:50:35.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64.opt 2018-05-08 11:09:01.255467862 +0100
|
|
@@ -115,6 +115,20 @@
|
|
EnumValue
|
|
Enum(aarch64_tls_size) String(48) Value(48)
|
|
|
|
+mtp=
|
|
+Target RejectNegative Joined Enum(aarch64_tp_type) Var(target_thread_pointer) Init(TP_HARD)
|
|
+Specify how to access the thread pointer.
|
|
+
|
|
+Enum
|
|
+Name(aarch64_tp_type) Type(enum aarch64_tp_type)
|
|
+Valid arguments to -mtp=:
|
|
+
|
|
+EnumValue
|
|
+Enum(aarch64_tp_type) String(hard) Value(TP_HARD)
|
|
+
|
|
+EnumValue
|
|
+Enum(aarch64_tp_type) String(soft) Value(TP_SOFT)
|
|
+
|
|
march=
|
|
Target RejectNegative ToLower Joined Var(aarch64_arch_string)
|
|
-march=ARCH Use features of architecture ARCH.
|
|
diff -NBaur gcc-8.1.0/gcc/config/aarch64/aarch64-opts.h gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-opts.h
|
|
--- gcc-8.1.0/gcc/config/aarch64/aarch64-opts.h 2018-01-13 17:50:35.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/aarch64-opts.h 2018-05-08 11:09:01.255467862 +0100
|
|
@@ -48,6 +48,12 @@
|
|
TLS_DESCRIPTORS
|
|
};
|
|
|
|
+/* Which thread pointer access sequence to use. */
|
|
+enum aarch64_tp_type {
|
|
+ TP_HARD,
|
|
+ TP_SOFT
|
|
+};
|
|
+
|
|
/* The code model defines the address generation strategy.
|
|
Most have a PIC and non-PIC variant. */
|
|
enum aarch64_code_model {
|
|
diff -NBaur gcc-8.1.0/gcc/config/aarch64/t-aarch64 gcc-8.1.0-aarch64/gcc/config/aarch64/t-aarch64
|
|
--- gcc-8.1.0/gcc/config/aarch64/t-aarch64 2018-01-03 10:03:58.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/config/aarch64/t-aarch64 2018-05-08 11:09:01.255467862 +0100
|
|
@@ -68,5 +68,7 @@
|
|
$(srcdir)/config/aarch64/cortex-a57-fma-steering.c
|
|
|
|
comma=,
|
|
-MULTILIB_OPTIONS = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG))))
|
|
-MULTILIB_DIRNAMES = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
|
|
+MULTILIB_OPTIONS = mcmodel=large fPIC
|
|
+MULTILIB_DIRNAMES = large pic
|
|
+MULTILIB_REQUIRED = mcmodel=large fPIC
|
|
+MULTILIB_MATCHES = fPIC=fpic fPIC=fpie fPIC=fPIE
|
|
diff -NBaur gcc-8.1.0/gcc/gcc.c gcc-8.1.0-aarch64/gcc/gcc.c
|
|
--- gcc-8.1.0/gcc/gcc.c 2018-02-09 06:44:06.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/gcc/gcc.c 2018-05-08 11:09:01.259467885 +0100
|
|
@@ -786,6 +786,11 @@
|
|
#endif
|
|
#endif
|
|
|
|
+#ifndef LIBGLOSS_SPEC
|
|
+# define LIBGLOSS_SPEC "-lsysbase"
|
|
+#endif
|
|
+
|
|
+
|
|
/* config.h can define STARTFILE_SPEC to override the default crt0 files. */
|
|
#ifndef STARTFILE_SPEC
|
|
#define STARTFILE_SPEC \
|
|
@@ -1081,6 +1086,7 @@
|
|
static const char *lib_spec = LIB_SPEC;
|
|
static const char *link_gomp_spec = "";
|
|
static const char *libgcc_spec = LIBGCC_SPEC;
|
|
+static const char *libgloss_spec = LIBGLOSS_SPEC;
|
|
static const char *endfile_spec = ENDFILE_SPEC;
|
|
static const char *startfile_spec = STARTFILE_SPEC;
|
|
static const char *linker_name_spec = LINKER_NAME;
|
|
@@ -1577,6 +1583,7 @@
|
|
INIT_STATIC_SPEC ("lib", &lib_spec),
|
|
INIT_STATIC_SPEC ("link_gomp", &link_gomp_spec),
|
|
INIT_STATIC_SPEC ("libgcc", &libgcc_spec),
|
|
+ INIT_STATIC_SPEC ("libgloss", &libgloss_spec),
|
|
INIT_STATIC_SPEC ("startfile", &startfile_spec),
|
|
INIT_STATIC_SPEC ("cross_compile", &cross_compile),
|
|
INIT_STATIC_SPEC ("version", &compiler_version),
|
|
diff -NBaur gcc-8.1.0/libgcc/crtstuff.c gcc-8.1.0-aarch64/libgcc/crtstuff.c
|
|
--- gcc-8.1.0/libgcc/crtstuff.c 2018-01-03 10:03:58.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/libgcc/crtstuff.c 2018-05-08 11:09:01.259467885 +0100
|
|
@@ -47,6 +47,7 @@
|
|
|
|
/* Target machine header files require this define. */
|
|
#define IN_LIBGCC2
|
|
+#define USED_FOR_TARGET
|
|
|
|
/* FIXME: Including auto-host is incorrect, but until we have
|
|
identified the set of defines that need to go into auto-target.h,
|
|
diff -NBaur gcc-8.1.0/libgcc/Makefile.in gcc-8.1.0-aarch64/libgcc/Makefile.in
|
|
--- gcc-8.1.0/libgcc/Makefile.in 2018-01-03 10:03:58.000000000 +0000
|
|
+++ gcc-8.1.0-aarch64/libgcc/Makefile.in 2018-05-08 11:09:01.259467885 +0100
|
|
@@ -847,7 +847,7 @@
|
|
# libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
|
|
# LIB2ADDEHSHARED matter. (Usually all three are identical.)
|
|
|
|
-c_flags := -fexceptions
|
|
+c_flags := -fno-exceptions
|
|
|
|
ifeq ($(enable_shared),yes)
|
|
|