+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
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
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib-shared-default
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(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
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(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
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(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)" \
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
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
{
/* 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 ***
+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
--- /dev/null
+-- { 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;
--- /dev/null
+-- { 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;
+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
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@
"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)" \
ac_subst_vars='LTLIBOBJS
LIBOBJS
warn_cflags
+have_getipinfo
default_gnatlib_target
LN_S
AWK
enable_maintainer_mode
enable_multilib
enable_shared
+with_system_libunwind
'
ac_precious_vars='build_alias
host_alias
--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
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)'
sinclude(../config/acx.m4)
sinclude(../config/multi.m4)
sinclude(../config/override.m4)
+sinclude(../config/unwind_ipinfo.m4)
AC_INIT
AC_PREREQ([2.64])
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)'