This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH for PR20823] fix invalid "tail +16c"
- From: ma dot jiang at zte dot com dot cn
- To: binutils at sourceware dot org
- Date: Sat, 19 Nov 2016 17:00:00 +0800
- Subject: [PATCH for PR20823] fix invalid "tail +16c"
- Authentication-results: sourceware.org; auth=none
Hi all,
There are some "tail +16c" which is invalid now in binutils configure
system. "tail" now treat operands with leading '+' as file names, as POSIX
has required since 2001. all "tail +16c" should be changed to "tail -c
+16". Ok for trunk?
diff -Nuarp binutils-2.27-org/config/acx.m4 binutils-2.27/config/acx.m4
--- binutils-2.27-org/config/acx.m4 2016-11-15
19:51:36.356123294 +0800
+++ binutils-2.27/config/acx.m4 2016-11-15 22:00:22.446120262
+0800
@@ -404,7 +404,7 @@ AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
[AC_CACHE_CHECK([how to compare bootstrapped objects],
gcc_cv_prog_cmp_skip,
[ echo abfoo >t1
echo cdfoo >t2
- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
+ gcc_cv_prog_cmp_skip='tail -c +16 $$f1 > tmp-foo1; tail -c +16 $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
if cmp t1 t2 2 2 > /dev/null 2>&1; then
if cmp t1 t2 1 1 > /dev/null 2>&1; then
:
diff -Nuarp binutils-2.27-org/configure binutils-2.27/configure
--- binutils-2.27-org/configure 2016-11-15 19:51:36.593123294
+0800
+++ binutils-2.27/configure 2016-11-15 22:00:53.398120204
+0800
@@ -5380,7 +5380,7 @@ if test "${gcc_cv_prog_cmp_skip+set}" =
else
echo abfoo >t1
echo cdfoo >t2
- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
+ gcc_cv_prog_cmp_skip='tail -c +16 $$f1 > tmp-foo1; tail -c +16 $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
if cmp t1 t2 2 2 > /dev/null 2>&1; then
if cmp t1 t2 1 1 > /dev/null 2>&1; then
:
diff -Nuarp binutils-2.27-org/gas/Makefile.am
binutils-2.27/gas/Makefile.am
--- binutils-2.27-org/gas/Makefile.am 2016-11-15
19:51:35.249123294 +0800
+++ binutils-2.27/gas/Makefile.am 2016-11-15
21:58:50.581120252 +0800
@@ -671,14 +671,13 @@ stage3:
against=stage2
-# This rule is derived from corresponding code in the Makefile.in for
gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
+# The "tail -c +16" is to bypass headers which may include timestamps or
# temporary assembly file names.
comparison:
x=0 ; \
for file in *.@OBJEXT@ ; do \
- tail +16c ./$$file > tmp-foo1; \
- if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ;
then \
+ tail -c +16 ./$$file > tmp-foo1; \
+ if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null
; then \
if cmp tmp-foo1 tmp-foo2 ; then \
true ; \
else \
diff -Nuarp binutils-2.27-org/gas/Makefile.in
binutils-2.27/gas/Makefile.in
--- binutils-2.27-org/gas/Makefile.in 2016-11-15
19:51:35.212123294 +0800
+++ binutils-2.27/gas/Makefile.in 2016-11-15
21:58:19.329120266 +0800
@@ -2734,14 +2734,13 @@ stage3:
-mv $(STAGESTUFF) stage3
if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT)
] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
-# This rule is derived from corresponding code in the Makefile.in for
gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
+# The "tail -c +16" is to bypass headers which may include timestamps or
# temporary assembly file names.
comparison:
x=0 ; \
for file in *.@OBJEXT@ ; do \
- tail +16c ./$$file > tmp-foo1; \
- if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ;
then \
+ tail -c +16 ./$$file > tmp-foo1; \
+ if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null
; then \
if cmp tmp-foo1 tmp-foo2 ; then \
true ; \
else \
diff -Nuarp binutils-2.27-org/ld/configure binutils-2.27/ld/configure
--- binutils-2.27-org/ld/configure 2016-11-15
19:51:34.181123294 +0800
+++ binutils-2.27/ld/configure 2016-11-15 19:53:23.037123251
+0800
@@ -16338,7 +16338,7 @@ if test "${gcc_cv_prog_cmp_skip+set}" =
else
echo abfoo >t1
echo cdfoo >t2
- gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
+ gcc_cv_prog_cmp_skip='tail -c +16 $$f1 > tmp-foo1; tail -c +16 $$f2 >
tmp-foo2; cmp tmp-foo1 tmp-foo2'
if cmp t1 t2 2 2 > /dev/null 2>&1; then
if cmp t1 t2 1 1 > /dev/null 2>&1; then
: