set shared_needs_pic "no"
set COMPRESS_LDFLAG "-Wl,--compress-debug-sections=zlib-gabi"
-if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
-
- # AIX shared libraries do not seem to support useful features,
- # like overriding the shared library function or letting the
- # shared library refer to objects defined in the main program. We
- # avoid testing those features.
- set SHCFLAG "-DXCOFF_TEST"
-
- # The AIX 3.2.5 loader appears to randomly fail when loading
- # shared libraries from NSF mounted partitions, so we avoid any
- # potential problems by using a local directory.
- catch {exec /bin/sh -c "echo $$"} pid
- set tmpdir /usr/tmp/ld.$pid
- catch "exec mkdir $tmpdir" exec_status
-
- # On AIX, we need to explicitly export the symbols the shared
- # library is going to provide, and need.
- set file [open $tmpdir/xcoff.exp w]
- puts $file shlibvar1
- puts $file shlibvar2
- puts $file shlib_shlibvar1
- puts $file shlib_shlibvar2
- puts $file shlib_shlibcall
- puts $file shlib_shlibcalled
- puts $file shlib_checkfunptr1
- puts $file shlib_getfunptr1
- puts $file shlib_check
- close $file
-}
-
if [istarget arm*-*-linux*] {
# On ARM section anchors can change the symbol pre-emptability for
# non-PIC shared libraries, causing these tests to fail. Turn section
if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" }
# Build the shared library.
- # On AIX, we need to use an export file.
set shared -shared
- if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
- }
if { [is_elf_format] && [check_shared_lib_support] } {
append shared " -Wl,-z,notext"
}
# Link against the shared library. Use -rpath so that the
# dynamic linker can locate the shared library at runtime.
- # On AIX, we must include /lib in -rpath, as otherwise the loader
- # can not find -lc.
set rpath $tmpdir
- if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- set rpath /lib:$tmpdir
- }
if ![ld_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
if { [ string match $visibility "hidden" ]
&& [regexp "undefined reference to \`\.?visibility\'" $link_output]
if { ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
|| ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
unresolved "visibility ($visibility) (non PIC)"
- } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o xcoff
} else {
# SunOS non PIC shared libraries don't permit some cases of
# overriding.
visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \
mainnp.o sh1np.o sh2np.o elfvsb \
"-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv"
- } }
+ }
# Now compile the code using -fpic.
setup_xfail $target_triplet
}
}
- if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
- } else {
- visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
- }
+ visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
}
}}
} else {
if { [ remote_file host exists $tmpdir/sh1np.o ]
&& [ remote_file host exists $tmpdir/sh2np.o ] } {
- if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
- } else {
- # SunOS non PIC shared libraries don't permit some cases of
- # overriding.
- if { [ string match $visibility "protected" ]
- || [ string match $visibility "protected_undef_def" ] } {
- if [ string match $support_protected "no" ] {
- setup_xfail $target_triplet
- }
- }
- if { ![ string match $visibility "hidden_undef" ]
- && ![ string match $visibility "protected_undef" ] } {
- setup_xfail "ia64-*-linux*"
- setup_xfail "alpha*-*-linux*"
- }
- if { ![ string match $visibility "hidden" ]
- && ![ string match $visibility "hidden_undef" ]
- && ![ string match $visibility "hidden_undef_def" ]
- && ![ string match $visibility "protected_undef" ] } {
- setup_xfail "s390x-*-linux*"
- if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
- setup_xfail "sparc*-*-linux*"
- }
- }
- if { [is_elf64 $tmpdir/mainp.o] } {
- setup_xfail "x86_64-*-linux*"
- }
- setup_xfail "x86_64-*-linux-gnux32"
- if { ![istarget hppa*64*-*-linux*] } {
- setup_xfail "hppa*-*-linux*"
+ # SunOS non PIC shared libraries don't permit some cases of
+ # overriding.
+ if { [ string match $visibility "protected" ]
+ || [ string match $visibility "protected_undef_def" ] } {
+ if [ string match $support_protected "no" ] {
+ setup_xfail $target_triplet
}
- if [ string match $shared_needs_pic "yes" ] {
- setup_xfail "arm*-*-linux*"
+ }
+ if { ![ string match $visibility "hidden_undef" ]
+ && ![ string match $visibility "protected_undef" ] } {
+ setup_xfail "ia64-*-linux*"
+ setup_xfail "alpha*-*-linux*"
+ }
+ if { ![ string match $visibility "hidden" ]
+ && ![ string match $visibility "hidden_undef" ]
+ && ![ string match $visibility "hidden_undef_def" ]
+ && ![ string match $visibility "protected_undef" ] } {
+ setup_xfail "s390x-*-linux*"
+ if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
+ setup_xfail "sparc*-*-linux*"
}
-
- visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
}
+ if { [is_elf64 $tmpdir/mainp.o] } {
+ setup_xfail "x86_64-*-linux*"
+ }
+ setup_xfail "x86_64-*-linux-gnux32"
+ if { ![istarget hppa*64*-*-linux*] } {
+ setup_xfail "hppa*-*-linux*"
+ }
+ if [ string match $shared_needs_pic "yes" ] {
+ setup_xfail "arm*-*-linux*"
+ }
+
+ visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
} else {
unresolved "visibility (PIC main, non PIC so)"
}
setup_xfail $target_triplet
}
}
- if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff
- } else {
- visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb
- }
+ visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb
} else {
unresolved "visibility ($visibility) (PIC main)"
}
}
}
}
-
-if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
- # Remove the temporary directory.
- catch "exec rm -rf $tmpdir" exec_status
-}