remove stale patches

This commit is contained in:
Dave Murphy 2018-05-11 19:21:33 +01:00
parent 0f779b9c71
commit af5014409c
6 changed files with 0 additions and 1295 deletions

View File

@ -1,342 +0,0 @@
diff -Nbaur binutils-2.29.1-orig/bfd/elfnn-aarch64.c binutils-2.29.1-dka64/bfd/elfnn-aarch64.c
--- binutils-2.29.1-orig/bfd/elfnn-aarch64.c 2017-09-05 14:12:46.000000000 +0100
+++ binutils-2.29.1-dka64/bfd/elfnn-aarch64.c 2017-10-22 06:58:57.711591457 +0100
@@ -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. */
@@ -6081,11 +6087,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);
@@ -6225,6 +6233,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:
@@ -6248,7 +6260,7 @@
need_relocs =
(bfd_link_pic (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);
@@ -6343,7 +6355,7 @@
need_relocs =
(bfd_link_pic (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);
@@ -6392,7 +6404,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);
@@ -6891,6 +6903,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
@@ -8068,6 +8100,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)
@@ -8087,6 +8120,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
@@ -8096,7 +8133,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))
@@ -8130,6 +8167,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;
@@ -8152,6 +8194,7 @@
htab->root.srelplt->reloc_count++;
}
+ }
else
{
h->plt.offset = (bfd_vma) - 1;
@@ -8164,9 +8207,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;
@@ -8178,7 +8218,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))
@@ -8192,7 +8232,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)))
@@ -8225,7 +8265,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_pic (info)
|| indx != 0
@@ -8291,7 +8331,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)
eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
@@ -8310,7 +8350,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
@@ -8321,6 +8363,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;
@@ -8940,8 +8983,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;
@@ -8976,7 +9028,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. */
@@ -8995,7 +9047,8 @@
}
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
+ && !local_undefweak)
{
Elf_Internal_Rela rela;
bfd_byte *loc;
@@ -9489,6 +9542,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.29.1-orig/ld/emulparams/aarch64elf32.sh binutils-2.29.1-dka64/ld/emulparams/aarch64elf32.sh
--- binutils-2.29.1-orig/ld/emulparams/aarch64elf32.sh 2017-07-10 10:54:42.000000000 +0100
+++ binutils-2.29.1-dka64/ld/emulparams/aarch64elf32.sh 2017-10-22 06:58:57.719591510 +0100
@@ -1,3 +1,5 @@
+. ${srcdir}/emulparams/dynamic_undefined_weak.sh
+
ARCH="aarch64:ilp32"
MACHINE=
NOP=0
diff -Nbaur binutils-2.29.1-orig/ld/emulparams/aarch64elf.sh binutils-2.29.1-dka64/ld/emulparams/aarch64elf.sh
--- binutils-2.29.1-orig/ld/emulparams/aarch64elf.sh 2017-07-10 10:54:42.000000000 +0100
+++ binutils-2.29.1-dka64/ld/emulparams/aarch64elf.sh 2017-10-22 06:58:57.719591510 +0100
@@ -1,3 +1,5 @@
+. ${srcdir}/emulparams/dynamic_undefined_weak.sh
+
ARCH=aarch64
MACHINE=
NOP=0
diff -Nbaur binutils-2.29.1-orig/ld/emultempl/aarch64elf.em binutils-2.29.1-dka64/ld/emultempl/aarch64elf.em
--- binutils-2.29.1-orig/ld/emultempl/aarch64elf.em 2017-07-10 10:54:42.000000000 +0100
+++ binutils-2.29.1-dka64/ld/emultempl/aarch64elf.em 2017-10-22 06:58:57.719591510 +0100
@@ -375,7 +375,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.29.1-orig/ld/Makefile.am binutils-2.29.1-dka64/ld/Makefile.am
--- binutils-2.29.1-orig/ld/Makefile.am 2017-07-10 10:54:42.000000000 +0100
+++ binutils-2.29.1-dka64/ld/Makefile.am 2017-10-22 06:58:57.719591510 +0100
@@ -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.29.1-orig/ld/Makefile.in binutils-2.29.1-dka64/ld/Makefile.in
--- binutils-2.29.1-orig/ld/Makefile.in 2017-09-15 12:38:08.000000000 +0100
+++ binutils-2.29.1-dka64/ld/Makefile.in 2017-10-22 06:58:57.719591510 +0100
@@ -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 \

View File

@ -1,190 +0,0 @@
diff -NBaur gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.c gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.c
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.c 2017-11-03 15:01:10.970890000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.c 2018-01-22 20:15:07.232099998 +0000
@@ -10009,8 +10009,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-7.3.0-RC-20180122/gcc/config/aarch64/aarch64-elf-raw.h gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64-elf-raw.h
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64-elf-raw.h 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64-elf-raw.h 2018-01-22 20:15:07.232099998 +0000
@@ -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-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.h gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.h
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.h 2017-09-21 13:16:31.171118000 +0100
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.h 2018-01-22 20:15:07.232099998 +0000
@@ -887,6 +887,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-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.md gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.md
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.md 2017-04-05 12:48:02.927619000 +0100
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.md 2018-01-22 20:15:07.236099934 +0000
@@ -5230,11 +5230,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-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.opt gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.opt
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64.opt 2017-03-17 17:05:23.131899000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64.opt 2018-01-22 20:15:07.236099934 +0000
@@ -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-7.3.0-RC-20180122/gcc/config/aarch64/aarch64-opts.h gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64-opts.h
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/aarch64-opts.h 2017-01-20 00:03:20.347898000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/aarch64-opts.h 2018-01-22 20:15:07.232099998 +0000
@@ -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-7.3.0-RC-20180122/gcc/config/aarch64/t-aarch64 gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/t-aarch64
--- gcc-7.3.0-RC-20180122/gcc/config/aarch64/t-aarch64 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/config/aarch64/t-aarch64 2018-01-22 20:15:07.236099934 +0000
@@ -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-7.3.0-RC-20180122/gcc/gcc.c gcc-7.3.0-RC-20180122-aarch64/gcc/gcc.c
--- gcc-7.3.0-RC-20180122/gcc/gcc.c 2017-09-15 09:18:34.015147000 +0100
+++ gcc-7.3.0-RC-20180122-aarch64/gcc/gcc.c 2018-01-22 20:15:07.236099934 +0000
@@ -779,6 +779,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 \
@@ -1074,6 +1079,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;
@@ -1579,6 +1585,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-7.3.0-RC-20180122/libgcc/crtstuff.c gcc-7.3.0-RC-20180122-aarch64/libgcc/crtstuff.c
--- gcc-7.3.0-RC-20180122/libgcc/crtstuff.c 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-RC-20180122-aarch64/libgcc/crtstuff.c 2018-01-22 20:15:07.236099934 +0000
@@ -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-7.3.0-RC-20180122/libgcc/Makefile.in gcc-7.3.0-RC-20180122-aarch64/libgcc/Makefile.in
--- gcc-7.3.0-RC-20180122/libgcc/Makefile.in 2017-04-19 09:08:44.446150000 +0100
+++ gcc-7.3.0-RC-20180122-aarch64/libgcc/Makefile.in 2018-01-22 20:15:07.236099934 +0000
@@ -844,7 +844,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)

