-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 $optstr -o $plugin_lib"]
set status [lindex $status 0]
set_ld_library_path_env_vars