From: H.J. Lu Date: Fri, 29 Apr 2016 13:50:33 +0000 (-0700) Subject: Download source only on remote host X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=010f98a5859620001aed9f27f213ed681c73a59a;p=binutils-gdb.git Download source only on remote host There is no need to download source if we aren't on remote host. Otherwise, each ld test run on local host leaves behind a couple test files. * config/default.exp (NOPIE_CFLAGS): Download source only on remote host. (NOPIE_LDFLAGS): Likewise. * testsuite/lib/ld-lib.exp (check_lto_available): Likewise. (check_lto_fat_available): Likewise. (check_lto_shared_available): Likewise. (check_ifunc_available): Likewise. (check_ifunc_attribute_available): Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index c4ded9283e8..aecf58162cf 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +2016-04-29 H.J. Lu + + * config/default.exp (NOPIE_CFLAGS): Download source only on + remote host. + (NOPIE_LDFLAGS): Likewise. + * testsuite/lib/ld-lib.exp (check_lto_available): Likewise. + (check_lto_fat_available): Likewise. + (check_lto_shared_available): Likewise. + (check_ifunc_available): Likewise. + (check_ifunc_attribute_available): Likewise. + 2016-04-27 H.J. Lu * testsuite/ld-elf/compressed1b.d: Only run for Linux/GNU targets. diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 2c41ff2ee6b..8ccad111b5f 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -302,7 +302,9 @@ if { ![info exists PLT_CFLAGS] } then { set f [open $src "w"] puts $f "" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set plt_available [run_host_cmd_yesno "$CC" "$flags -c -fplt $src -o $output"] remote_file host delete $src remote_file host delete $output @@ -338,7 +340,9 @@ if { ![info exists NOPIE_CFLAGS] || ![info exists NOPIE_LDFLAGS] } then { set f [open $src "w"] puts $f "int main (void) { return 0; }" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set nopie_available [run_host_cmd_yesno "$CC" "$flags -fno-PIE -no-pie $src -o $output"] remote_file host delete $src remote_file host delete $output diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 88afc5afb5e..9333f52ebd4 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1819,7 +1819,9 @@ proc check_lto_available { } { set f [open $src "w"] puts $f "int main() { return 0; }" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set lto_available_saved [run_host_cmd_yesno "$CC" "$flags -flto -fuse-linker-plugin $src -o $output"] remote_file host delete $src remote_file host delete $output @@ -1860,7 +1862,9 @@ proc check_lto_fat_available { } { set f [open $src "w"] puts $f "int main() { return 0; }" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set lto_fat_available_saved [run_host_cmd_yesno "$CC" "$flags -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"] remote_file host delete $src remote_file host delete $output @@ -1901,7 +1905,9 @@ proc check_lto_shared_available { } { set f [open $src "w"] puts $f "" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set lto_shared_available_saved [run_host_cmd_yesno "$CC" "$flags -shared -fPIC -flto -fuse-linker-plugin $src -o $output"] remote_file host delete $src remote_file host delete $output @@ -1971,7 +1977,9 @@ proc check_ifunc_available { } { puts $f "void *foo (void) { return library_func1; }" puts $f "__asm__(\".type library_func2, %gnu_indirect_function\");" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set ifunc_available_saved [run_host_cmd_yesno "$CC" "$flags $src -o $output"] if { $ifunc_available_saved == 1 } { set ifunc_available_saved [run_host_cmd_yesno "$output" ""] @@ -2016,7 +2024,9 @@ proc check_ifunc_attribute_available { } { puts $f "static int library_func1 (void) {return 2; }" puts $f "void *foo (void) { return library_func1; }" close $f - remote_download host $src + if [is_remote host] { + set src [remote_download host $src] + } set ifunc_attribute_available_saved [run_host_cmd_yesno "$CC" "$flags $src -o $output"] if { $ifunc_attribute_available_saved == 1 } { set ifunc_attribute_available_saved [run_host_cmd_yesno "$output" ""]