]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Download source only on remote host
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 29 Apr 2016 13:50:33 +0000 (06:50 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 29 Apr 2016 13:52:55 +0000 (06:52 -0700)
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.

ld/ChangeLog
ld/testsuite/config/default.exp
ld/testsuite/lib/ld-lib.exp

index c4ded9283e82f34797451d02bdef1ac3e0afba87..aecf58162cf369ab4119b5783880454598c866d8 100644 (file)
@@ -1,3 +1,14 @@
+2016-04-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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  <hongjiu.lu@intel.com>
 
        * testsuite/ld-elf/compressed1b.d: Only run for Linux/GNU targets.
index 2c41ff2ee6bdc306ee4cacb256f2edc299d7f6d5..8ccad111b5f930bcd4b599e34471657301a410c0 100644 (file)
@@ -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
index 88afc5afb5ef9b2e92f16394e203945080a2fc76..9333f52ebd4f2e2da68122d9afce3762b828a86a 100644 (file)
@@ -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" ""]