Ensure ld testsuite gcc -B options precede $CC -B options
authorAlan Modra <amodra@gmail.com>
Mon, 7 Jul 2014 04:07:16 +0000 (13:37 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 7 Jul 2014 04:07:16 +0000 (13:37 +0930)
commitf1d7f4a64c4d92911127abe6dbab95a219405c2b
tree9f5cc8a957f131c1677e483402a301914b0ac66c
parentf60ec1cfa8f5e8aa27ffc5db5a344b5db2efe97b
Ensure ld testsuite gcc -B options precede $CC -B options

Various ld-elf/shared.exp and ld-plugin/lto.exp tests simply appended
the testsuite -B options intended to force gcc use the linker under test.
This fails if $CC itself has -B options, as when setting CC to run gcc
out of a build directory.  Net result is that tests were run using
the gcc build dir collect-ld.

* config/default.exp: Don't make tmpdir/gas.  Put as symlink into
tmpdir/ld.
(gcc_gas_flag, gcc_ld_flag): Delete.
(gcc_B_opt, ld_L_opt): New globals.
ld-elf/shared.exp: Remove all refs to gcc_gas_flag and gcc_ld_flag.
ld-plugin/lto.exp: Likewise.
lib/ld-lib.exp (run_host_cmd): Add gcc_B_opt and ld_L_opt here.
(ld_simple_link): Remove -B handling now that this is done in
run_host_cmd.  Simplify.
(default_ld_compile): Simplify.
(check_lto_available): Use run_host_cmd_yesno.
(check_lto_shared_available): Likewise.
ld/testsuite/ChangeLog
ld/testsuite/config/default.exp
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/lib/ld-lib.exp