"Fix" strip test failure

Andreas Jaeger aj@suse.de
Mon Apr 30 13:51:00 GMT 2001


Running the testsuite on i686-linux with glibc 2.2 gives the following
error:
/builds/sourceware-src/build-binutils-ln/binutils/strip-new  tmpdir/testprog.o
Executing on host: /builds/sourceware-src/build-binutils-ln/binutils/strip-new  tmpdir/testprog.o   (timeout = 300)
bucomm.o: In function `make_tempname':
/cvs/binutils-gdb-ln/binutils/bucomm.c:246: the use of `mktemp' is dangerous, better use `mkstemp'
bucomm.o: In function `make_tempname':
/cvs/binutils-gdb-ln/binutils/bucomm.c:246: the use of `mktemp' is dangerous, better use `mkstemp'

FAIL: strip

The problem is that libtool rebuilds strip and thereby emits this
warning :-(.

You can check this problem if you run the testsuite twice in the
binutils directory.  The first time it will fail for ld, the second
time not.

What do you think of the appended patch?  Or is there a better
solution?

Andreas

2001-04-30  Andreas Jaeger  <aj@suse.de>

	* testsuite/binutils-all/objcopy.exp (strip_test): Run strip
	--help first to get strip rebuild if necessary and thereby avoid
	spurious failures.

============================================================
Index: binutils/testsuite/binutils-all/objcopy.exp
--- binutils/testsuite/binutils-all/objcopy.exp	2001/03/13 06:43:59	1.8
+++ binutils/testsuite/binutils-all/objcopy.exp	2001/04/30 20:45:58
@@ -329,6 +329,16 @@
 	return
     }
 
+    # This is a hack.  libtool will relink strip and during this
+    # relink we might get (if using glibc 2.2 or newer as C library) a
+    # warning like:
+    # bucomm.o: In function `make_tempname':
+    # bucomm.c:246: the use of `mktemp' is dangerous, better use `mkstemp'
+    # to avoid this, we just call strip here to get it relinked
+    if ![is_remote host] {
+	set exec_output [binutils_run $STRIP "--help"]
+    }
+
     if [is_remote host] {
 	set objfile [remote_download host tmpdir/testprog.o];
     } else {

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Binutils mailing list