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