From: H.J. Lu Date: Sat, 3 Mar 2012 17:04:49 +0000 (+0000) Subject: Add Linux/x32 support to Ada X-Git-Tag: upstream/12.2.0~77654 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b1106fbc36341b04477ee593ea0de92ecd16964;p=platform%2Fupstream%2Fgcc.git Add Linux/x32 support to Ada 2012-03-03 H.J. Lu * init.c (__gnat_adjust_context_for_raise): Also check "orq $0x0,(%esp)" for x32. * link.c (__gnat_default_libgcc_subdir): set to libx32 for x32. * gcc-interface/Makefile.in (arch): Set to x32 if MULTISUBDIR is /x32. Support x32. From-SVN: r184859 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f2894ff..a6aefc5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2012-03-03 H.J. Lu + + * init.c (__gnat_adjust_context_for_raise): Also check + "orq $0x0,(%esp)" for x32. + + * link.c (__gnat_default_libgcc_subdir): set to libx32 for x32. + + * gcc-interface/Makefile.in (arch): Set to x32 if MULTISUBDIR + is /x32. + Support x32. + 2012-02-29 Eric Botcazou * gcc-interface/decl.c (components_to_record): Add ARTIFICIAL parameter diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 5fa6ffa..19d9eb0 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -349,6 +349,10 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ ifeq ($(strip $(filter-out %x86_64, $(arch))),) ifeq ($(strip $(MULTISUBDIR)),/32) arch:=i686 + else + ifeq ($(strip $(MULTISUBDIR)),/x32) + arch:=x32 + endif endif endif @@ -2134,6 +2138,43 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) LIBRARY_VERSION := $(LIB_VERSION) endif +ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ + a-exetim.adbgregs[REG_ESP] += 4096 + 4 * sizeof (unsigned long); #elif defined (__x86_64__) - unsigned long *pc = (unsigned long *)mcontext->gregs[REG_RIP]; - /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ - if (signo == SIGSEGV && pc && (*pc & 0xffffffffff) == 0x00240c8348) + unsigned long long *pc = (unsigned long long *)mcontext->gregs[REG_RIP]; + if (signo == SIGSEGV && pc + /* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */ + && ((*pc & 0xffffffffffLL) == 0x00240c8348LL + /* The pattern may also be "orl $0x0,(%esp)" for a probe in + x32 mode. */ + || (*pc & 0xffffffffLL) == 0x00240c83LL)) mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long); #elif defined (__ia64__) /* ??? The IA-64 unwinder doesn't compensate for signals. */ diff --git a/gcc/ada/link.c b/gcc/ada/link.c index 8bcad27..cb1a928 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -187,7 +187,11 @@ unsigned char __gnat_using_gnu_linker = 1; const char *__gnat_object_library_extension = ".a"; unsigned char __gnat_separate_run_path_options = 0; #if defined (__x86_64) +# if defined (__LP64__) const char *__gnat_default_libgcc_subdir = "lib64"; +# else +const char *__gnat_default_libgcc_subdir = "libx32"; +# endif #else const char *__gnat_default_libgcc_subdir = "lib"; #endif