# Expect script for various PIE tests.
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# MA 02110-1301, USA.
#
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
-
if { ![istarget *-*-linux*]
&& ![istarget *-*-nacl*]
&& ![istarget *-*-gnu*] } {
return
}
+# Check to see if the C compiler works
+if { ![check_compiler_available] } {
+ return
+}
+
# Check if -pie is supported or not.
send_log "$CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie"
catch "exec $CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output
}
set array_tests {
- {"weak undefined" "-pie" "" {weakundef.c} "weakundef" "weakundef.out" "-fPIC"}
- {"weak undefined data" "-pie" "" {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"}
+ {"weak undefined" "-pie" ""
+ {weakundef.c} "weakundef" "weakundef.out" "-fPIC"}
+ {"weak undefined data" "-pie" ""
+ {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"}
}
run_ld_link_exec_tests $array_tests