gdb/testsuite/

* lib/gdb.exp (gdb_compile_shlib): Pass the tail name of
	$dest to link options if host is remote.  Move the
	generated file to $dest.a on host if host is remote.
This commit is contained in:
Yao Qi
2013-07-18 22:38:58 +00:00
parent faf786e668
commit a075c3e55b
2 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-07-19 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (gdb_compile_shlib): Pass the tail name of
$dest to link options if host is remote. Move the
generated file to $dest.a on host if host is remote.
2013-07-18 Will Newton <will.newton@linaro.org> 2013-07-18 Will Newton <will.newton@linaro.org>
* gdb.threads/tls-nodebug.c: Call pthread_testcancel * gdb.threads/tls-nodebug.c: Call pthread_testcancel

View File

@ -2789,7 +2789,12 @@ proc gdb_compile_shlib {sources dest options} {
if { ([istarget "*-*-mingw*"] if { ([istarget "*-*-mingw*"]
|| [istarget *-*-cygwin*] || [istarget *-*-cygwin*]
|| [istarget *-*-pe*]) } { || [istarget *-*-pe*]) } {
lappend link_options "additional_flags=-Wl,--out-implib,${dest}.a" if { [is_remote host] } {
set name [file tail ${dest}]
} else {
set name ${dest}
}
lappend link_options "additional_flags=-Wl,--out-implib,${name}.a"
} elseif [is_remote target] { } elseif [is_remote target] {
# By default, we do not set the soname. This causes the linker # By default, we do not set the soname. This causes the linker
# on ELF systems to create a DT_NEEDED entry in the executable # on ELF systems to create a DT_NEEDED entry in the executable
@ -2805,8 +2810,17 @@ proc gdb_compile_shlib {sources dest options} {
if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} { if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} {
return -1 return -1
} }
if { [is_remote host]
&& ([istarget "*-*-mingw*"]
|| [istarget *-*-cygwin*]
|| [istarget *-*-pe*]) } {
set dest_tail_name [file tail ${dest}]
remote_upload host $dest_tail_name.a ${dest}.a
remote_file host delete $dest_tail_name.a
} }
} }
return ""
}
# This is just like gdb_compile_shlib, above, except that it tries compiling # This is just like gdb_compile_shlib, above, except that it tries compiling
# against several different thread libraries, to see which one this # against several different thread libraries, to see which one this