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?