binutils-gdb/ld/testsuite/ld-elfvers
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
..
vers1.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers1.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers1.map
vers1.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers1.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers2.c
vers2.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers2.map
vers2.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers3.c
vers3.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers3.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers4.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers4.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers4a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers4a.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers4a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers5.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers6.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers6.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers6.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers6.ver
vers7.c
vers7.map
vers7a.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers7a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers7a.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers7a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers8.c
vers8.map
vers8.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers9.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers9.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers9.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers9.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers13.asym
vers15.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers15.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers15.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers15.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers16.c
vers16.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers16.map
vers16a.c
vers16a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers16a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers17.c
vers17.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers17.map
vers17.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers18.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers18.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers18.map
vers18.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers18.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers19.c
vers19.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers19.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers20.c
vers20.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers20.map
vers20.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers20a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers21.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers21.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers21.map
vers21.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers21.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers22.c
vers22.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers22.map
vers22.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers22a.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers22a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers22a.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers22a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers22b.c
vers22b.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers22b.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers23.c
vers23.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers23.ver
vers23a.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers23a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers23a.map
vers23a.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers23a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers23b.c
vers23b.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers23b.map
vers23b.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers23c.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers23d.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers24.map
vers24.rd Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
vers24a.c ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers24b.c
vers24c.c ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers25a.c
vers25a.dsym * ld-elfvers/vers25a.dsym: Really include _? in match. 2010-12-11 12:58:36 +00:00
vers25a.map
vers25a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers25b.c
vers25b.dsym
vers25b.ver
vers26a.c
vers26a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers26a.map
vers26a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers26b.c
vers26b.dsym
vers26b.ver
vers27a.c
vers27a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers27a.map
vers27a.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers27b.c ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers27b.dsym
vers27b.ver
vers27c.c
vers27c.dsym
vers27c.ver
vers27d1.c PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers27d2.c
vers27d3.c
vers27d4.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers27d4.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers27d.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers27d.sym PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30
vers27d.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers28a.c
vers28a.dsym
vers28a.ver
vers28b.c
vers28b.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers28b.map
vers28b.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers28c.c
vers28c.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers28c.ver * ld-elfvers/vers2.ver: Don't assume any particular index for 2011-06-16 00:42:06 +00:00
vers29.c Missed from previous commit. 2004-10-26 21:00:23 +00:00
vers29.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers29.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers30.c * ldgram.y (vers_defns): Don't lose pattern list before 2005-08-17 10:08:30 +00:00
vers30.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers30.map * ldgram.y (vers_defns): Don't lose pattern list before 2005-08-17 10:08:30 +00:00
vers30.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers31.c * ld.texino: Describe double-quoted string syntax for version 2005-10-13 17:29:57 +00:00
vers31.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers31.map * ld.texino: Describe double-quoted string syntax for version 2005-10-13 17:29:57 +00:00
vers31.ver * ld-elfvers/vers.exp (objdump_versionstuff): Allow versions in 2006-06-06 04:30:21 +00:00
vers32.map 2007-07-10 H.J. Lu <hongjiu.lu@intel.com> 2007-07-10 14:51:55 +00:00
vers32a.c 2007-07-10 H.J. Lu <hongjiu.lu@intel.com> 2007-07-10 14:51:55 +00:00
vers32a.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers32a.ver 2007-07-10 H.J. Lu <hongjiu.lu@intel.com> 2007-07-10 14:51:55 +00:00
vers32b.c 2007-07-10 H.J. Lu <hongjiu.lu@intel.com> 2007-07-10 14:51:55 +00:00
vers32b.dsym ld: elfvers tests: support symbol prefixed targets 2010-12-10 06:08:11 +00:00
vers32b.ver 2007-07-10 H.J. Lu <hongjiu.lu@intel.com> 2007-07-10 14:51:55 +00:00
vers.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
vers.h PowerPC64 dot-sym testsuite fixes 2016-12-03 20:59:43 +10:30