if [istarget *-*-linux*] {
if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
- if [ld_link $ld $tmpdir/main "$tmpdir/main.o"] {
+ if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] {
catch "exec $tmpdir/main" support_protected
}
}
# The test procedure.
proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
- global ld
+ global CC
global srcdir
global subdir
global exec_output
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
}
- if {![ld_simple_link $ld $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
+ if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
if { [ string match $visibility "hidden_undef" ]
&& [regexp ".*/sh1.c.*: undefined reference to \`visibility\'" $link_output]
&& [regexp ".*/sh1.c.*: undefined reference to \`visibility_var\'" $link_output] } {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
set rpath /lib:$tmpdir
}
- if ![ld_link $ld $tmpdir/$progname "-rpath $rpath $tmpdir/$main $tmpdir/$progname.so"] {
+ if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
if { [ string match $visibility "hidden" ]
&& [regexp ".*/main.c.*: undefined reference to \`visibility\'" $link_output]
&& [regexp ".*/main.c.*: undefined reference to \`visibility_var\'" $link_output] } {
} else {
setup_xfail "*-*-sunos4*"
}
- if { [ string match $visibility "hidden_weak" ]
- || [ string match $visibility "protected_weak" ] } {
- setup_xfail "powerpc-*-linux*"
- }
# Non-pic code uses name binding rules for applications to
# reference variables by gp-relative relocs, which can't be
} else {
setup_xfail "*-*-sunos4*"
}
- if { [ string match $visibility "hidden_weak" ]
- || [ string match $visibility "protected_weak" ] } {
- setup_xfail "powerpc-*-linux*"
- }
if { ![ string match $visibility "hidden_undef" ]
&& ![ string match $visibility "protected_undef" ] } {
setup_xfail "ia64-*-linux*"