View File

@ -1,125 +0,0 @@
diff -NBaur gcc-7.3.0/gcc/config/arm/t-arm-elf gcc-7.3.0-arm/gcc/config/arm/t-arm-elf
--- gcc-7.3.0/gcc/config/arm/t-arm-elf 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-arm/gcc/config/arm/t-arm-elf 2018-02-11 19:35:34.805307181 +0000
@@ -16,11 +16,19 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-MULTILIB_OPTIONS = marm/mthumb
-MULTILIB_DIRNAMES = arm thumb
+MULTILIB_OPTIONS = mthumb mbig-endian march=armv6k mfloat-abi=hard
+MULTILIB_DIRNAMES = thumb be armv6k fpu
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
+MULTILIB_REQUIRED = mthumb mbig-endian mthumb/mbig-endian march=armv6k/mfloat-abi=hard
+
+
+MULTILIB_MATCHES += march?armv6k=mtune?mpcore
+MULTILIB_MATCHES += march?armv6k=mcpu?mpcore
+
+
+
#MULTILIB_OPTIONS += mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
#MULTILIB_DIRNAMES += fa526 fa626 fa606te fa626te fmp626 fa726te
#MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=fa526 *mthumb*/*mcpu=fa626
@@ -38,9 +46,9 @@
# Not quite true. We can support hard-vfp calling in Thumb2, but how do we
# express that here? Also, we really need architecture v5e or later
# (mcrr etc).
-MULTILIB_OPTIONS += mfloat-abi=hard
-MULTILIB_DIRNAMES += fpu
-MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
+#MULTILIB_OPTIONS += mfloat-abi=hard
+#MULTILIB_DIRNAMES += fpu
+#MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
#MULTILIB_EXCEPTIONS += *mcpu=fa526/*mfloat-abi=hard*
#MULTILIB_EXCEPTIONS += *mcpu=fa626/*mfloat-abi=hard*
diff -NBaur gcc-7.3.0/gcc/config/arm/unknown-elf.h gcc-7.3.0-arm/gcc/config/arm/unknown-elf.h
--- gcc-7.3.0/gcc/config/arm/unknown-elf.h 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-arm/gcc/config/arm/unknown-elf.h 2018-02-11 19:35:34.805307181 +0000
@@ -29,7 +29,7 @@
#endif
/* Now we define the strings used to build the spec file. */
-#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
+#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -93,4 +93,9 @@
udivmoddi4, which will depend on the exception unwind routines,
which will depend on abort, which is defined in libc. */
#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group"
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L %(libgloss) --end-group"
+
+/* The system headers under devkitARM are C++-aware. */
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C
+
diff -NBaur gcc-7.3.0/gcc/gcc.c gcc-7.3.0-arm/gcc/gcc.c
--- gcc-7.3.0/gcc/gcc.c 2017-09-15 09:18:34.015147000 +0100
+++ gcc-7.3.0-arm/gcc/gcc.c 2018-02-11 19:35:34.805307181 +0000
@@ -779,6 +779,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 \
@@ -1074,6 +1079,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;
@@ -1579,6 +1585,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-7.3.0/libgcc/config/arm/t-bpabi gcc-7.3.0-arm/libgcc/config/arm/t-bpabi
--- gcc-7.3.0/libgcc/config/arm/t-bpabi 2012-08-17 16:06:06.447485000 +0100
+++ gcc-7.3.0-arm/libgcc/config/arm/t-bpabi 2018-02-11 19:35:34.809307181 +0000
@@ -17,4 +17,4 @@
# On ARM, specifying -fnon-call-exceptions will needlessly pull in
# the unwinder in simple programs which use 64-bit division. Omitting
# the option is safe.
-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions
diff -NBaur gcc-7.3.0/libgcc/crtstuff.c gcc-7.3.0-arm/libgcc/crtstuff.c
--- gcc-7.3.0/libgcc/crtstuff.c 2017-01-01 12:07:43.905435000 +0000
+++ gcc-7.3.0-arm/libgcc/crtstuff.c 2018-02-11 19:35:34.809307181 +0000
@@ -47,7 +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,
this will have to do. */
diff -NBaur gcc-7.3.0/libgcc/Makefile.in gcc-7.3.0-arm/libgcc/Makefile.in
--- gcc-7.3.0/libgcc/Makefile.in 2017-04-19 09:08:44.446150000 +0100
+++ gcc-7.3.0-arm/libgcc/Makefile.in 2018-02-11 19:35:34.809307181 +0000
@@ -844,7 +844,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)

