This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[PATCH] Fix two ERROR:s in binutils objcopy testing on Cygwin.


    Hi all,

  The objcopy tests repeatedly remote_download a test executable to $build.
When testing locally on Cygwin, this fails with:

Version /usr/build/obj-binutils/binutils/objcopy 2.19.51.20090401
ERROR: remote_download to build of tmpdir/copyprog to tmpdir/striprog: cp:
cannot create regular file `tmpdir/striprog': File exists
ERROR: remote_download to build of tmpdir/copyprog to tmpdir/striprog: cp:
cannot create regular file `tmpdir/striprog': File exists

  Cygwin depends on the underlying windows filesystem behaviour, which differs
from POSIX in one important respect; you can't replace a file while you still
have an open handle on it.  I think this must somehow be getting caused when
doing a remote_download to the local machine, because deleting the destination
file before calling remote_download certainly solves the problem.

  Tested on i686-pc-cygwin with two new PASSes and on i686-pc-linux-gnu with
no regressions.  Ok?

binutils/testsuite/ChangeLog

	* binutils-all/objcopy.exp (strip_executable):  Delete remote dest
	file before downloading.
	(strip_executable_with_saving_a_symbol):  Likewise.
	(keep_debug_symbols_and_test_copy):  Likewise.


    cheers,
      DaveK
Index: binutils/testsuite/binutils-all/objcopy.exp
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/objcopy.exp,v
retrieving revision 1.54
diff -p -u -r1.54 objcopy.exp
--- binutils/testsuite/binutils-all/objcopy.exp	10 Mar 2009 00:48:10 -0000	1.54
+++ binutils/testsuite/binutils-all/objcopy.exp	2 Apr 2009 07:09:09 -0000
@@ -611,6 +611,7 @@ proc strip_executable { prog flags test 
     global NMFLAGS
     global host_triplet
 
+    remote_file build delete tmpdir/striprog
     remote_download build tmpdir/copyprog tmpdir/striprog
     if [is_remote host] {
 	set copyfile [remote_download host tmpdir/striprog]
@@ -653,6 +654,7 @@ proc strip_executable_with_saving_a_symb
     global NMFLAGS
     global host_triplet
 
+    remote_file build delete tmpdir/striprog
     remote_download build tmpdir/copyprog tmpdir/striprog
     if [is_remote host] {
 	set copyfile [remote_download host tmpdir/striprog]
@@ -704,6 +706,7 @@ proc keep_debug_symbols_and_test_copy { 
     global NM
     global NMFLAGS
 
+    remote_file build delete tmpdir/striprog
     remote_download build tmpdir/copyprog tmpdir/striprog
     if [is_remote host] {
 	set copyfile [remote_download host tmpdir/striprog]

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