binutils-gdb/ld/testsuite/ld-ifunc
Sandra Loosemore 44ed80923a Use better test for usable compiler in ld testsuite.
The ld testsuite includes numerous tests that depend on being able to
compile and link programs with the C compiler.  Some of these tests
use [which $CC] to check for the presence of the compiler before
proceeding with the test, but run_ld_link_exec_tests and run_cc_link_tests
give ERRORs if compilation fails.  Also, even if $CC is defined and present,
it may not be usable due to missing libraries, etc.

This patch adds a new procedure check_compiler_available that attempts
to build an empty program and caches the result.  Uses of [which $CC]
are replaced with calls to this procedure, and run_ld_link_exec_tests
and run_cc_link_tests now also guard attempts to use $CC.

2019-04-24  Sandra Loosemore  <sandra@codesourcery.com>

	ld/
	* testsuite/config/default.exp: Use [check_compiler_available]
	instead of [which $CC].
	* testsuite/ld-auto-import/auto-import.exp: Likewise.
	* testsuite/ld-cygwin/exe-export.exp: Likewise.
	* testsuite/ld-elf/audit.exp: Likewise.
	* testsuite/ld-elf/compress.exp: Likewise.
	* testsuite/ld-elf/dwarf.exp: Likewise.
	* testsuite/ld-elf/elf.exp: Likewise.
	* testsuite/ld-elf/indirect.exp: Likewise.
	* testsuite/ld-elf/linux-x86.exp: Likewise.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-elf/tls.exp: Likewise.
	* testsuite/ld-elf/wrap.exp: Likewise.
	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-gc/gc.exp: Likewise.
	* testsuite/ld-i386/i386.exp: Likewise.
	* testsuite/ld-i386/no-plt.exp: Likewise.
	* testsuite/ld-i386/tls.exp: Likewise.
	* testsuite/ld-ifunc/ifunc.exp: Likewise.
	* testsuite/ld-mn10300/mn10300.exp: Likewise.
	* testsuite/ld-pe/pe-compile.exp: Likewise.
	* testsuite/ld-pe/pe-run.exp: Likewise.
	* testsuite/ld-pe/pe-run2.exp: Likewise.
	* testsuite/ld-pie/pie.exp: Likewise.
	* testsuite/ld-plugin/lto.exp: Likewise.
	* testsuite/ld-plugin/plugin.exp: Likewise.
	* testsuite/ld-scripts/crossref.exp: Likewise.
	* testsuite/ld-sh/sh.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-size/size.exp: Likewise.
	* testsuite/ld-srec/srec.exp: Likewise.
	* testsuite/ld-undefined/undefined.exp: Likewise.
	* testsuite/ld-unique/unique.exp: Likewise.
	* testsuite/ld-x86-64/mpx.exp: Likewise.
	* testsuite/ld-x86-64/no-plt.exp: Likewise.
	* testsuite/ld-x86-64/tls.exp: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Call
	check_compiler_available before trying to use the compiler.
	(run_cc_link_tests): Likewise.
	(check_compiler_available): New.  Use it instead of [which $CC].
