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.
This commit is contained in:
H.J. Lu 2016-04-29 06:50:33 -07:00
parent d347c9df49
commit 010f98a585
3 changed files with 32 additions and 7 deletions

View 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.

View 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

View 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" ""]