This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
"tail +140" no longer works.
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 26 Feb 2009 06:41:42 +0000
- Subject: "tail +140" no longer works.
Hello all,
I got a nasty error running make check (on cygwin 1.7:
Running /usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp ...
ERROR: tcl error sourcing
/usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp.
ERROR: tail: cannot open `+140' for reading: No such file or directory
while executing
"exec tail +140 tmpdir/ld2 >tmpdir/ld2tail"
("foreach" body line 117)
invoked from within
"foreach flags {"" "strip" "--static" "--traditional-format"
"--no-keep-memory" "--relax"} {
set do_strip "no"
if {"$flags" == "strip"}..."
(file "/usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp"
line 38)
invoked from within
"source /usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source
/usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
Running /usr/build/src-binutils/ld/testsuite/ld-cdtest/cdtest.exp ...
$ tail --version
tail (GNU coreutils) 7.0
Turns out that the official syntax for tail is changed, and the unadorned
"+N" format is no longer allowed. See, e.g.
https://bugzilla.redhat.com/show_bug.cgi?id=175907
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471264
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=339085
and for the official word from the Gnu's mouth:
http://www.gnu.org/software/coreutils/faq/#Old-tail-plus-N-syntax-now-fails
The attached patch takes the simplest option of adding an explicit '-n'
single-letter option, and I need a portability expert to review and comment on
whether that form is accepted everywhere, or whether to use sed or an autoconf
test.
Tested with no regressions natively on i686-pc-cygwin (platform affected by
bug) and i686-pc-linux-gnu (older coreutils accepting old syntax). On cygwin:
=== ld Summary ===
-# of expected passes 64
-# of unexpected failures 7
+# of expected passes 69
+# of unexpected failures 8
# of expected failures 3
# of unresolved testcases 1
# of unsupported tests 2
-/usr/build/obj-binutils/ld/ld-new 2.19.51.20090226
+/usr/build/obj-binutils-autoimportpatched/ld/ld-new 2.19.51.20090226
Ok for HEAD? Or not owing to portability issues?
ld/testsuite/ChangeLog
* ld-bootstrap/bootstrap.exp: Replace obsolete "tail" usage.
cheers,
DaveK
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-bootstrap/bootstrap.exp,v
retrieving revision 1.15
diff -u -p -r1.15 bootstrap.exp
--- ld/testsuite/ld-bootstrap/bootstrap.exp 6 Jul 2007 14:09:42 -0000 1.15
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 26 Feb 2009 04:44:23 -0000
@@ -152,8 +152,8 @@ foreach flags {"" "strip" "--static" "--
# Although this works, a way to set the date would be better.
# Removing or zeroing the date stamp in the binary produced by
# the linker is not possible as it is required by the target OS.
- exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
- exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
+ exec tail -n +140 tmpdir/ld2 >tmpdir/ld2tail
+ exec tail -n +140 tmpdir/ld3 >tmpdir/ld3tail
catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
exec rm tmpdir/ld2tail tmpdir/ld3tail
} else {