===================================================================
@@ -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.
restore_ld_library_path_env_vars
set status [remote_exec build "$PLUGINCC $PLUGINCFLAGS $plugin_src $optstr -o $plugin_lib"]
===================================================================
@@ -4543,13 +4543,26 @@
pluginlibs=
-if test x$build = x$host; then
- export_sym_check="objdump${exeext} -T"
-elif test x$host = x$target; then
- export_sym_check="$gcc_cv_objdump -T"
-else
- export_sym_check=
-fi
+case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+ export_sym_check="nm${exeext} -g"
+ elif test x$host = x$target; then
+ export_sym_check="$gcc_cv_nm -g"
+ else
+ export_sym_check=
+ fi
+ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+ elif test x$host = x$target; then
+ export_sym_check="$gcc_cv_objdump -T"
+ else
+ export_sym_check=
+ fi
+ ;;
+esac
if test x"$enable_plugin" = x"yes"; then
@@ -4587,7 +4600,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;],