Blame SOURCES/gcc48-aarch64-ada.patch

d8d6ff
2014-04-09  Richard Henderson  <rth@redhat.com>
d8d6ff
d8d6ff
	* gcc-interface/Makefile.in: Support aarch64-linux.
d8d6ff
	* init.c: Enable alternate stack support also on aarch64.
d8d6ff
	* types.h (Fat_Pointer): Remove aligned attribute.
d8d6ff
d8d6ff
--- gcc/ada/gcc-interface/Makefile.in
d8d6ff
+++ gcc/ada/gcc-interface/Makefile.in
d8d6ff
@@ -2123,6 +2123,44 @@ ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
d8d6ff
   LIBRARY_VERSION := $(LIB_VERSION)
d8d6ff
 endif
d8d6ff
 
d8d6ff
+# AArch64 Linux
d8d6ff
+ifeq ($(strip $(filter-out aarch64% linux%,$(arch) $(osys))),)
d8d6ff
+  LIBGNAT_TARGET_PAIRS = \
d8d6ff
+  a-exetim.adb
d8d6ff
+  a-exetim.ads
d8d6ff
+  a-intnam.ads
d8d6ff
+  a-synbar.adb
d8d6ff
+  a-synbar.ads
d8d6ff
+  s-inmaop.adb
d8d6ff
+  s-intman.adb
d8d6ff
+  s-linux.ads
d8d6ff
+  s-mudido.adb
d8d6ff
+  s-osinte.ads
d8d6ff
+  s-osinte.adb
d8d6ff
+  s-osprim.adb
d8d6ff
+  s-taprop.adb
d8d6ff
+  s-tasinf.ads
d8d6ff
+  s-tasinf.adb
d8d6ff
+  s-tpopsp.adb
d8d6ff
+  s-taspri.ads
d8d6ff
+  g-sercom.adb
d8d6ff
+  $(ATOMICS_TARGET_PAIRS) \
d8d6ff
+  $(ATOMICS_BUILTINS_TARGET_PAIRS) \
d8d6ff
+  system.ads
d8d6ff
+  ## ^^ Note the above is a pretty-close placeholder.
d8d6ff
+
d8d6ff
+  TOOLS_TARGET_PAIRS =  \
d8d6ff
+    mlib-tgt-specific.adb
d8d6ff
+    indepsw.adb
d8d6ff
+
d8d6ff
+  EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
d8d6ff
+  EH_MECHANISM=-gcc
d8d6ff
+  THREADSLIB=-lpthread -lrt
d8d6ff
+  GNATLIB_SHARED=gnatlib-shared-dual
d8d6ff
+  GMEM_LIB = gmemlib
d8d6ff
+  LIBRARY_VERSION := $(LIB_VERSION)
d8d6ff
+endif
d8d6ff
+
d8d6ff
 # x86-64 Linux
d8d6ff
 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
d8d6ff
   LIBGNAT_TARGET_PAIRS = \
d8d6ff
--- gcc/ada/init.c
d8d6ff
+++ gcc/ada/init.c
d8d6ff
@@ -562,7 +562,9 @@ __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext)
d8d6ff
   Raise_From_Signal_Handler (exception, msg);
d8d6ff
 }
d8d6ff
 
d8d6ff
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
d8d6ff
+#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) \
d8d6ff
+    || defined (__aarch64__)
d8d6ff
+#define HAVE_GNAT_ALTERNATE_STACK 1
d8d6ff
 /* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.  */
d8d6ff
 char __gnat_alternate_stack[16 * 1024]; /* 2 * SIGSTKSZ */
d8d6ff
 #endif
d8d6ff
@@ -603,7 +605,7 @@ __gnat_install_handler (void)
d8d6ff
      handled properly, avoiding a SEGV generation from stack usage by the
d8d6ff
      handler itself.  */
d8d6ff
 
d8d6ff
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
d8d6ff
+#ifdef HAVE_GNAT_ALTERNATE_STACK
d8d6ff
   stack_t stack;
d8d6ff
   stack.ss_sp = __gnat_alternate_stack;
d8d6ff
   stack.ss_size = sizeof (__gnat_alternate_stack);
d8d6ff
@@ -624,7 +626,7 @@ __gnat_install_handler (void)
d8d6ff
     sigaction (SIGILL,  &act, NULL);
d8d6ff
   if (__gnat_get_interrupt_state (SIGBUS) != 's')
d8d6ff
     sigaction (SIGBUS,  &act, NULL);
d8d6ff
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
d8d6ff
+#ifdef HAVE_GNAT_ALTERNATE_STACK
d8d6ff
   act.sa_flags |= SA_ONSTACK;
d8d6ff
 #endif
d8d6ff
   if (__gnat_get_interrupt_state (SIGSEGV) != 's')
d8d6ff
--- gcc/ada/types.h
d8d6ff
+++ gcc/ada/types.h
d8d6ff
@@ -79,8 +79,7 @@ typedef Char *Str_Ptr;
d8d6ff
 /* Types for the fat pointer used for strings and the template it
d8d6ff
    points to.  */
d8d6ff
 typedef struct {int Low_Bound, High_Bound; } String_Template;
d8d6ff
-typedef struct {const char *Array; String_Template *Bounds; }
d8d6ff
-	__attribute ((aligned (sizeof (char *) * 2))) Fat_Pointer;
d8d6ff
+typedef struct {const char *Array; String_Template *Bounds; } Fat_Pointer;
d8d6ff
 
d8d6ff
 /* Types for Node/Entity Kinds:  */
d8d6ff