FYI Patch: java/41991: Use -allow_stack_execute on Darwin

Bryce McKinlay <[email protected]>
Newsgroups gmane.comp.gcc.java.devel,gmane.comp.gcc.java.patches
Message-ID <[email protected]>
On Sat, Dec 5, 2009 at 6:54 AM, Jack Howarth <[email protected]> wrote:

> Bryce,
>    Your patch eliminates the crashes in gcj completely for gcc trunk
> on x86_64-apple-darwin9 if I also regress out r154282 and r154283
> so that the FSF libgcc's unwinder is used again. So we are starting
> to peel the layers off of the problem. Your patch definitely should
> go into gcc trunk and gcc 4.4 branch (where it will be immediately
> useful on darwin9 since the libgcc_ext changes don't exist there).

Thanks for testing, Jack. I have checked this patch in to both trunk
and 4.4 branch.

2009-12-09  Bryce McKinlay  <[email protected]>

        PR java/41991
        * configure.ac (SYSTEMSPEC): Pass -allow_stack_execute to Darwin
        linker.
        * Makefile.am (gij_LDFLAGS): Remove extra_gij_ldflags.
        * configure: Regenerate.
        * Makefile.in: Regenerate.

Bryce
libjava-darwin-stack.patch (application/octet-stream, 5.6 KB)
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 155110)
+++ Makefile.in	(working copy)
@@ -819,7 +819,6 @@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
-extra_gij_ldflags = @extra_gij_ldflags@
 extra_ldflags = @extra_ldflags@
 extra_ldflags_libjava = @extra_ldflags_libjava@ $(am__append_9)
 gcc_suffix = @gcc_suffix@
@@ -8499,8 +8498,7 @@
 	$(am__append_28)
 gij_SOURCES = 
 gij_LDFLAGS = -rpath $(dbexecdir) -rpath $(toolexeclibdir) \
-	-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags) \
-	$(extra_gij_ldflags) 
+	-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
 
 gij_LINK = $(GCJLINK) $(gij_LDFLAGS)
 gij_LDADD = -L$(here)/.libs libgij.la
Index: configure.ac
===================================================================
--- configure.ac	(revision 155110)
+++ configure.ac	(working copy)
@@ -889,6 +889,9 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
+    *-*-darwin[[912]]*)
+      SYSTEMSPEC="-allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
@@ -919,9 +922,6 @@
     # on Darwin -single_module speeds up loading of the dynamic libraries.
     extra_ldflags_libjava=-Wl,-single_module
     ;;
-*-*-darwin[[912]]*)
-    extra_gij_ldflags=-Wl,-allow_stack_execute
-    ;;
 arm*linux*eabi)
     # Some of the ARM unwinder code is actually in libstdc++.  We
     # could in principle replicate it in libgcj, but it's better to
@@ -935,7 +935,6 @@
     ;;
 esac
 AC_SUBST(extra_ldflags_libjava)
-AC_SUBST(extra_gij_ldflags)
 AC_SUBST(extra_ldflags)
 AC_SUBST(LIBSTDCXXSPEC)
 
Index: include/Makefile.in
===================================================================
--- include/Makefile.in	(revision 155110)
+++ include/Makefile.in	(working copy)
@@ -283,7 +283,6 @@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
-extra_gij_ldflags = @extra_gij_ldflags@
 extra_ldflags = @extra_ldflags@
 extra_ldflags_libjava = @extra_ldflags_libjava@
 gcc_suffix = @gcc_suffix@
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 155110)
+++ ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2009-12-09  Bryce McKinlay  <[email protected]>
+
+	PR java/41991  
+	* configure.ac (SYSTEMSPEC): Pass -allow_stack_execute to Darwin
+	linker.
+	* Makefile.am (gij_LDFLAGS): Remove extra_gij_ldflags.
+	* configure: Regenerate.  
+	* Makefile.in: Regenerate.
+
 2009-12-08  Eric Botcazou  <[email protected]>
 
 	* configure.host (sparc*-sun-solaris2.*): New case.
Index: testsuite/Makefile.in
===================================================================
--- testsuite/Makefile.in	(revision 155110)
+++ testsuite/Makefile.in	(working copy)
@@ -258,7 +258,6 @@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
-extra_gij_ldflags = @extra_gij_ldflags@
 extra_ldflags = @extra_ldflags@
 extra_ldflags_libjava = @extra_ldflags_libjava@
 gcc_suffix = @gcc_suffix@
Index: configure
===================================================================
--- configure	(revision 155110)
+++ configure	(working copy)
@@ -704,7 +704,6 @@
 LIBGCJTESTSPEC
 LIBSTDCXXSPEC
 extra_ldflags
-extra_gij_ldflags
 extra_ldflags_libjava
 X_EXTRA_LIBS
 X_LIBS
@@ -13245,7 +13244,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13248 "configure"
+#line 13247 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13351,7 +13350,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13354 "configure"
+#line 13353 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19216,7 +19215,7 @@
   enableval=$enable_sjlj_exceptions; :
 else
   cat > conftest.$ac_ext << EOF
-#line 19219 "configure"
+#line 19218 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -19546,6 +19545,9 @@
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
+    *-*-darwin[912]*)
+      SYSTEMSPEC="-allow_stack_execute"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
@@ -20297,9 +20299,6 @@
     # on Darwin -single_module speeds up loading of the dynamic libraries.
     extra_ldflags_libjava=-Wl,-single_module
     ;;
-*-*-darwin[912]*)
-    extra_gij_ldflags=-Wl,-allow_stack_execute
-    ;;
 arm*linux*eabi)
     # Some of the ARM unwinder code is actually in libstdc++.  We
     # could in principle replicate it in libgcj, but it's better to
@@ -20318,7 +20317,6 @@
 
 
 
-
 # Allow the GC to be disabled.  Can be useful when debugging.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for garbage collector to use" >&5
 $as_echo_n "checking for garbage collector to use... " >&6; }
Index: gcj/Makefile.in
===================================================================
--- gcj/Makefile.in	(revision 155110)
+++ gcj/Makefile.in	(working copy)
@@ -283,7 +283,6 @@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
-extra_gij_ldflags = @extra_gij_ldflags@
 extra_ldflags = @extra_ldflags@
 extra_ldflags_libjava = @extra_ldflags_libjava@
 gcc_suffix = @gcc_suffix@
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 155110)
+++ Makefile.am	(working copy)
@@ -1065,8 +1065,7 @@
 ## need this because we are explicitly using libtool to link using the
 ## `.la' file.
 gij_LDFLAGS = -rpath $(dbexecdir) -rpath $(toolexeclibdir) \
-	-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags) \
-	$(extra_gij_ldflags) 
+	-shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
 gij_LINK = $(GCJLINK) $(gij_LDFLAGS)
 ## See jv_convert_LDADD.
 gij_LDADD = -L$(here)/.libs libgij.la
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.