binutils-gdb/ld/testsuite/ld-sh
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
..
arch Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
adjsw8.s Fix PR10378 which is SH relax bug. 2014-08-01 19:13:39 +09:00
fdpic-funcdesc-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-funcdesc-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-funcdesc-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-funcdesc-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesc-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesc-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesc-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesc-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesci20-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesci20-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesci20-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotfuncdesci20-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-goti20-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-goti20-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-goti20-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-goti20-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesc-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesc-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesc-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesc-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesci20-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesci20-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesci20-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotofffuncdesci20-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotoffi20-shared.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotoffi20-shared.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotoffi20-static.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-gotoffi20-static.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-plt-be.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-plt-le.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-plt.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-plti20-be.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-plti20-le.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-stack-default.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-stack-set.d bfd/ 2012-10-23 09:33:56 +00:00
fdpic-stack-size.d 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
fdpic-stack.s 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com> 2010-05-25 14:12:43 +00:00
ld-r-1.d Remove sh5 and sh64 support 2018-04-16 15:29:39 +09:30
ldr1.s * ld-sh/rd-sh.exp: New framework file. 2001-10-14 15:18:11 +00:00
ldr2.s * ld-sh/rd-sh.exp: New framework file. 2001-10-14 15:18:11 +00:00
rd-sh.exp Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
refdbg-0-dso.d PR 11225 2010-01-28 15:25:20 +00:00
refdbg-1.d * elf32-sh.c (sh_elf_relocate_section): Don't complain about 2002-11-28 08:37:15 +00:00
refdbg.s * ld-discard/extern.s, ld-discard/start.s, ld-discard/static.s, 2003-04-13 14:42:22 +00:00
refdbglib.s * elf32-sh.c (sh_elf_relocate_section): Don't complain about 2002-11-28 08:37:15 +00:00
reloc1.d bfd/ 2006-08-04 13:13:56 +00:00
reloc1.s bfd/ 2006-08-04 13:13:56 +00:00
sh-vxworks.exp Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
sh.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
sh1.s Fix PR10373 which is SH relax bug. 2014-08-01 19:17:47 +09:00
sh2.c
shared-1.d readelf ngettext fixes 2017-11-07 17:01:16 +10:30
shared-2.d Support different ld --hash-style in the ld testsuite 2017-08-07 22:10:51 +09:30
start.s
sub2l-1.d bfd/ 2012-06-06 10:50:18 +00:00
sub2l.s * ld-sh/rd-sh.exp: New framework file. 2001-10-14 15:18:11 +00:00
textrel1.s * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here. 2003-08-02 13:46:44 +00:00
textrel2.s * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here. 2003-08-02 13:46:44 +00:00
tlsbin-0-dso.d * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlsbin-1.d * ld-sh/tlsbin-1.d: Update. 2006-10-20 15:16:44 +00:00
tlsbin-2.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
tlsbin-3.d Adjust for dynamic sym changes. 2005-08-15 15:39:48 +00:00
tlsbin-4.d Adjust for dynamic sym changes. 2005-08-15 15:39:48 +00:00
tlsbin.s * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlsbinpic.s * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlslib.s * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlspic-1.d * ld-sh/tlsbin-1.d: Update. 2006-10-20 15:16:44 +00:00
tlspic-2.d Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
tlspic-3.d * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlspic-4.d * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlspic1.s * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlspic2.s * ld-sh/rd-sh.exp: If the test matches *-dso.d, copy the output 2002-10-11 14:44:55 +00:00
tlstpoff-1.d * ld-sh/tlsbin-1.d: Update. 2006-10-20 15:16:44 +00:00
tlstpoff-2.d * elf32-sh.c (tpoff): New. 2003-04-24 05:19:09 +00:00
tlstpoff1.s * ld-sh/tlstpoff-1.d: New. 2003-02-10 22:19:26 +00:00
tlstpoff2.s * ld-sh/tlstpoff-1.d: New. 2003-02-10 22:19:26 +00:00
vxworks1-le.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks1-lib-le.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks1-lib.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks1-lib.nd Tolerate some whitespace differences in readelf output. 2009-09-23 03:12:28 +00:00
vxworks1-lib.rd ld/testsuite/ 2007-05-15 12:22:34 +00:00
vxworks1-lib.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks1-lib.td ld/testsuite/ 2007-05-15 12:22:34 +00:00
vxworks1-static.d ld error/warning messages 2018-02-26 10:51:12 +10:30
vxworks1.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks1.ld ld/testsuite/ 2007-05-15 12:22:34 +00:00
vxworks1.rd bfd/ 2006-08-04 13:13:56 +00:00
vxworks1.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks2-static.sd bfd/ 2006-08-04 13:13:56 +00:00
vxworks2.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks2.sd bfd/ 2006-08-04 13:13:56 +00:00
vxworks3-le.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks3-lib-le.dd bfd/ 2006-08-04 13:13:56 +00:00
vxworks3-lib.dd bfd/ 2006-08-04 13:13:56 +00:00
vxworks3-lib.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks3.dd ld/testsuite/ 2007-05-14 12:07:11 +00:00
vxworks3.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks4.d bfd/ 2006-08-04 13:13:56 +00:00
vxworks4a.s bfd/ 2006-08-04 13:13:56 +00:00
vxworks4b.s bfd/ 2006-08-04 13:13:56 +00:00
weak1.d bfd/ 2012-06-06 10:50:18 +00:00
weak1.s * ld-sh/rd-sh.exp: New framework file. 2001-10-14 15:18:11 +00:00