View File

@ -1,12 +0,0 @@
diff -Nbaur binutils-2.27/opcodes/ppc-opc.c binutils-2.27-ppc/opcodes/ppc-opc.c
--- binutils-2.27/opcodes/ppc-opc.c 2016-08-03 08:36:54.000000000 +0100
+++ binutils-2.27-ppc/opcodes/ppc-opc.c 2016-11-08 21:37:45.360000000 +0000
@@ -3037,7 +3037,7 @@
#define MFDEC1 PPC_OPCODE_POWER
#define MFDEC2 PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE | PPC_OPCODE_TITAN
#define BOOKE PPC_OPCODE_BOOKE
-#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_PPCPS | PPC_OPCODE_EFS
+#define NO371 PPC_OPCODE_BOOKE | PPC_OPCODE_EFS
#define PPCE300 PPC_OPCODE_E300
#define PPCSPE PPC_OPCODE_SPE
#define PPCISEL PPC_OPCODE_ISEL

View File

@ -1,313 +0,0 @@
diff -NBaur gcc-6.3.0/gcc/config/rs6000/rs6000.h gcc-6.3.0-ppc/gcc/config/rs6000/rs6000.h
--- gcc-6.3.0/gcc/config/rs6000/rs6000.h 2016-07-07 20:42:07.000000000 +0100
+++ gcc-6.3.0-ppc/gcc/config/rs6000/rs6000.h 2017-01-05 02:42:41.980000000 +0000
@@ -205,6 +205,7 @@
{ "asm_cpu_476", ASM_CPU_476_SPEC }, \
SUBTARGET_EXTRA_SPECS
+#if 0
/* -mcpu=native handling only makes sense with compiler running on
an PowerPC chip. If changing this condition, also change
the condition in driver-rs6000.c. */
@@ -219,6 +220,8 @@
#else
#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
#endif
+#endif
+#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
#ifndef CC1_CPU_SPEC
#ifdef HAVE_LOCAL_CPU_DETECT
diff -NBaur gcc-6.3.0/gcc/config/rs6000/sysv4.h gcc-6.3.0-ppc/gcc/config/rs6000/sysv4.h
--- gcc-6.3.0/gcc/config/rs6000/sysv4.h 2016-05-16 14:47:47.000000000 +0100
+++ gcc-6.3.0-ppc/gcc/config/rs6000/sysv4.h 2017-01-05 02:46:27.020000000 +0000
@@ -559,7 +559,12 @@
/* Default starting address if specified. */
#define LINK_START_SPEC "\
-%{mads : %(link_start_ads) ; \
+%{mgcn|mogc : %(link_start_ogc) ; \
+ mvgc : %(link_start_vgc) ; \
+ mgcbios : %(link_start_gcb) ; \
+ mrvl : %(link_start_rvl) ; \
+ mwup : %(link_start_wup) ; \
+ mads : %(link_start_ads) ; \
myellowknife : %(link_start_yellowknife) ; \
mmvme : %(link_start_mvme) ; \
msim : %(link_start_sim) ; \
@@ -590,7 +595,9 @@
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
-%{mads : %(link_os_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(link_os_ogc) ; \
+ mwup : %(link_os_wup) ; \
+ mads : %(link_os_ads) ; \
myellowknife : %(link_os_yellowknife) ; \
mmvme : %(link_os_mvme) ; \
msim : %(link_os_sim) ; \
@@ -608,7 +615,11 @@
/* Override rs6000.h definition. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
-%{mads : %(cpp_os_ads) ; \
+%{mgcn : %(cpp_os_gcn) ; \
+ mogc|mvgc|mgcbios : %(cpp_os_ogc) ; \
+ mrvl : %(cpp_os_rvl) ; \
+ mwup : %(cpp_os_wup) ; \
+ mads : %(cpp_os_ads) ; \
myellowknife : %(cpp_os_yellowknife) ; \
mmvme : %(cpp_os_mvme) ; \
msim : %(cpp_os_sim) ; \
@@ -622,7 +633,11 @@
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "\
-%{mads : %(startfile_ads) ; \
+%{mgcn : %(startfile_gcn) ; \
+ mogc|mvgc|mgcbios : %(startfile_ogc) ; \
+ mrvl : %(startfile_ogc) ; \
+ mwup : %(startfile_wup) ; \
+ mads : %(startfile_ads) ; \
myellowknife : %(startfile_yellowknife) ; \
mmvme : %(startfile_mvme) ; \
msim : %(startfile_sim) ; \
@@ -636,7 +651,9 @@
#undef LIB_SPEC
#define LIB_SPEC "\
-%{mads : %(lib_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(lib_ogc) ; \
+ mwup : %(lib_wup) ; \
+ mads : %(lib_ads) ; \
myellowknife : %(lib_yellowknife) ; \
mmvme : %(lib_mvme) ; \
msim : %(lib_sim) ; \
@@ -646,11 +663,13 @@
mcall-openbsd: %(lib_openbsd) ; \
: %(lib_default) }"
-#define LIB_DEFAULT_SPEC "-lc"
+#define LIB_DEFAULT_SPEC "--start-group -lsysbase -lc --end-group"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "\
-%{mads : %(endfile_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(endfile_ogc) ; \
+ mwup : %(endfile_wup) ; \
+ mads : %(endfile_ads) ; \
myellowknife : %(endfile_yellowknife) ; \
mmvme : %(endfile_mvme) ; \
msim : %(endfile_sim) ; \
@@ -666,16 +685,33 @@
/* Motorola ADS support. */
#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
+#define LIB_OGC_SPEC "--start-group -lsysbase -lc --end-group"
+#define LIB_WUP_SPEC "--start-group -lsysbase -lc --end-group"
#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
+#define STARTFILE_OGC_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
+#define STARTFILE_WUP_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
#define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
+#define ENDFILE_OGC_SPEC "crtend.o%s ecrtn.o%s"
+#define ENDFILE_WUP_SPEC "crtend.o%s ecrtn.o%s"
#define LINK_START_ADS_SPEC "-T ads.ld%s"
+#define LINK_START_OGC_SPEC "-T ogc.ld%s"
+#define LINK_START_RVL_SPEC "-T rvl.ld%s"
+#define LINK_START_WUP_SPEC "-T wup.ld%s"
+#define LINK_START_VGC_SPEC "-T vgcogc.ld%s"
+#define LINK_START_GCB_SPEC "-T gcbogc.ld%s"
#define LINK_OS_ADS_SPEC ""
+#define LINK_OS_OGC_SPEC "--gc-sections"
+#define LINK_OS_WUP_SPEC "--gc-sections"
#define CPP_OS_ADS_SPEC ""
+#define CPP_OS_GCN_SPEC "-D__gamecube__ -ffunction-sections -fdata-sections"
+#define CPP_OS_OGC_SPEC "-D__gamecube__ -DHW_DOL -ffunction-sections -fdata-sections"
+#define CPP_OS_RVL_SPEC "-D__wii__ -DHW_RVL -ffunction-sections -fdata-sections"
+#define CPP_OS_WUP_SPEC "-D__wiiu__ -DHW_WUP -ffunction-sections -fdata-sections"
/* Motorola Yellowknife support. */
#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
@@ -866,6 +902,8 @@
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \
+ { "lib_ogc", LIB_OGC_SPEC }, \
+ { "lib_wup", LIB_WUP_SPEC }, \
{ "lib_ads", LIB_ADS_SPEC }, \
{ "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
{ "lib_mvme", LIB_MVME_SPEC }, \
@@ -875,6 +913,8 @@
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
{ "lib_openbsd", LIB_OPENBSD_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
+ { "startfile_ogc", STARTFILE_OGC_SPEC }, \
+ { "startfile_wup", STARTFILE_WUP_SPEC }, \
{ "startfile_ads", STARTFILE_ADS_SPEC }, \
{ "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
{ "startfile_mvme", STARTFILE_MVME_SPEC }, \
@@ -884,6 +924,8 @@
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
{ "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
+ { "endfile_ogc", ENDFILE_OGC_SPEC }, \
+ { "endfile_wup", ENDFILE_WUP_SPEC }, \
{ "endfile_ads", ENDFILE_ADS_SPEC }, \
{ "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
{ "endfile_mvme", ENDFILE_MVME_SPEC }, \
@@ -895,7 +937,12 @@
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
{ "link_shlib", LINK_SHLIB_SPEC }, \
{ "link_start", LINK_START_SPEC }, \
+ { "link_start_vgc", LINK_START_VGC_SPEC }, \
+ { "link_start_gcb", LINK_START_GCB_SPEC }, \
+ { "link_start_rvl", LINK_START_RVL_SPEC }, \
+ { "link_start_wup", LINK_START_WUP_SPEC }, \
{ "link_start_ads", LINK_START_ADS_SPEC }, \
+ { "link_start_ogc", LINK_START_OGC_SPEC }, \
{ "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
{ "link_start_mvme", LINK_START_MVME_SPEC }, \
{ "link_start_sim", LINK_START_SIM_SPEC }, \
@@ -905,6 +952,8 @@
{ "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
{ "link_os", LINK_OS_SPEC }, \
+ { "link_os_ogc", LINK_OS_OGC_SPEC }, \
+ { "link_os_wup", LINK_OS_WUP_SPEC }, \
{ "link_os_ads", LINK_OS_ADS_SPEC }, \
{ "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
{ "link_os_mvme", LINK_OS_MVME_SPEC }, \
@@ -916,6 +965,10 @@
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
{ "link_secure_plt", LINK_SECURE_PLT_SPEC }, \
+ { "cpp_os_gcn", CPP_OS_GCN_SPEC }, \
+ { "cpp_os_ogc", CPP_OS_OGC_SPEC }, \
+ { "cpp_os_rvl", CPP_OS_RVL_SPEC }, \
+ { "cpp_os_wup", CPP_OS_WUP_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff -NBaur gcc-6.3.0/gcc/config/rs6000/sysv4.opt gcc-6.3.0-ppc/gcc/config/rs6000/sysv4.opt
--- gcc-6.3.0/gcc/config/rs6000/sysv4.opt 2016-01-04 14:30:50.000000000 +0000
+++ gcc-6.3.0-ppc/gcc/config/rs6000/sysv4.opt 2017-01-05 02:42:41.984000000 +0000
@@ -120,6 +120,30 @@
Target RejectNegative
Link with libads.a, libc.a and crt0.o.
+mgcn
+Target RejectNegative
+Link with libsysbase.a and libc.a, use ogc linker script
+
+mogc
+Target RejectNegative
+Link with libsysbase.a and libc.a, use ogc linker script
+
+mgcbios
+Target RejectNegative
+Link with libsysbase.a and libc.a, use gcbogc linker script
+
+mvgc
+Target RejectNegative
+Link with libsysbase.a and libc.a, use gcbogc linker script
+
+mrvl
+Target RejectNegative
+Link with libsysbase.a and libc.a, use rvl linker script
+
+mwup
+Target RejectNegative
+Link with libsysbase.a and libc.a, use wup linker script
+
myellowknife
Target RejectNegative
Link with libyk.a, libc.a and crt0.o.
diff -NBaur gcc-6.3.0/gcc/config.gcc gcc-6.3.0-ppc/gcc/config.gcc
--- gcc-6.3.0/gcc/config.gcc 2016-11-07 21:38:43.000000000 +0000
+++ gcc-6.3.0-ppc/gcc/config.gcc 2017-01-05 02:42:41.984000000 +0000
@@ -2390,7 +2390,7 @@
use_gcc_stdint=wrap
;;
powerpc-*-eabi*)
- tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
+ tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/750cl.h"
extra_options="${extra_options} rs6000/sysv4.opt"
tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
use_gcc_stdint=wrap
diff -NBaur gcc-6.3.0/gcc/Makefile.in gcc-6.3.0-ppc/gcc/Makefile.in
--- gcc-6.3.0/gcc/Makefile.in 2016-11-22 17:33:07.000000000 +0000
+++ gcc-6.3.0-ppc/gcc/Makefile.in 2017-01-05 02:42:41.988000000 +0000
@@ -1073,8 +1073,8 @@
# things like the go/%.o rule work properly; but we use $(*F) for the
# file part, as we just want the file part of the stem, not the entire
# file name.
-COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
-POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
+COMPILE = $(COMPILE.base)
+POSTCOMPILE =
else
COMPILE = source='$<' object='$@' libtool=no \
DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base)
diff -NBaur gcc-6.3.0/libcpp/Makefile.in gcc-6.3.0-ppc/libcpp/Makefile.in
--- gcc-6.3.0/libcpp/Makefile.in 2016-12-21 07:53:39.000000000 +0000
+++ gcc-6.3.0-ppc/libcpp/Makefile.in 2017-01-05 02:42:41.988000000 +0000
@@ -208,8 +208,7 @@
# Note that we put the dependencies into a .Tpo file, then move them
# into place if the compile succeeds. We need this because gcc does
# not atomically write the dependency output file.
-COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo
-POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+COMPILE = $(COMPILE.base) -o $@
else
COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
$(depcomp) $(COMPILE.base)
diff -NBaur gcc-6.3.0/libgcc/config/rs6000/crtrestvr.S gcc-6.3.0-ppc/libgcc/config/rs6000/crtrestvr.S
--- gcc-6.3.0/libgcc/config/rs6000/crtrestvr.S 2016-01-04 14:30:50.000000000 +0000
+++ gcc-6.3.0-ppc/libgcc/config/rs6000/crtrestvr.S 2017-01-05 02:42:41.988000000 +0000
@@ -24,7 +24,7 @@
/* On PowerPC64 Linux, these functions are provided by the linker. */
#ifndef __powerpc64__
-
+#if 0
#undef __ALTIVEC__
#define __ALTIVEC__ 1
#include "ppc-asm.h"
@@ -85,3 +85,4 @@
CFI_ENDPROC
#endif
+#endif
diff -NBaur gcc-6.3.0/libgcc/config/rs6000/crtsavevr.S gcc-6.3.0-ppc/libgcc/config/rs6000/crtsavevr.S
--- gcc-6.3.0/libgcc/config/rs6000/crtsavevr.S 2016-01-04 14:30:50.000000000 +0000
+++ gcc-6.3.0-ppc/libgcc/config/rs6000/crtsavevr.S 2017-01-05 02:42:41.988000000 +0000
@@ -24,7 +24,7 @@
/* On PowerPC64 Linux, these functions are provided by the linker. */
#ifndef __powerpc64__
-
+#if 0
#undef __ALTIVEC__
#define __ALTIVEC__ 1
#include "ppc-asm.h"
@@ -85,3 +85,4 @@
CFI_ENDPROC
#endif
+#endif
diff -NBaur gcc-6.3.0/libgcc/crtstuff.c gcc-6.3.0-ppc/libgcc/crtstuff.c
--- gcc-6.3.0/libgcc/crtstuff.c 2016-01-04 14:30:50.000000000 +0000
+++ gcc-6.3.0-ppc/libgcc/crtstuff.c 2017-01-05 02:42:41.988000000 +0000
@@ -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,

View File

@ -1,313 +0,0 @@
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/rs6000.h gcc-7.1.0-ppc/gcc/config/rs6000/rs6000.h
--- gcc-7.1.0/gcc/config/rs6000/rs6000.h 2017-03-22 17:47:55.000000000 +0000
+++ gcc-7.1.0-ppc/gcc/config/rs6000/rs6000.h 2017-06-28 23:03:50.558004511 +0100
@@ -205,6 +205,7 @@
{ "asm_cpu_476", ASM_CPU_476_SPEC }, \
SUBTARGET_EXTRA_SPECS
+#if 0
/* -mcpu=native handling only makes sense with compiler running on
an PowerPC chip. If changing this condition, also change
the condition in driver-rs6000.c. */
@@ -219,6 +220,8 @@
#else
#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
#endif
+#endif
+#define ASM_CPU_NATIVE_SPEC "%(asm_default)"
#ifndef CC1_CPU_SPEC
#ifdef HAVE_LOCAL_CPU_DETECT
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/sysv4.h gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.h
--- gcc-7.1.0/gcc/config/rs6000/sysv4.h 2017-02-07 11:29:06.000000000 +0000
+++ gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.h 2017-06-28 23:03:50.562004807 +0100
@@ -564,7 +564,12 @@
/* Default starting address if specified. */
#define LINK_START_SPEC "\
-%{mads : %(link_start_ads) ; \
+%{mgcn|mogc : %(link_start_ogc) ; \
+ mvgc : %(link_start_vgc) ; \
+ mgcbios : %(link_start_gcb) ; \
+ mrvl : %(link_start_rvl) ; \
+ mwup : %(link_start_wup) ; \
+ mads : %(link_start_ads) ; \
myellowknife : %(link_start_yellowknife) ; \
mmvme : %(link_start_mvme) ; \
msim : %(link_start_sim) ; \
@@ -595,7 +600,9 @@
/* Any specific OS flags. */
#define LINK_OS_SPEC "\
-%{mads : %(link_os_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(link_os_ogc) ; \
+ mwup : %(link_os_wup) ; \
+ mads : %(link_os_ads) ; \
myellowknife : %(link_os_yellowknife) ; \
mmvme : %(link_os_mvme) ; \
msim : %(link_os_sim) ; \
@@ -613,7 +620,11 @@
/* Override rs6000.h definition. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
-%{mads : %(cpp_os_ads) ; \
+%{mgcn : %(cpp_os_gcn) ; \
+ mogc|mvgc|mgcbios : %(cpp_os_ogc) ; \
+ mrvl : %(cpp_os_rvl) ; \
+ mwup : %(cpp_os_wup) ; \
+ mads : %(cpp_os_ads) ; \
myellowknife : %(cpp_os_yellowknife) ; \
mmvme : %(cpp_os_mvme) ; \
msim : %(cpp_os_sim) ; \
@@ -627,7 +638,11 @@
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "\
-%{mads : %(startfile_ads) ; \
+%{mgcn : %(startfile_gcn) ; \
+ mogc|mvgc|mgcbios : %(startfile_ogc) ; \
+ mrvl : %(startfile_ogc) ; \
+ mwup : %(startfile_wup) ; \
+ mads : %(startfile_ads) ; \
myellowknife : %(startfile_yellowknife) ; \
mmvme : %(startfile_mvme) ; \
msim : %(startfile_sim) ; \
@@ -641,7 +656,9 @@
#undef LIB_SPEC
#define LIB_SPEC "\
-%{mads : %(lib_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(lib_ogc) ; \
+ mwup : %(lib_wup) ; \
+ mads : %(lib_ads) ; \
myellowknife : %(lib_yellowknife) ; \
mmvme : %(lib_mvme) ; \
msim : %(lib_sim) ; \
@@ -651,11 +668,13 @@
mcall-openbsd: %(lib_openbsd) ; \
: %(lib_default) }"
-#define LIB_DEFAULT_SPEC "-lc"
+#define LIB_DEFAULT_SPEC "--start-group -lsysbase -lc --end-group"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "\
-%{mads : %(endfile_ads) ; \
+%{mgcn|mogc|mvgc|mgcbios|mrvl : %(endfile_ogc) ; \
+ mwup : %(endfile_wup) ; \
+ mads : %(endfile_ads) ; \
myellowknife : %(endfile_yellowknife) ; \
mmvme : %(endfile_mvme) ; \
msim : %(endfile_sim) ; \
@@ -671,16 +690,33 @@
/* Motorola ADS support. */
#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
+#define LIB_OGC_SPEC "--start-group -lsysbase -lc --end-group"
+#define LIB_WUP_SPEC "--start-group -lsysbase -lc --end-group"
#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
+#define STARTFILE_OGC_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
+#define STARTFILE_WUP_SPEC "ecrti.o%s crtbegin.o%s crtmain.o%s"
#define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
+#define ENDFILE_OGC_SPEC "crtend.o%s ecrtn.o%s"
+#define ENDFILE_WUP_SPEC "crtend.o%s ecrtn.o%s"
#define LINK_START_ADS_SPEC "-T ads.ld%s"
+#define LINK_START_OGC_SPEC "-T ogc.ld%s"
+#define LINK_START_RVL_SPEC "-T rvl.ld%s"
+#define LINK_START_WUP_SPEC "-T wup.ld%s"
+#define LINK_START_VGC_SPEC "-T vgcogc.ld%s"
+#define LINK_START_GCB_SPEC "-T gcbogc.ld%s"
#define LINK_OS_ADS_SPEC ""
+#define LINK_OS_OGC_SPEC "--gc-sections"
+#define LINK_OS_WUP_SPEC "--gc-sections"
#define CPP_OS_ADS_SPEC ""
+#define CPP_OS_GCN_SPEC "-D__gamecube__ -ffunction-sections -fdata-sections"
+#define CPP_OS_OGC_SPEC "-D__gamecube__ -DHW_DOL -ffunction-sections -fdata-sections"
+#define CPP_OS_RVL_SPEC "-D__wii__ -DHW_RVL -ffunction-sections -fdata-sections"
+#define CPP_OS_WUP_SPEC "-D__wiiu__ -DHW_WUP -ffunction-sections -fdata-sections"
/* Motorola Yellowknife support. */
#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
@@ -871,6 +907,8 @@
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \
+ { "lib_ogc", LIB_OGC_SPEC }, \
+ { "lib_wup", LIB_WUP_SPEC }, \
{ "lib_ads", LIB_ADS_SPEC }, \
{ "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \
{ "lib_mvme", LIB_MVME_SPEC }, \
@@ -880,6 +918,8 @@
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
{ "lib_openbsd", LIB_OPENBSD_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
+ { "startfile_ogc", STARTFILE_OGC_SPEC }, \
+ { "startfile_wup", STARTFILE_WUP_SPEC }, \
{ "startfile_ads", STARTFILE_ADS_SPEC }, \
{ "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \
{ "startfile_mvme", STARTFILE_MVME_SPEC }, \
@@ -889,6 +929,8 @@
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
{ "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
+ { "endfile_ogc", ENDFILE_OGC_SPEC }, \
+ { "endfile_wup", ENDFILE_WUP_SPEC }, \
{ "endfile_ads", ENDFILE_ADS_SPEC }, \
{ "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \
{ "endfile_mvme", ENDFILE_MVME_SPEC }, \
@@ -900,7 +942,12 @@
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
{ "link_shlib", LINK_SHLIB_SPEC }, \
{ "link_start", LINK_START_SPEC }, \
+ { "link_start_vgc", LINK_START_VGC_SPEC }, \
+ { "link_start_gcb", LINK_START_GCB_SPEC }, \
+ { "link_start_rvl", LINK_START_RVL_SPEC }, \
+ { "link_start_wup", LINK_START_WUP_SPEC }, \
{ "link_start_ads", LINK_START_ADS_SPEC }, \
+ { "link_start_ogc", LINK_START_OGC_SPEC }, \
{ "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \
{ "link_start_mvme", LINK_START_MVME_SPEC }, \
{ "link_start_sim", LINK_START_SIM_SPEC }, \
@@ -910,6 +957,8 @@
{ "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
{ "link_os", LINK_OS_SPEC }, \
+ { "link_os_ogc", LINK_OS_OGC_SPEC }, \
+ { "link_os_wup", LINK_OS_WUP_SPEC }, \
{ "link_os_ads", LINK_OS_ADS_SPEC }, \
{ "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \
{ "link_os_mvme", LINK_OS_MVME_SPEC }, \
@@ -921,6 +970,10 @@
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
{ "link_secure_plt", LINK_SECURE_PLT_SPEC }, \
+ { "cpp_os_gcn", CPP_OS_GCN_SPEC }, \
+ { "cpp_os_ogc", CPP_OS_OGC_SPEC }, \
+ { "cpp_os_rvl", CPP_OS_RVL_SPEC }, \
+ { "cpp_os_wup", CPP_OS_WUP_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff -Nbaur gcc-7.1.0/gcc/config/rs6000/sysv4.opt gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.opt
--- gcc-7.1.0/gcc/config/rs6000/sysv4.opt 2017-01-01 12:07:43.000000000 +0000
+++ gcc-7.1.0-ppc/gcc/config/rs6000/sysv4.opt 2017-06-28 23:03:50.562004807 +0100
@@ -120,6 +120,30 @@
Target RejectNegative
Link with libads.a, libc.a and crt0.o.
+mgcn
+Target RejectNegative
+Link with libsysbase.a and libc.a, use ogc linker script
+
+mogc
+Target RejectNegative
+Link with libsysbase.a and libc.a, use ogc linker script
+
+mgcbios
+Target RejectNegative
+Link with libsysbase.a and libc.a, use gcbogc linker script
+
+mvgc
+Target RejectNegative
+Link with libsysbase.a and libc.a, use gcbogc linker script
+
+mrvl
+Target RejectNegative
+Link with libsysbase.a and libc.a, use rvl linker script
+
+mwup
+Target RejectNegative
+Link with libsysbase.a and libc.a, use wup linker script
+
myellowknife
Target RejectNegative
Link with libyk.a, libc.a and crt0.o.
diff -Nbaur gcc-7.1.0/gcc/config.gcc gcc-7.1.0-ppc/gcc/config.gcc
--- gcc-7.1.0/gcc/config.gcc 2017-03-24 13:59:51.000000000 +0000
+++ gcc-7.1.0-ppc/gcc/config.gcc 2017-06-28 23:03:50.566005054 +0100
@@ -2404,7 +2404,7 @@
use_gcc_stdint=wrap
;;
powerpc-*-eabi*)
- tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
+ tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/750cl.h"
extra_options="${extra_options} rs6000/sysv4.opt"
tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
use_gcc_stdint=wrap
diff -Nbaur gcc-7.1.0/gcc/Makefile.in gcc-7.1.0-ppc/gcc/Makefile.in
--- gcc-7.1.0/gcc/Makefile.in 2017-04-18 19:10:27.000000000 +0100
+++ gcc-7.1.0-ppc/gcc/Makefile.in 2017-06-28 23:03:50.570005229 +0100
@@ -1087,8 +1087,8 @@
# things like the go/%.o rule work properly; but we use $(*F) for the
# file part, as we just want the file part of the stem, not the entire
# file name.
-COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
-POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
+COMPILE = $(COMPILE.base)
+POSTCOMPILE =
else
COMPILE = source='$<' object='$@' libtool=no \
DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base)
diff -Nbaur gcc-7.1.0/libcpp/Makefile.in gcc-7.1.0-ppc/libcpp/Makefile.in
--- gcc-7.1.0/libcpp/Makefile.in 2017-05-02 13:43:57.000000000 +0100
+++ gcc-7.1.0-ppc/libcpp/Makefile.in 2017-06-28 23:03:50.570005229 +0100
@@ -208,8 +208,7 @@
# Note that we put the dependencies into a .Tpo file, then move them
# into place if the compile succeeds. We need this because gcc does
# not atomically write the dependency output file.
-COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo
-POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+COMPILE = $(COMPILE.base) -o $@
else
COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \
$(depcomp) $(COMPILE.base)
diff -Nbaur gcc-7.1.0/libgcc/config/rs6000/crtrestvr.S gcc-7.1.0-ppc/libgcc/config/rs6000/crtrestvr.S
--- gcc-7.1.0/libgcc/config/rs6000/crtrestvr.S 2017-03-10 19:29:48.000000000 +0000
+++ gcc-7.1.0-ppc/libgcc/config/rs6000/crtrestvr.S 2017-06-28 23:03:50.570005229 +0100
@@ -24,7 +24,7 @@
/* On PowerPC64 Linux, these functions are provided by the linker. */
#ifndef __powerpc64__
-
+#if 0
#undef __ALTIVEC__
#define __ALTIVEC__ 1
#include "ppc-asm.h"
@@ -86,3 +86,4 @@
CFI_ENDPROC
#endif
+#endif
diff -Nbaur gcc-7.1.0/libgcc/config/rs6000/crtsavevr.S gcc-7.1.0-ppc/libgcc/config/rs6000/crtsavevr.S
--- gcc-7.1.0/libgcc/config/rs6000/crtsavevr.S 2017-03-10 19:29:48.000000000 +0000
+++ gcc-7.1.0-ppc/libgcc/config/rs6000/crtsavevr.S 2017-06-28 23:03:50.574005432 +0100
@@ -24,7 +24,7 @@
/* On PowerPC64 Linux, these functions are provided by the linker. */
#ifndef __powerpc64__
-
+#if 0
#undef __ALTIVEC__
#define __ALTIVEC__ 1
#include "ppc-asm.h"
@@ -86,3 +86,4 @@
CFI_ENDPROC
#endif
+#endif
diff -Nbaur gcc-7.1.0/libgcc/crtstuff.c gcc-7.1.0-ppc/libgcc/crtstuff.c
--- gcc-7.1.0/libgcc/crtstuff.c 2017-01-01 12:07:43.000000000 +0000
+++ gcc-7.1.0-ppc/libgcc/crtstuff.c 2017-06-28 23:03:50.574005432 +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,