Blame SOURCES/gcc48-aarch64-ada.patch

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