===================================================================
@@ -50,6 +50,8 @@ target_noncanonical = @target_noncanonic
# The rules for compiling them should be in the t-* file for the machine.
EXTRA_PARTS = @extra_parts@
+FORCE_EXPLICIT_EH_REGISTRY = @force_explicit_eh_registry@
+
extra-parts = libgcc-extra-parts
# Multilib support variables.
@@ -283,7 +285,7 @@ INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CF
CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline -fno-exceptions \
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
- -fno-stack-protector \
+ -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
$(INHIBIT_LIBC_CFLAGS)
# Extra flags to use when compiling crt{begin,end}.o.
===================================================================
@@ -262,6 +262,22 @@ no)
;;
esac
+AC_ARG_ENABLE([explicit-exception-frame-registration],
+ [AC_HELP_STRING([--enable-explicit-exception-frame-registration],
+ [register exception tables explicitly at module start, for use
+ e.g. for compatibility with installations without PT_GNU_EH_FRAME support])],
+[
+force_explicit_eh_registry=
+if test "$enable_explicit_exception_frame_registration" = yes; then
+ if test "$enable_sjlj_exceptions" = yes; then
+ AC_MSG_ERROR([Can't enable both of --enable-sjlj-exceptions
+ and --enable-explicit-exception-frame-registration])
+ fi
+ force_explicit_eh_registry=-DUSE_EH_FRAME_REGISTRY_ALWAYS
+fi
+])
+AC_SUBST([force_explicit_eh_registry])
+
AC_LIB_PROG_LD_GNU
AC_MSG_CHECKING([for thread model used by GCC])
===================================================================
@@ -131,7 +131,12 @@ call_ ## FUNC (void) \
# define USE_PT_GNU_EH_FRAME
#endif
-#if defined(EH_FRAME_SECTION_NAME) && !defined(USE_PT_GNU_EH_FRAME)
+#ifdef USE_EH_FRAME_REGISTRY_ALWAYS
+# ifndef EH_FRAME_SECTION_NAME
+# error "Can't use explicit exception-frame-registration without EH_FRAME_SECTION_NAME"
+# endif
+#endif
+#if defined(EH_FRAME_SECTION_NAME) && (!defined(USE_PT_GNU_EH_FRAME) || defined(USE_EH_FRAME_REGISTRY_ALWAYS))
# define USE_EH_FRAME_REGISTRY
#endif
#if defined(EH_FRAME_SECTION_NAME) && EH_TABLES_CAN_BE_READ_ONLY