]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in (GNATLIBCFLAGS_FOR_C): New variable.
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 24 Oct 2009 10:58:31 +0000 (10:58 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 24 Oct 2009 10:58:31 +0000 (10:58 +0000)
libada/
* Makefile.in (GNATLIBCFLAGS_FOR_C): New variable.
(LIBADA_FLAGS_TO_PASS): Add GNATLIBCFLAGS_FOR_C.
* configure.ac: Include config/unwind_ipinfo.m4.
Check for _Unwind_GetIPInfo.
* configure: Regenerate.

gcc/ada/
* init.c (__gnat_adjust_context_for_raise): Mention _Unwind_GetIPInfo.
* gcc-interface/Makefile.in (GNATLIBCFLAGS_FOR_C): Add HAVE_GETIPINFO.
Pass GNATLIBCFLAGS_FOR_C to recursive invocations.

gcc/testsuite/
* gnat.dg/null_pointer_deref1.adb: New test.
* gnat.dg/null_pointer_deref2.adb: Likewise.

From-SVN: r153525

gcc/ada/ChangeLog
gcc/ada/gcc-interface/Makefile.in
gcc/ada/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/null_pointer_deref1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/null_pointer_deref2.adb [new file with mode: 0644]
libada/ChangeLog
libada/Makefile.in
libada/configure
libada/configure.ac

index e4761d82e1fed09bd31af8be4fc7b195375225ca..231de3040903f341d8bd198e721f64c8980aecec 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * init.c (__gnat_adjust_context_for_raise): Mention _Unwind_GetIPInfo.
+       * gcc-interface/Makefile.in (GNATLIBCFLAGS_FOR_C): Add HAVE_GETIPINFO.
+       Pass GNATLIBCFLAGS_FOR_C to recursive invocations.
+
 2009-10-21  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interfaces/decl.c (build_subst_list): Convert the expression of
index cf717ac39cd00cd4ea7eb915f6a591b5d59bb0eb..c9221fb502253b66f391e5be88bbf7abd5d8fcc0 100644 (file)
@@ -109,8 +109,11 @@ SOME_ADAFLAGS =-gnata
 FORCE_DEBUG_ADAFLAGS = -g
 GNATLIBFLAGS = -gnatpg -nostdinc
 GNATLIBCFLAGS = -g -O2
+# Pretend that _Unwind_GetIPInfo is available for the target by default.  This
+# should be autodetected during the configuration of libada and passed down to
+# here, but we need something for --disable-libada and hope for the best.
 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
-       -DIN_RTS
+       -DIN_RTS -DHAVE_GETIPINFO
 ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
 MOST_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(SOME_ADAFLAGS)
 THREAD_KIND = native
@@ -2422,6 +2425,7 @@ gnatlib-shared-default:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib
@@ -2447,6 +2451,7 @@ gnatlib-shared-dual:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib-shared-default
@@ -2455,6 +2460,7 @@ gnatlib-shared-dual:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib
@@ -2464,6 +2470,7 @@ gnatlib-shared-dual-win32:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib-shared-win32
@@ -2472,6 +2479,7 @@ gnatlib-shared-dual-win32:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib
@@ -2485,6 +2493,7 @@ gnatlib-shared-win32:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib
@@ -2503,7 +2512,7 @@ gnatlib-shared-darwin:
        $(MAKE) $(FLAGS_TO_PASS) \
             GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
-                           -fno-common" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) -fno-common" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
             gnatlib
@@ -2531,6 +2540,7 @@ gnatlib-shared-vms:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
              gnatlib
@@ -2559,6 +2569,7 @@ gnatlib-shared:
        $(MAKE) $(FLAGS_TO_PASS) \
              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
             TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
@@ -2572,6 +2583,7 @@ gnatlib-sjlj:
             EH_MECHANISM="" \
             GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
             TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
@@ -2584,6 +2596,7 @@ gnatlib-zcx:
             EH_MECHANISM="-gcc" \
             GNATLIBFLAGS="$(GNATLIBFLAGS)" \
             GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+            GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
             MULTISUBDIR="$(MULTISUBDIR)" \
             THREAD_KIND="$(THREAD_KIND)" \
             TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
index 5fe46cd0ff25a81a80bcad93b3b33fb0c7f86cf7..0483d82724b3f18ac92c08db31add9fadc553275 100644 (file)
@@ -2301,8 +2301,10 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
 {
   /* We used to compensate here for the raised from call vs raised from signal
      exception discrepancy with the GCC ZCX scheme, but this now can be dealt
-     with generically in the unwinder (see GCC PR other/26208).  Only the VMS
-     ports still do the compensation described in the few lines below.
+     with generically in the unwinder (see GCC PR other/26208).  This however
+     requires the use of the _Unwind_GetIPInfo routine in raise-gcc.c, which
+     is predicated on the definition of HAVE_GETIPINFO at compile time.  Only
+     the VMS ports still do the compensation described in the few lines below.
 
      *** Call vs signal exception discrepancy with GCC ZCX scheme ***
 
index 676b5a73a5540fe3d22fee9dee3d9f4613d5a1e6..73d8d6bf8e0b1b5a5b66a48c43726d07ab78a939 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/null_pointer_deref1.adb: New test.
+       * gnat.dg/null_pointer_deref2.adb: Likewise.
+
 2009-10-24  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/41772
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
new file mode 100644 (file)
index 0000000..817155d
--- /dev/null
@@ -0,0 +1,21 @@
+-- { dg-do run }
+-- { dg-options "-gnatp" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass.  Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Null_Pointer_Deref1 is
+   type Int_Ptr is access all Integer;
+
+   function Ident return Int_Ptr is
+   begin
+     return null;
+   end;
+
+   Data : Int_Ptr := Ident;
+begin
+   Data.all := 1;
+exception
+   when Storage_Error => null;
+end;
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref2.adb b/gcc/testsuite/gnat.dg/null_pointer_deref2.adb
new file mode 100644 (file)
index 0000000..b1dd548
--- /dev/null
@@ -0,0 +1,28 @@
+-- { dg-do run }
+-- { dg-options "-gnatp" }
+
+-- This test requires architecture- and OS-specific support code for unwinding
+-- through signal frames (typically located in *-unwind.h) to pass.  Feel free
+-- to disable it if this code hasn't been implemented yet.
+
+procedure Null_Pointer_Deref2 is
+
+   task T;
+
+   task body T is
+      type Int_Ptr is access all Integer;
+
+      function Ident return Int_Ptr is
+      begin
+        return null;
+      end;
+      Data : Int_Ptr := Ident;
+   begin
+      Data.all := 1;
+   exception
+      when Storage_Error => null;
+   end T;
+
+begin
+   null;
+end;
index a3add7489716e7cc1c8f24ea81672dd4443328fb..deffec6515f2319a877115caac2d8581d7d4b5d7 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * Makefile.in (GNATLIBCFLAGS_FOR_C): New variable.
+       (LIBADA_FLAGS_TO_PASS): Add GNATLIBCFLAGS_FOR_C.
+       * configure.ac: Include config/unwind_ipinfo.m4.
+       Check for _Unwind_GetIPInfo.
+       * configure: Regenerate.
+
 2009-08-30  Paolo Bonzini  <bonzini@gnu.org>
 
        PR ada/41122
index eec1649f9e112bb8c6c665ac0fc686ed477ab9ce..01fa8362374a89998cccf39aaf901bcc0c2a88cf 100644 (file)
@@ -58,6 +58,8 @@ WARN_CFLAGS = @warn_cflags@
 
 TARGET_LIBGCC2_CFLAGS=
 GNATLIBCFLAGS= -g -O2
+GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
+       -DIN_RTS @have_getipinfo@
 
 # Get target-specific overrides for TARGET_LIBGCC2_CFLAGS.
 host_subdir = @host_subdir@
@@ -80,6 +82,7 @@ LIBADA_FLAGS_TO_PASS = \
         "SHELL=$(SHELL)" \
         "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
         "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
+        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
         "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
         "THREAD_KIND=$(THREAD_KIND)" \
         "TRACE=$(TRACE)" \
index ce8c0039e350e0fe21fceaa2f7597231b22c4071..4137364df2110c90bf0304654e18fb4d47c6a048 100755 (executable)
@@ -554,6 +554,7 @@ ac_unique_file="Makefile.in"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 warn_cflags
+have_getipinfo
 default_gnatlib_target
 LN_S
 AWK
@@ -631,6 +632,7 @@ with_build_libsubdir
 enable_maintainer_mode
 enable_multilib
 enable_shared
+with_system_libunwind
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1258,6 +1260,7 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-build-libsubdir=DIR  Directory where to find libraries for build system
+  --with-system-libunwind use installed libunwind
 
 Some influential environment variables:
   CC          C compiler command
@@ -2879,6 +2882,49 @@ else
 fi
 
 
+# Check for _Unwind_GetIPInfo
+
+
+# Check whether --with-system-libunwind was given.
+if test "${with_system_libunwind+set}" = set; then :
+  withval=$with_system_libunwind;
+fi
+
+  # If system-libunwind was not specifically set, pick a default setting.
+  if test x$with_system_libunwind = x; then
+    case ${target} in
+      ia64-*-hpux*) with_system_libunwind=yes ;;
+      *) with_system_libunwind=no ;;
+    esac
+  fi
+  # Based on system-libunwind and target, do we have ipinfo?
+  if  test x$with_system_libunwind = xyes; then
+    case ${target} in
+      ia64-*-*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
+  else
+    # Darwin before version 9 does not have _Unwind_GetIPInfo.
+
+    case ${target} in
+      *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
+
+  fi
+
+  if test x$have_unwind_getipinfo = xyes; then
+
+$as_echo "#define HAVE_GETIPINFO 1" >>confdefs.h
+
+  fi
+
+have_getipinfo=
+if test x$have_unwind_getipinfo = xyes; then
+  have_getipinfo=-DHAVE_GETIPINFO
+fi
+
+
 warn_cflags=
 if test "x$GCC" = "xyes"; then
   warn_cflags='$(GCC_WARN_CFLAGS)'
index 2fd8080f23bb4c993d913d084173a0d75503afdd..3aa8a62a522554aa4f2b817f5e440aba3bfb4ba3 100644 (file)
@@ -18,6 +18,7 @@
 sinclude(../config/acx.m4)
 sinclude(../config/multi.m4)
 sinclude(../config/override.m4)
+sinclude(../config/unwind_ipinfo.m4)
 
 AC_INIT
 AC_PREREQ([2.64])
@@ -131,6 +132,14 @@ else
 fi
 AC_SUBST([default_gnatlib_target])
 
+# Check for _Unwind_GetIPInfo
+GCC_CHECK_UNWIND_GETIPINFO
+have_getipinfo=
+if test x$have_unwind_getipinfo = xyes; then
+  have_getipinfo=-DHAVE_GETIPINFO
+fi
+AC_SUBST(have_getipinfo)
+
 warn_cflags=
 if test "x$GCC" = "xyes"; then
   warn_cflags='$(GCC_WARN_CFLAGS)'