====
:
* configure.ac (*-*-darwin*): Use mh-darwin for all Darwin variants.
* configure: Regenerate.
* config/mh-ppc-darwin: Rename to mh-darwin.
gcc:
* gcc/configure.ac: Filter -mdynamic-no-pic from CFLAGS when testing
for
plugin capabilities.
* gcc/configure: Regenerate.
gcc/testsuite:
* lib/plugin-support.exp (plugin-test-execute): Filter -mdynamic-no-
pic from
plugin build flags on Darwin targets.
===================================================================
@@ -1157,8 +1157,8 @@ case "${host}" in
tentative_cc="/usr/cygnus/progressive/bin/gcc"
host_makefile_frag="config/mh-lynxrs6k"
;;
- powerpc-*-darwin*)
- host_makefile_frag="config/mh-ppc-darwin"
+ *-*-darwin*)
+ host_makefile_frag="config/mh-darwin"
;;
powerpc-*-aix*)
host_makefile_frag="config/mh-ppc-aix"
===================================================================
@@ -4694,11 +4694,15 @@ if test x"$enable_plugin" = x"yes"; then
# Check that we can build shared objects with -fPIC -shared
saved_LDFLAGS="$LDFLAGS"
+ saved_CFLAGS="$CFLAGS"
case "${host}" in
*-*-darwin*)
- LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+ CFLAGS="$CFLAGS -fPIC"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
;;
*)
+ CFLAGS="$CFLAGS -fPIC"
LDFLAGS="$LDFLAGS -fPIC -shared"
;;
esac
@@ -4712,6 +4716,7 @@ if test x"$enable_plugin" = x"yes"; then
enable_plugin=no
fi
LDFLAGS="$saved_LDFLAGS"
+ CFLAGS="$saved_CFLAGS"
# If plugin support had been requested but not available, fail.
if test x"$enable_plugin" = x"no" ; then
===================================================================
@@ -86,15 +86,29 @@ proc plugin-test-execute { plugin_src plugin_tests
-I${gcc_srcdir}/include -I${gcc_srcdir}/libcpp/
include \
$GMPINC -I${gcc_objdir}/intl"
- set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
-
if { [ ishost *-*-darwin* ] } {
- set optstr [concat $optstr "-undefined dynamic_lookup"]
+ # -mdynamic-no-pic is incompatible with -fPIC.
+ set plug_cflags ""
+ foreach op $PLUGINCFLAGS {
+ if { [string compare "-mdynamic-no-pic" $op] } {
+ set plug_cflags [concat $plug_cflags " $op"]
+ }
+ }
+ set optstr "$includes"
+ foreach op $extra_flags {
+ if { [string compare "-mdynamic-no-pic" $op] } {
+ set optstr [concat $optstr " $op"]
+ }
+ }
+ set optstr [concat $optstr "-DIN_GCC -fPIC -shared -undefined
dynamic_lookup"]
+ } else {
+ set plug_cflags $PLUGINCFLAGS
+ set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared"
}
# 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"]
+ set status [remote_exec build "$PLUGINCC $plug_cflags $plugin_src