This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, libgcc] Disable JCR section when java is not enabled
- From: "Joey Ye" <joey dot ye at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <hjl dot tools at gmail dot com>
- Date: Tue, 10 Sep 2013 17:01:24 +0800
- Subject: [PATCH, libgcc] Disable JCR section when java is not enabled
- Authentication-results: sourceware.org; auth=none
Updated to http://gcc.gnu.org/ml/gcc-patches/2012-12/msg01097.html
Build passes on arm-none-eabi and bootstrap passes on x86.
OK to trunk?
ChangeLog
* libgcc/Makefile.in: Include JAVA_IS_ENABLED in CFLAGS.
* libgcc/configure.ac (java_is_enabled): New variable.
* libgcc/configure: Regenerated.
* libgcc/crtstuff.c: Check JAVA_IS_ENABLED.
Index: Makefile.in
===================================================================
--- Makefile.in (revision 194467)
+++ Makefile.in (working copy)
@@ -281,7 +281,8 @@
-finhibit-size-directive -fno-inline -fno-exceptions \
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
-fno-stack-protector \
- $(INHIBIT_LIBC_CFLAGS)
+ $(INHIBIT_LIBC_CFLAGS) \
+ -DJAVA_IS_ENABLED=@java_is_enabled@
# Extra flags to use when compiling crt{begin,end}.o.
CRTSTUFF_T_CFLAGS =
Index: configure.ac
===================================================================
--- configure.ac (revision 194467)
+++ configure.ac (working copy)
@@ -204,6 +204,17 @@
esac],
[enable_sjlj_exceptions=auto])
+# Disable jcr section if we are not building java
+case ,${enable_languages}, in
+ *,java,*)
+ java_is_enabled=1
+ ;;
+ *)
+ java_is_enabled=0
+ ;;
+esac
+AC_SUBST(java_is_enabled)
+
AC_CACHE_CHECK([whether to use setjmp/longjmp exceptions],
[libgcc_cv_lib_sjlj_exceptions],
[AC_LANG_CONFTEST(
Index: crtstuff.c
===================================================================
--- crtstuff.c (revision 194467)
+++ crtstuff.c (working copy)
@@ -145,6 +145,10 @@
# define USE_TM_CLONE_REGISTRY 1
#endif
+#if !JAVA_IS_ENABLED
+#undef JCR_SECTION_NAME
+#endif
+
/* We do not want to add the weak attribute to the declarations of these
routines in unwind-dw2-fde.h because that will cause the definition of
these symbols to be weak as well.
Index: configure
===================================================================
--- configure (revision 194467)
+++ configure (working copy)
@@ -566,6 +566,7 @@
set_use_emutls
set_have_cc_tls
vis_hide
+java_is_enabled
fixed_point
enable_decimal_float
decimal_float
@@ -4191,6 +4192,17 @@
fi
+# Disable jcr section if we are not building java
+case ,${enable_languages}, in
+ *,java,*)
+ java_is_enabled=1
+ ;;
+ *)
+ java_is_enabled=0
+ ;;
+esac
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use
setjmp/longjmp exceptions" >&5
$as_echo_n "checking whether to use setjmp/longjmp exceptions... " >&6; }
if test "${libgcc_cv_lib_sjlj_exceptions+set}" = set; then :