Blame SOURCES/gcc48-aarch64-ada.patch

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