This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Remove the directory of DEST in proc gdb_compile_shlib


On 07/18/2013 12:37 AM, Tom Tromey wrote:
> If I understand this properly, it makes the "--out-implib" always be in
> ".".
> 

Yes.

> This seems fine for the remote host case, but for the local host case, I
> think it would be better for the file to appear in the "correct" output
> directory, according to the parallelization work I've been doing.  I
> realize this isn't all done; but it is helpful not to introduce new
> cases to try to fix, and I think easy to do as well.  Here "correct"
> just means making sure it is in the same directory as $dest.
> 

Taking testsuite parallelization into account, this patch may cause the
race when two different test cases produces two libraries with the same
tail name.

> I suspect just checking [is_remote host] would be sufficient here.
> What do you think?

In the remote host testing, there is no such directory structure as it
on build machine.  Probably that is the limitation of running testsuite
in parallel on remote host.  I agree with your suggestion, and add
checking [is_remote host] in the updated patch below.

-- 
Yao (éå)

gdb/testsuite:

2013-07-18  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.
---
 gdb/testsuite/lib/gdb.exp |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 4541126..77fa359 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2792,8 +2792,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
@@ -2809,7 +2814,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
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]