From b10d1e133f9eaac0158d7307bef5d9e6e442e89d Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 19 Feb 2019 14:10:12 +0000 Subject: [PATCH] remove stale patches --- dka64/patches/binutils-2.30.patch | 346 -------------------------- dka64/patches/gcc-8.1.0.patch | 190 --------------- dkarm-eabi/patches/gdb-8.2.patch | 389 ------------------------------ 3 files changed, 925 deletions(-) delete mode 100644 dka64/patches/binutils-2.30.patch delete mode 100644 dka64/patches/gcc-8.1.0.patch delete mode 100644 dkarm-eabi/patches/gdb-8.2.patch diff --git a/dka64/patches/binutils-2.30.patch b/dka64/patches/binutils-2.30.patch deleted file mode 100644 index 4dcc61f..0000000 --- a/dka64/patches/binutils-2.30.patch +++ /dev/null @@ -1,346 +0,0 @@ -diff -NBaur binutils-2.30/bfd/elfnn-aarch64.c binutils-2.30-dka64/bfd/elfnn-aarch64.c ---- binutils-2.30/bfd/elfnn-aarch64.c 2018-01-17 11:29:21.000000000 +0000 -+++ binutils-2.30-dka64/bfd/elfnn-aarch64.c 2018-02-11 19:54:08.141257544 +0000 -@@ -2097,6 +2097,12 @@ - aarch64_stub_erratum_843419_veneer, - }; - -+/* Is an undefined weak symbol resolved to 0 ? */ -+#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, EH) \ -+ ((EH)->root.root.type == bfd_link_hash_undefweak \ -+ && bfd_link_executable (INFO) \ -+ && !(INFO)->dynamic_undefined_weak) -+ - struct elf_aarch64_stub_hash_entry - { - /* Base hash table entry structure. */ -@@ -6088,11 +6094,13 @@ - Elf_Internal_Sym *sym; - asection *sec; - struct elf_link_hash_entry *h; -+ struct elf_aarch64_link_hash_entry *eh; - bfd_vma relocation; - bfd_reloc_status_type r; - arelent bfd_reloc; - char sym_type; - bfd_boolean unresolved_reloc = FALSE; -+ bfd_boolean resolved_to_zero = FALSE; - char *error_message = NULL; - - r_symndx = ELFNN_R_SYM (rel->r_info); -@@ -6226,6 +6234,10 @@ - h, &unresolved_reloc, - save_addend, &addend, sym); - -+ eh = (struct elf_aarch64_link_hash_entry *) h; -+ resolved_to_zero = (eh != NULL -+ && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh)); -+ - switch (elfNN_aarch64_bfd_reloc_from_type (r_type)) - { - case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: -@@ -6249,7 +6261,7 @@ - need_relocs = - (!bfd_link_executable (info) || indx != 0) && - (h == NULL -- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak); - - BFD_ASSERT (globals->root.srelgot != NULL); -@@ -6344,7 +6356,7 @@ - need_relocs = - (!bfd_link_executable (info) || indx != 0) && - (h == NULL -- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak); - - BFD_ASSERT (globals->root.srelgot != NULL); -@@ -6393,7 +6405,7 @@ - bfd_vma off = symbol_tlsdesc_got_offset (input_bfd, h, r_symndx); - - need_relocs = (h == NULL -- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak); - - BFD_ASSERT (globals->root.srelgot != NULL); -@@ -6735,6 +6747,26 @@ - return FALSE; - } - -+/* Remove undefined weak symbol from the dynamic symbol table if it -+ is resolved to 0. */ -+ -+extern bfd_boolean -+elfNN_aarch64_elf_fixup_symbol (struct bfd_link_info *, struct elf_link_hash_entry *); -+ -+bfd_boolean -+elfNN_aarch64_elf_fixup_symbol (struct bfd_link_info *info, -+ struct elf_link_hash_entry *h) -+{ -+ if (h->dynindx != -1 -+ && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, elf_aarch64_hash_entry (h))) -+ { -+ h->dynindx = -1; -+ _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, -+ h->dynstr_index); -+ } -+ return TRUE; -+} -+ - /* Adjust a symbol defined by a dynamic object and referenced by a - regular object. The current definition is in some section of the - dynamic object, but we're not including those sections. We have to -@@ -7928,6 +7960,7 @@ - struct elf_aarch64_link_hash_table *htab; - struct elf_aarch64_link_hash_entry *eh; - struct elf_dyn_relocs *p; -+ bfd_boolean resolved_to_zero; - - /* An example of a bfd_link_hash_indirect symbol is versioned - symbol. For example: __gxx_personality_v0(bfd_link_hash_indirect) -@@ -7947,6 +7980,10 @@ - info = (struct bfd_link_info *) inf; - htab = elf_aarch64_hash_table (info); - -+ eh = (struct elf_aarch64_link_hash_entry *) h; -+ eh->tlsdesc_got_jump_table_offset = (bfd_vma) - 1; -+ resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); -+ - /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it - here if it is defined and referenced in a non-shared object. */ - if (h->type == STT_GNU_IFUNC -@@ -7956,7 +7993,7 @@ - { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ -- if (h->dynindx == -1 && !h->forced_local -+ if (h->dynindx == -1 && !h->forced_local && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak) - { - if (!bfd_elf_link_record_dynamic_symbol (info, h)) -@@ -7990,6 +8027,11 @@ - of relaxing into these from the large model PLT entries. */ - s->size += PLT_SMALL_ENTRY_SIZE; - -+ /* There should be no PLT relocations against resolved undefined -+ weak symbols in the executable. */ -+ if (!resolved_to_zero) -+ { -+ - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - htab->root.sgotplt->size += GOT_ENTRY_SIZE; -@@ -8012,6 +8054,7 @@ - - htab->root.srelplt->reloc_count++; - } -+ } - else - { - h->plt.offset = (bfd_vma) - 1; -@@ -8024,9 +8067,6 @@ - h->needs_plt = 0; - } - -- eh = (struct elf_aarch64_link_hash_entry *) h; -- eh->tlsdesc_got_jump_table_offset = (bfd_vma) - 1; -- - if (h->got.refcount > 0) - { - bfd_boolean dyn; -@@ -8038,7 +8078,7 @@ - - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ -- if (dyn && h->dynindx == -1 && !h->forced_local -+ if (dyn && h->dynindx == -1 && !h->forced_local && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak) - { - if (!bfd_elf_link_record_dynamic_symbol (info, h)) -@@ -8052,7 +8092,7 @@ - { - h->got.offset = htab->root.sgot->size; - htab->root.sgot->size += GOT_ENTRY_SIZE; -- if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ if (((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak) - && (bfd_link_pic (info) - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) -@@ -8088,7 +8128,7 @@ - } - - indx = h && h->dynindx != -1 ? h->dynindx : 0; -- if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ if (((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak) - && (!bfd_link_executable (info) - || indx != 0 -@@ -8154,7 +8194,7 @@ - visibility. */ - if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak) - { -- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT -+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT || resolved_to_zero - || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) - eh->dyn_relocs = NULL; - -@@ -8174,7 +8214,9 @@ - symbols which turn out to need copy relocs or are not - dynamic. */ - -- if (!h->non_got_ref -+ if (!(h->non_got_ref -+ || (h->root.type == bfd_link_hash_undefweak -+ && !resolved_to_zero)) - && ((h->def_dynamic - && !h->def_regular) - || (htab->root.dynamic_sections_created -@@ -8185,6 +8227,7 @@ - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local -+ && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak - && !bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; -@@ -8805,8 +8848,17 @@ - Elf_Internal_Sym *sym) - { - struct elf_aarch64_link_hash_table *htab; -+ struct elf_aarch64_link_hash_entry *eh; -+ bfd_boolean local_undefweak; - htab = elf_aarch64_hash_table (info); - -+ eh = (struct elf_aarch64_link_hash_entry *) h; -+ -+ /* We keep PLT/GOT entries without dynamic PLT/GOT relocations for -+ resolved undefined weak symbols in executable so that their -+ references have value 0 at run-time. */ -+ local_undefweak = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); -+ - if (h->plt.offset != (bfd_vma) - 1) - { - asection *plt, *gotplt, *relplt; -@@ -8841,7 +8893,7 @@ - return FALSE; - - elfNN_aarch64_create_small_pltn_entry (h, htab, output_bfd, info); -- if (!h->def_regular) -+ if (!local_undefweak && !h->def_regular) - { - /* Mark the symbol as undefined, rather than as defined in - the .plt section. */ -@@ -8860,10 +8912,11 @@ - } - - if (h->got.offset != (bfd_vma) - 1 -- && elf_aarch64_hash_entry (h)->got_type == GOT_NORMAL -+ && elf_aarch64_hash_entry (h)->got_type == GOT_NORMAL - /* Undefined weak symbol in static PIE resolves to 0 without - any dynamic relocations. */ -- && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) -+ && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h) -+ && !local_undefweak) - { - Elf_Internal_Rela rela; - bfd_byte *loc; -@@ -9357,6 +9410,9 @@ - #define elf_backend_init_index_section \ - _bfd_elf_init_2_index_sections - -+#define elf_backend_fixup_symbol \ -+ elfNN_aarch64_elf_fixup_symbol -+ - #define elf_backend_finish_dynamic_sections \ - elfNN_aarch64_finish_dynamic_sections - -diff -NBaur binutils-2.30/ld/emulparams/aarch64elf32.sh binutils-2.30-dka64/ld/emulparams/aarch64elf32.sh ---- binutils-2.30/ld/emulparams/aarch64elf32.sh 2018-01-13 13:31:16.000000000 +0000 -+++ binutils-2.30-dka64/ld/emulparams/aarch64elf32.sh 2018-02-11 19:48:08.997273556 +0000 -@@ -1,3 +1,5 @@ -+. ${srcdir}/emulparams/dynamic_undefined_weak.sh -+ - ARCH="aarch64:ilp32" - MACHINE= - NOP=0 -diff -NBaur binutils-2.30/ld/emulparams/aarch64elf.sh binutils-2.30-dka64/ld/emulparams/aarch64elf.sh ---- binutils-2.30/ld/emulparams/aarch64elf.sh 2018-01-13 13:31:16.000000000 +0000 -+++ binutils-2.30-dka64/ld/emulparams/aarch64elf.sh 2018-02-11 19:48:09.009273555 +0000 -@@ -1,3 +1,5 @@ -+. ${srcdir}/emulparams/dynamic_undefined_weak.sh -+ - ARCH=aarch64 - MACHINE= - NOP=0 -diff -NBaur binutils-2.30/ld/emultempl/aarch64elf.em binutils-2.30-dka64/ld/emultempl/aarch64elf.em ---- binutils-2.30/ld/emultempl/aarch64elf.em 2018-01-13 13:31:16.000000000 +0000 -+++ binutils-2.30-dka64/ld/emultempl/aarch64elf.em 2018-02-11 19:48:09.009273555 +0000 -@@ -378,7 +378,7 @@ - { "no-apply-dynamic-relocs", no_argument, NULL, OPTION_NO_APPLY_DYNAMIC_RELOCS}, - ' - --PARSE_AND_LIST_OPTIONS=' -+PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_OPTIONS}' - fprintf (file, _(" --no-enum-size-warning Don'\''t warn about objects with incompatible\n" - " enum sizes\n")); - fprintf (file, _(" --no-wchar-size-warning Don'\''t warn about objects with incompatible" -diff -NBaur binutils-2.30/ld/Makefile.am binutils-2.30-dka64/ld/Makefile.am ---- binutils-2.30/ld/Makefile.am 2018-01-13 13:31:16.000000000 +0000 -+++ binutils-2.30-dka64/ld/Makefile.am 2018-02-11 19:48:09.021273555 +0000 -@@ -1654,19 +1654,23 @@ - $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} - - eaarch64elf.c: $(srcdir)/emulparams/aarch64elf.sh \ -- $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em ldemul-list.h \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elf32.c: $(srcdir)/emulparams/aarch64elf32.sh \ -- $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em ldemul-list.h \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elfb.c: $(srcdir)/emulparams/aarch64elfb.sh $(srcdir)/emulparams/aarch64elf.sh \ -- $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em ldemul-list.h \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elf32b.c: $(srcdir)/emulparams/aarch64elf32b.sh $(srcdir)/emulparams/aarch64elf32.sh \ -- $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em ldemul-list.h \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64cloudabi.c: $(srcdir)/emulparams/aarch64cloudabi.sh \ -diff -NBaur binutils-2.30/ld/Makefile.in binutils-2.30-dka64/ld/Makefile.in ---- binutils-2.30/ld/Makefile.in 2018-01-27 15:03:10.000000000 +0000 -+++ binutils-2.30-dka64/ld/Makefile.in 2018-02-11 19:48:09.037273554 +0000 -@@ -3219,18 +3219,22 @@ - - eaarch64elf.c: $(srcdir)/emulparams/aarch64elf.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elf32.c: $(srcdir)/emulparams/aarch64elf32.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elfb.c: $(srcdir)/emulparams/aarch64elfb.sh $(srcdir)/emulparams/aarch64elf.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64elf32b.c: $(srcdir)/emulparams/aarch64elf32b.sh $(srcdir)/emulparams/aarch64elf32.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/emulparams/dynamic_undefined_weak.sh \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - - eaarch64cloudabi.c: $(srcdir)/emulparams/aarch64cloudabi.sh \ diff --git a/dka64/patches/gcc-8.1.0.patch b/dka64/patches/gcc-8.1.0.patch deleted file mode 100644 index 318ebac..0000000 --- a/dka64/patches/gcc-8.1.0.patch +++ /dev/null @@ -1,190 +0,0 @@ -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) - diff --git a/dkarm-eabi/patches/gdb-8.2.patch b/dkarm-eabi/patches/gdb-8.2.patch deleted file mode 100644 index 3b0dbe9..0000000 --- a/dkarm-eabi/patches/gdb-8.2.patch +++ /dev/null @@ -1,389 +0,0 @@ -diff -NBaur gdb-8.2/gdb/arm-3ds-tdep.c gdb-8.2-3ds/gdb/arm-3ds-tdep.c ---- gdb-8.2/gdb/arm-3ds-tdep.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-8.2-3ds/gdb/arm-3ds-tdep.c 2018-11-15 22:55:21.916968907 +0000 -@@ -0,0 +1,157 @@ -+/* Target-dependent code for 3DS. */ -+ -+/* This uses code from GDB, which license is: */ -+ -+/* -+ Copyright (C) 2002-2017 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include "defs.h" -+#include "gdbcore.h" -+#include "target.h" -+#include "osabi.h" -+#include "xml-syscall.h" -+ -+#include "arch/arm.h" -+#include "arch/arm-get-next-pcs.h" -+#include "arm-tdep.h" -+ -+static const gdb_byte arm_3ds_arm_le_breakpoint[] = {0xff, 0x00, 0x00, 0xef}; -+static const gdb_byte arm_3ds_thumb_le_breakpoint[] = {0xff, 0xdf}; -+ -+static CORE_ADDR -+ arm_3ds_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self); -+ -+/* Operation function pointers for get_next_pcs. */ -+static struct arm_get_next_pcs_ops arm_3ds_get_next_pcs_ops = { -+ arm_get_next_pcs_read_memory_unsigned_integer, -+ arm_3ds_get_next_pcs_syscall_next_pc, -+ arm_get_next_pcs_addr_bits_remove, -+ arm_get_next_pcs_is_thumb, -+ NULL, -+}; -+ -+static CORE_ADDR -+arm_3ds_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self) -+{ -+ CORE_ADDR next_pc = 0; -+ CORE_ADDR pc = regcache_read_pc (self->regcache); -+ int is_thumb = arm_is_thumb (self->regcache); -+ ULONGEST svc_number = 0; -+ -+ if (is_thumb) -+ { -+ next_pc = pc + 2; -+ } -+ else -+ { -+ next_pc = pc + 4; -+ } -+ -+ /* Addresses for calling Thumb functions have the bit 0 set. */ -+ if (is_thumb) -+ next_pc = MAKE_THUMB_ADDR (next_pc); -+ -+ return next_pc; -+} -+ -+static LONGEST -+arm_3ds_get_syscall_number (struct gdbarch *gdbarch, -+ thread_info *thread) -+{ -+ struct regcache *regs = get_thread_regcache (thread); -+ -+ ULONGEST pc; -+ ULONGEST cpsr; -+ ULONGEST t_bit = arm_psr_thumb_bit (gdbarch); -+ int is_thumb; -+ ULONGEST svc_number = -1; -+ -+ regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc); -+ regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr); -+ is_thumb = (cpsr & t_bit) != 0; -+ -+ if (is_thumb) -+ { -+ enum bfd_endian byte_order_for_code = -+ gdbarch_byte_order_for_code (gdbarch); -+ -+ /* PC gets incremented before the syscall-stop, so read the -+ previous instruction. */ -+ unsigned long this_instr = -+ read_memory_unsigned_integer (pc - 2, 2, byte_order_for_code); -+ -+ unsigned long svc_operand = (0x00ff & this_instr); -+ svc_number = svc_operand; -+ } -+ else -+ { -+ enum bfd_endian byte_order_for_code = -+ gdbarch_byte_order_for_code (gdbarch); -+ -+ /* PC gets incremented before the syscall-stop, so read the -+ previous instruction. */ -+ unsigned long this_instr = -+ read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); -+ -+ unsigned long svc_operand = (0x000000ff & this_instr); -+ svc_number = svc_operand; -+ } -+ -+ if (svc_number == 0xfe) -+ { -+ regcache_cooked_read_unsigned (regs, 12, &svc_number); -+ } -+ -+ return svc_number; -+} -+ -+static void -+arm_3ds_init_abi (struct gdbarch_info info, -+ struct gdbarch *gdbarch) -+{ -+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ -+ switch (info.byte_order) -+ { -+ case BFD_ENDIAN_LITTLE: -+ tdep->arm_breakpoint = arm_3ds_arm_le_breakpoint; -+ tdep->thumb_breakpoint = arm_3ds_thumb_le_breakpoint; -+ tdep->arm_breakpoint_size = sizeof (arm_3ds_arm_le_breakpoint); -+ tdep->thumb_breakpoint_size = sizeof (arm_3ds_thumb_le_breakpoint); -+ break; -+ -+ default: -+ internal_error (__FILE__, __LINE__, -+ _("arm_gdbarch_init: bad byte order")); -+ } -+ tdep->fp_model = ARM_FLOAT_VFP; -+ -+ /* Single stepping. */ -+ set_gdbarch_software_single_step (gdbarch, arm_software_single_step); -+ -+ /* `catch syscall' */ -+ set_xml_syscall_file_name (gdbarch, "syscalls/arm-3ds.xml"); -+ set_gdbarch_get_syscall_number (gdbarch, arm_3ds_get_syscall_number); -+} -+ -+void -+_initialize_arm_3ds_tdep (void) -+{ -+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_3DS, -+ arm_3ds_init_abi); -+} -diff -NBaur gdb-8.2/gdb/configure.tgt gdb-8.2-3ds/gdb/configure.tgt ---- gdb-8.2/gdb/configure.tgt 2018-09-05 08:44:28.000000000 +0100 -+++ gdb-8.2-3ds/gdb/configure.tgt 2018-11-15 22:47:17.337689978 +0000 -@@ -61,7 +61,7 @@ - ;; - - arm*-*-*) -- cpu_obs="arch/arm.o arch/arm-get-next-pcs.o arm-tdep.o";; -+ cpu_obs="arch/arm.o arch/arm-get-next-pcs.o arm-tdep.o arm-3ds-tdep.o";; - - hppa*-*-*) - # Target: HP PA-RISC -diff -NBaur gdb-8.2/gdb/data-directory/Makefile.in gdb-8.2-3ds/gdb/data-directory/Makefile.in ---- gdb-8.2/gdb/data-directory/Makefile.in 2018-01-05 04:07:23.000000000 +0000 -+++ gdb-8.2-3ds/gdb/data-directory/Makefile.in 2018-11-15 22:42:36.840956065 +0000 -@@ -63,7 +63,7 @@ - sparc-linux.xml \ - sparc64-linux.xml - --SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml $(GEN_SYSCALLS_FILES) -+SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml arm-3ds.xml $(GEN_SYSCALLS_FILES) - - PYTHON_DIR = python - PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) -diff -NBaur gdb-8.2/gdb/defs.h gdb-8.2-3ds/gdb/defs.h ---- gdb-8.2/gdb/defs.h 2018-09-05 08:27:32.000000000 +0100 -+++ gdb-8.2-3ds/gdb/defs.h 2018-11-15 22:42:36.840956065 +0000 -@@ -495,6 +495,7 @@ - GDB_OSABI_LYNXOS178, - GDB_OSABI_NEWLIB, - GDB_OSABI_SDE, -+ GDB_OSABI_3DS, - - GDB_OSABI_INVALID /* keep this last */ - }; -diff -NBaur gdb-8.2/gdb/Makefile.in gdb-8.2-3ds/gdb/Makefile.in ---- gdb-8.2/gdb/Makefile.in 2018-09-05 08:44:28.000000000 +0100 -+++ gdb-8.2-3ds/gdb/Makefile.in 2018-11-15 22:45:01.628931262 +0000 -@@ -684,6 +684,7 @@ - arch/arm-linux.o \ - arch/i386.o \ - arch/ppc-linux-common.o \ -+ arm-3ds-tdep.o \ - arm-bsd-tdep.o \ - arm-fbsd-tdep.o \ - arm-linux-tdep.o \ -@@ -2213,6 +2214,7 @@ - amd64-tdep.c \ - arc-tdep.c \ - arm.c \ -+ arm-3ds-tdep.c \ - arm-bsd-tdep.c \ - arm-fbsd-nat.c \ - arm-fbsd-tdep.c \ -diff -NBaur gdb-8.2/gdb/osabi.c gdb-8.2-3ds/gdb/osabi.c ---- gdb-8.2/gdb/osabi.c 2018-09-05 08:27:13.000000000 +0100 -+++ gdb-8.2-3ds/gdb/osabi.c 2018-11-15 22:42:36.840956065 +0000 -@@ -80,6 +80,7 @@ - { "LynxOS178", NULL }, - { "Newlib", NULL }, - { "SDE", NULL }, -+ { "3DS", NULL }, - - { "", NULL } - }; -diff -NBaur gdb-8.2/gdb/syscalls/arm-3ds.xml gdb-8.2-3ds/gdb/syscalls/arm-3ds.xml ---- gdb-8.2/gdb/syscalls/arm-3ds.xml 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-8.2-3ds/gdb/syscalls/arm-3ds.xml 2018-11-15 22:42:36.840956065 +0000 -@@ -0,0 +1,159 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+