This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] libjava, darwin - don't pass -allow_stack_execute for -dynamiclib or -bundle
- From: Peter O'Gorman <peter at pogma dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 07 Jun 2010 09:12:03 -0500
- Subject: [PATCH] libjava, darwin - don't pass -allow_stack_execute for -dynamiclib or -bundle
Hi,
When running the recently released libtool-2.2.8 testsuite on
x86_64-apple-darwin10 with gcc-4.5, I noticed that a couple of tests
failed. One of them was:
./convenience.at:275: $LIBTOOL --tag=GCJ --mode=link $GCJ $GCJFLAGS
$LDFLAGS -o liba12.la liba1.la liba2.la -rpath /notexist
stderr:
ld: -allow_stack_execute option can only be used when linking a main
executable
collect2: ld returned 1 exit status
stdout:
libtool: link: gcj -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o
.libs/liba12.0.dylib -Wl,-force_load,./.libs/liba1.a
-Wl,-force_load,./.libs/liba2.a -L/sw/lib -install_name
/notexist/liba12.0.dylib -compatibility_version 1 -current_version 1.0
-Wl,-single_module
./convenience.at:275: exit code was 1, expected 0
This patch limits adding -allow_stack_execute to cases without
-dynamiclib or -bundle.
Tested on x86_64-apple-darwin10, no java regressions, and tested that
gcj can successfully create a dylib and bundle.
Ok for trunk?
2010-06-07 Peter O'Gorman <peter@pogma.com>
* configure.ac: Set SYSTEMSPEC so that -allow_stack_execute is not
passed to the linker for -dynamiclib or -bundle on darwin.
* configure: Regenerate.
Peter
Index: configure
===================================================================
--- configure (revision 160376)
+++ configure (working copy)
@@ -19761,7 +19761,7 @@
fi
;;
*-*-darwin[912]*)
- SYSTEMSPEC="-allow_stack_execute"
+ SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;;
*)
SYSTEMSPEC=
Index: configure.ac
===================================================================
--- configure.ac (revision 160376)
+++ configure.ac (working copy)
@@ -883,7 +883,7 @@
fi
;;
*-*-darwin[[912]]*)
- SYSTEMSPEC="-allow_stack_execute"
+ SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
;;
*)
SYSTEMSPEC=