# emitted, 0 otherwise.
proc check_effective_target_shared { } {
+ # Darwin's linker defaults to error on undefined (which makes it look as
+ # if we do not support shared) but we can tell it to allow the symbols used
+ # here to be undefined.
+ set extra_flags ""
+ if { [istarget *-*-darwin\[912\]*] } {
+ set extra_flags "-Wl,-U,_foo,-U,_bar,-U,__Z3foov"
+ }
# Note that M68K has a multilib that supports -fpic but not
# -fPIC, so we need to check both. We test with a program that
# requires GOT references.
return [check_no_compiler_messages shared executable {
extern int foo (void); extern int bar;
int baz (void) { return foo () + bar; }
- } "-shared -fpic"]
+ } "-shared -fpic $extra_flags"]
}
# Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise.