gdb/testsuite/
authorYao Qi <yao@codesourcery.com>
Thu, 18 Jul 2013 22:38:58 +0000 (22:38 +0000)
committerYao Qi <yao@codesourcery.com>
Thu, 18 Jul 2013 22:38:58 +0000 (22:38 +0000)
* 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.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 473c326add6099b1baf290bc663b1f3f782d7c1a..77b50fae3cf6444cc8b4af5a25a4f6b66acc1255 100644 (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>
 
        * gdb.threads/tls-nodebug.c: Call pthread_testcancel
index fc9b0712bbc9857d570561bbe63c129089a2cfef..70b797e711b96b3710ffa697603a0b1e2da4a57e 100644 (file)
@@ -2788,8 +2788,13 @@ proc gdb_compile_shlib {sources dest options} {
 
           if { ([istarget "*-*-mingw*"]
                 || [istarget *-*-cygwin*]
-                || [istarget *-*-pe*])} {
-              lappend link_options "additional_flags=-Wl,--out-implib,${dest}.a"
+                || [istarget *-*-pe*]) } {
+              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] {
             # By default, we do not set the soname.  This causes the linker
             # on ELF systems to create a DT_NEEDED entry in the executable
@@ -2805,7 +2810,16 @@ proc gdb_compile_shlib {sources dest options} {
        if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} {
            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