Looking at the results of the tests executed by plugin.exp on x86_64 Fedora 10, I don't see any evidence that -rdynamic is ever used. Can't we reduce the tests performed as follow since only -shared appears to be actually used? Removing these tests would eliminate all of the problems with not having 'nm -D' or objdump on different hosts. Jack ps I understand we are removing the test for exported symbols but isn't that understood to be satisfied when -shared is used?
Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 158645) +++ gcc/configure.ac (working copy) @@ -4425,24 +4425,6 @@ pluginlibs= if test x"$enable_plugin" = x"yes"; then - 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 - : # No need to use a flag - else - 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 - plugin_rdynamic=yes - pluginlibs="-rdynamic" - else - plugin_rdynamic=no - enable_plugin=no - fi - AC_MSG_RESULT([$plugin_rdynamic]) - fi - # Check -ldl saved_LIBS="$LIBS" AC_SEARCH_LIBS([dlopen], [dl]) @@ -4453,7 +4435,14 @@ # Check that we can build shared objects with -fPIC -shared saved_LDFLAGS="$LDFLAGS" - 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]) AC_TRY_LINK( [extern int X;],[return X == 0;], @@ -4470,7 +4459,7 @@ if test x"$default_plugin" != x"yes"; then AC_MSG_ERROR([ Building GCC with plugin support requires a host that supports --fPIC, -shared, -ldl and -rdynamic.]) +-fPIC, -shared and -ldl.]) fi fi fi