This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][RevisedX4 - PR43715 - Fix --enable-plugin on darwin - trunk version

Currently the --enable-plugin configure option fails on darwin because
the exported symbol tests require objdump, which is missing on that platform,
and the required usage of "-undefined dynamic_lookup" is missing from
the linkages on darwin. This patch solves these issues by substituting
"$gcc_cv_nm -g" for the exported symbol tests on darwin and "$gcc_cv_nm -D"
otherwise and adding "-undefined dynamic_lookup" on darwin to the
linkages. Bootstrapped and regression tested on x86_64-apple-darwin10
and x86_64 Fedora 10 linux using gcc-4_5-branch. 
  Okay for gcc trunk and gcc 4.5.1?
ps We really want this in gcc 4.5.1 as the dragon-egg developers
would rather work with llvm svn and the stable FSF gcc release.

2010-04-21  Jack Howarth <>

        PR 43715
	* gcc/ Use "$gcc_cv_nm -g" on darwin and
	"$gcc_cv_nm -D" otherwise instead of $gcc_cv_objdump.
	Use "-undefined dynamic_lookup" on darwin.
        * gcc/configure: Regenerate.
	* testsuite/lib/plugin-support.exp: Use "-undefined
	dynamic_lookup" on darwin.

Index: gcc/testsuite/lib/plugin-support.exp
--- gcc/testsuite/lib/plugin-support.exp	(revision 158624)
+++ gcc/testsuite/lib/plugin-support.exp	(working copy)
@@ -88,6 +88,10 @@
     set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
+    if { [ ishost *-*-darwin* ] } {
+        set optstr [concat $optstr "-undefined dynamic_lookup"]
+    }
     # Temporarily switch to the environment for the plugin compiler.
     set status [remote_exec build "$PLUGINCC $PLUGINCFLAGS $plugin_src $optstr -o $plugin_lib"]
Index: gcc/
--- gcc/	(revision 158624)
+++ gcc/	(working copy)
@@ -4456,15 +4456,23 @@
 if test x"$enable_plugin" = x"yes"; then
+  case "${host}" in
+    *-*-darwin*)
+      export_sym_check="$gcc_cv_nm -g"
+    ;;
+    *)
+      export_sym_check="$gcc_cv_nm -D"
+    ;;
+  esac
   AC_MSG_CHECKING([for exported symbols])
   echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
   ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest > /dev/null 2>&1
-  if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
+  if $export_sym_check conftest | grep foobar > /dev/null; then
     : # No need to use a flag
     AC_MSG_CHECKING([for -rdynamic])
     ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest > /dev/null 2>&1
-    if $gcc_cv_objdump -T conftest | grep foobar > /dev/null; then
+    if $export_sym_check conftest | grep foobar > /dev/null; then
@@ -4484,7 +4492,14 @@
   # Check that we can build shared objects with -fPIC -shared
-  LDFLAGS="$LDFLAGS -fPIC -shared"
+  case "${host}" in
+    *-*-darwin*)
+      LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
+    ;;
+    *)
+      LDFLAGS="$LDFLAGS -fPIC -shared"
+    ;;
+  esac
   AC_MSG_CHECKING([for -fPIC -shared])
     [extern int X;],[return X == 0;],

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]