Add preliminary AArch64 GCC patch

This commit is contained in:
fincs 2017-03-04 23:29:49 +01:00 committed by Dave Murphy
parent abacc13bf7
commit 993c6681cb

View File

@ -0,0 +1,112 @@
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 6c5adc0bb..bf99d9883 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1073,8 +1073,8 @@ ifeq ($(CXXDEPMODE),depmode=gcc3)
# 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 --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h
index 909701788..6f7ef694f 100644
--- a/gcc/config/aarch64/aarch64-elf-raw.h
+++ b/gcc/config/aarch64/aarch64-elf-raw.h
@@ -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 --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64
index 778e15c96..76aeaf7f6 100644
--- a/gcc/config/aarch64/t-aarch64
+++ b/gcc/config/aarch64/t-aarch64
@@ -67,5 +67,7 @@ cortex-a57-fma-steering.o: $(srcdir)/config/aarch64/cortex-a57-fma-steering.c \
$(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
+MULTILIB_DIRNAMES = large
+MULTILIB_REQUIRED = mcmodel=large
+MULTILIB_MATCHES =
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0f042b0f1..00a79153e 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -778,6 +778,11 @@ proper position among the other output files. */
#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 \
@@ -1062,6 +1067,7 @@ static const char *link_spec = LINK_SPEC;
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;
@@ -1563,6 +1569,7 @@ static struct spec_list static_specs[] =
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 --git a/libcpp/Makefile.in b/libcpp/Makefile.in
index a7d782803..e6741a5bd 100644
--- a/libcpp/Makefile.in
+++ b/libcpp/Makefile.in
@@ -208,8 +208,7 @@ ifeq ($(DEPMODE),depmode=gcc3)
# 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 --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index f09b39b0e..45299e0ff 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -820,7 +820,7 @@ endif
# 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/libgcc/crtstuff.c b/libgcc/crtstuff.c
index f3343fc4f..75e220ab4 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -47,6 +47,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* 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,