2019-04-24 12:14:56 -07:00
..
binutils.exp Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
dummy.c
ifunc-1-local-x86.d i386: Update IFUNC tests for PLT address 2018-02-16 09:32:56 -08:00
ifunc-1-local-x86.map
ifunc-1-local-x86.s
ifunc-1-x86.d i386: Update IFUNC tests for PLT address 2018-02-16 09:32:56 -08:00
ifunc-1-x86.map
ifunc-1-x86.s
ifunc-2-i386-now.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-2-i386.s
ifunc-2-local-i386-now.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-local-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-2-local-i386.s
ifunc-2-local-x86-64-now.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-local-x86-64.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-local-x86-64.s
ifunc-2-x86-64-now.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-x86-64.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ifunc-2-x86-64.s
ifunc-3-x86.s
ifunc-3a-x86.d i386: Update IFUNC tests for PLT address 2018-02-16 09:32:56 -08:00
ifunc-3b-x86.d
ifunc-4-local-x86.d
ifunc-4-local-x86.s
ifunc-4-x86.d
ifunc-4-x86.s
ifunc-4a-x86.d
ifunc-5-i386.s
ifunc-5-local-i386.s
ifunc-5-local-x86-64.s
ifunc-5-x86-64.s
ifunc-5a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5a-local-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5a-local-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5b-local-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5b-local-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5r-local-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-5r-local-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-6-i386.s
ifunc-6-x86-64.s
ifunc-6a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-6a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-6b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-6b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-7-i386.s
ifunc-7-x86-64.s
ifunc-7a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-7a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-7b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-7b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-8-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-8-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-8a-i386.s
ifunc-8a-x86-64.s
ifunc-8b-i386.s
ifunc-8b-x86-64.s
ifunc-9-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-9-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-9-x86.s
ifunc-10-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-10-i386.s
ifunc-10-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-10-x86-64.s
ifunc-11-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-11-i386.s
ifunc-11-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-11-x86-64.s
ifunc-12-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-12-i386.s
ifunc-12-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-12-x86-64.s
ifunc-13-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-13-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-13a-i386.s
ifunc-13a-x86-64.s
ifunc-13b-i386.s
ifunc-13b-x86-64.s
ifunc-14a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14a.s
ifunc-14b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14b.s
ifunc-14c-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14c-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14c.s
ifunc-14d-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14d-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14e-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14e-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14f-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-14f-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-15-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-15-i386.s
ifunc-15-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-15-x86-64.s
ifunc-16-i386-now.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-16-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-16-x86-64-now.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-16-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-16-x86.s
ifunc-17a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-17a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-17a.s
ifunc-17b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-17b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-17b.s
ifunc-18a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-18a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-18a.s
ifunc-18b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-18b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-18b.s
ifunc-19a-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-19a-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-19a.s
ifunc-19b-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-19b-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-19b.s
ifunc-20-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-20-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-20.s
ifunc-21-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-21-i386.s
ifunc-21-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-21-x86-64.s
ifunc-22-i386.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-22-i386.s
ifunc-22-x86-64.d ld: Skip some x86 IFUNC tests for NaCl targets 2018-05-28 08:12:50 -07:00
ifunc-22-x86-64.s
ifunc-23-x86.s
ifunc-23a-x86.d
ifunc-23b-x86.d
ifunc-23c-x86.d
ifunc-24-x86.s
ifunc-24a-x86.d
ifunc-24b-x86.d
ifunc-24c-x86.d
ifunc-25-x86.s
ifunc-25a-x86.d
ifunc-25b-x86.d
ifunc-25c-x86.d
ifunc-26.d ld: Unify STT_GNU_IFUNC handling 2018-05-28 08:15:21 -07:00
ifunc-26.s ld: Unify STT_GNU_IFUNC handling 2018-05-28 08:15:21 -07:00
ifunc-common-1.out
ifunc-common-1a.c
ifunc-common-1b.c
ifunc-lib.c
ifunc-main.c
ifunc-main.out
ifunc.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ifuncmod5.d Fix Sparc, s390 and AArch64 targets so that they can handle relocs against ifunc symbols found in note sections. 2018-03-09 14:37:36 +00:00
ifuncmod5.s Fix Sparc, s390 and AArch64 targets so that they can handle relocs against ifunc symbols found in note sections. 2018-03-09 14:37:36 +00:00
lib.c
pass.out
pr16467.out
pr16467a.c
pr16467a.map
pr16467b.c
pr16467b.map
pr16467c.c
pr17154-i386-now.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
pr17154-i386.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
pr17154-x86-64-now.d ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
pr17154-x86-64.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
pr17154-x86.s
pr18808.out
pr18808a.c
pr18808b.c
pr18841.out
pr18841a.c
pr18841b.c
pr18841c.c
pr23169a.c x86; Allow IFUNC pointer defined in PDE 2018-05-14 03:55:50 -07:00
pr23169a.rd Build ifunc tests when non-native 2018-06-18 22:00:32 +09:30
pr23169b.c x86; Allow IFUNC pointer defined in PDE 2018-05-14 03:55:50 -07:00
pr23169b.rd Build ifunc tests when non-native 2018-06-18 22:00:32 +09:30
pr23169c.c x86; Allow IFUNC pointer defined in PDE 2018-05-14 03:55:50 -07:00
pr23169c.rd Build ifunc tests when non-native 2018-06-18 22:00:32 +09:30
prog.c
test-1.c
test-2.c