set fails [expr $fails + 1]
}
-# Create pic object file containing unique symbol.
-if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/unique_shared.s" "tmpdir/unique_shared.o"] {
- fail "Could not create a pic unique object"
- set fails [expr $fails + 1]
-}
-
# Create executable containing unique symbol.
if ![ld_link $CC "tmpdir/unique_prog" "tmpdir/unique.o"] {
fail "Could not link a unique executable"
set fails [expr $fails + 1]
}
-# Create shared library containing unique symbol.
-if ![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] {
- fail "Could not create a shared library containing an unique symbol"
- set fails [expr $fails + 1]
-}
-
-# Create executable NOT containing unique symbol linked against library.
-if ![ld_link $CC "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] {
- fail "Could not link a dynamic executable"
- set fails [expr $fails + 1]
-}
-
-# Create shared library containing unique symbol with reference.
-if ![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] {
- fail "Could not create a shared library containing an unique symbol with reference"
- set fails [expr $fails + 1]
-}
-
if { $fails != 0 } {
return
}
pass "Checking empty unique object"
}
+# ------------------------------------------------------------------------------
+# Only shared library tests below.
+# ------------------------------------------------------------------------------
+
+if { ![check_shared_lib_support] } {
+ return
+}
+
+# Create pic object file containing unique symbol.
+if {![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/unique_shared.s" "tmpdir/unique_shared.o"] } {
+ fail "Could not create a pic unique object"
+ set fails [expr $fails + 1]
+}
+
+# Create shared library containing unique symbol.
+if {![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] } {
+ fail "Could not create a shared library containing an unique symbol"
+ set fails [expr $fails + 1]
+}
+
+# Create executable NOT containing unique symbol linked against library.
+if {![ld_link $CC "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } {
+ fail "Could not link a dynamic executable"
+ set fails [expr $fails + 1]
+}
+
+# Create shared library containing unique symbol with reference.
+if {![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] } {
+ fail "Could not create a shared library containing an unique symbol with reference"
+ set fails [expr $fails + 1]
+}
+
+if { $fails != 0 } {
+ return
+}
+
# Check the unique PIC file.
if {! [check_osabi tmpdir/unique_shared.o {UNIX - GNU}]} {
fail "PIC Object containing unique does not have an OS/ABI field of GNU"