public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* "tail +140" no longer works.
@ 2009-02-26  6:32 Dave Korn
  2009-02-27  2:16 ` Alan Modra
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Korn @ 2009-02-26  6:32 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]


    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



[-- Attachment #2: ld-bootstrap-tail-usage-patch.diff --]
[-- Type: text/plain, Size: 1001 bytes --]

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 {


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-02-26  6:32 "tail +140" no longer works Dave Korn
@ 2009-02-27  2:16 ` Alan Modra
  2009-03-02 14:58   ` Nick Clifton
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Modra @ 2009-02-27  2:16 UTC (permalink / raw)
  To: Dave Korn; +Cc: binutils

On Thu, Feb 26, 2009 at 06:41:42AM +0000, Dave Korn wrote:
> 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 {
> 

It seems very odd to me that we are skipping 140 lines.  tail -c +140
makes more sense, which is one past external_PEI_filehdr.f_timdat.
However, I think you will need to skip PEAOUTHDR.CheckSum as well, so
tail -c +220.

Hmm, during configure I see
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
I wonder can you use that somehow?  Err, it's interesting that the
default is "tail +16c" which doesn't work the latest coreutils, so
maybe you have something to fix there too...

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-02-27  2:16 ` Alan Modra
@ 2009-03-02 14:58   ` Nick Clifton
  2009-03-04 11:54     ` Dave Korn
  2009-03-13  4:31     ` Dave Korn
  0 siblings, 2 replies; 12+ messages in thread
From: Nick Clifton @ 2009-03-02 14:58 UTC (permalink / raw)
  To: Dave Korn; +Cc: binutils

Hi Dave,

>> 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 {

> It seems very odd to me that we are skipping 140 lines.  tail -c +140
> makes more sense, which is one past external_PEI_filehdr.f_timdat.
> However, I think you will need to skip PEAOUTHDR.CheckSum as well, so
> tail -c +220.

I agree with Alan.  Can you confirm whether "tail -c 220" works or not ? 
  It might even be better to use "tail --bytes=220" for more clarity.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-02 14:58   ` Nick Clifton
@ 2009-03-04 11:54     ` Dave Korn
  2009-03-13  4:31     ` Dave Korn
  1 sibling, 0 replies; 12+ messages in thread
From: Dave Korn @ 2009-03-04 11:54 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Dave Korn, binutils

Nick Clifton wrote:
> Hi Dave,
> 
>>> 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 {
> 
>> It seems very odd to me that we are skipping 140 lines.  tail -c +140
>> makes more sense, which is one past external_PEI_filehdr.f_timdat.
>> However, I think you will need to skip PEAOUTHDR.CheckSum as well, so
>> tail -c +220.
> 
> I agree with Alan.  Can you confirm whether "tail -c 220" works or not ?
>  It might even be better to use "tail --bytes=220" for more clarity.

  Hi guys: just to let you know I haven't given up on this, but since it's a
mere testsuite artifact, I've prioritised it low in the current series of
patches I'm generating.  Please either ping me here in a week, or file a PR
and assign it to me, so I don't forget.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-02 14:58   ` Nick Clifton
  2009-03-04 11:54     ` Dave Korn
@ 2009-03-13  4:31     ` Dave Korn
  2009-03-16  6:39       ` Alan Modra
  1 sibling, 1 reply; 12+ messages in thread
From: Dave Korn @ 2009-03-13  4:31 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Dave Korn, binutils

Nick Clifton wrote:
> Hi Dave,
> 
>>> 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 {
> 
>> It seems very odd to me that we are skipping 140 lines.  tail -c +140
>> makes more sense, which is one past external_PEI_filehdr.f_timdat.
>> However, I think you will need to skip PEAOUTHDR.CheckSum as well, so
>> tail -c +220.
> 
> I agree with Alan.  Can you confirm whether "tail -c 220" works or not ?
>  It might even be better to use "tail --bytes=220" for more clarity.

  Confirmed that "tail -c +140" fails and "tail -c +220" (note '+'
accidentally omitted in Nick's post) works perfectly.

  How portable is this though?  I'm a bit out of date but I seem to remember
Solaris having a quirky set of command-line options.  Should we consider an
alternative solution using some/any/all of od/sed/grep-v maybe?

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-13  4:31     ` Dave Korn
@ 2009-03-16  6:39       ` Alan Modra
  2009-03-16 22:30         ` Dave Korn
  2009-03-16 23:08         ` Dave Korn
  0 siblings, 2 replies; 12+ messages in thread
From: Alan Modra @ 2009-03-16  6:39 UTC (permalink / raw)
  To: Dave Korn; +Cc: Nick Clifton, binutils

On Fri, Mar 13, 2009 at 04:41:02AM +0000, Dave Korn wrote:
>   Confirmed that "tail -c +140" fails and "tail -c +220" (note '+'
> accidentally omitted in Nick's post) works perfectly.
> 
>   How portable is this though?  I'm a bit out of date but I seem to remember
> Solaris having a quirky set of command-line options.  Should we consider an
> alternative solution using some/any/all of od/sed/grep-v maybe?

Why don't we leave someone else to worry about portability, and use
gcc's bootstrap compare?  It isn't exactly easy to use, but after
quite some fiddling around I managed to get it all working.  The
difficulty is that do_compare is intended for use as a shell command
and has embedded $f1 and $f2 variable expansions.  I found these were
getting lost inside runtest or expect somewhere, so opted to simply
remove the '$' rather than trying to get quoting right to pass it down
unchanged to the ld testsuite tcl functions.

ld/
	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
	* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
ld/testsuite/
	* ld-bootstrap/bootstrap.exp: Use DO_COMPARE.  Remove unnecessary
	cleanup and log output.

Index: ld/configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.58
diff -u -p -r1.58 configure.in
--- ld/configure.in	3 Feb 2009 15:54:05 -0000	1.58
+++ ld/configure.in	16 Mar 2009 05:41:52 -0000
@@ -125,6 +125,7 @@ AM_PROG_LEX
 
 AM_MAINTAINER_MODE
 AM_CONDITIONAL(GENINSRC_NEVER, false)
+ACX_PROG_CMP_IGNORE_INITIAL
 
 . ${srcdir}/configure.host
 
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.261
diff -u -p -r1.261 Makefile.am
--- ld/Makefile.am	3 Mar 2009 02:41:14 -0000	1.261
+++ ld/Makefile.am	16 Mar 2009 05:41:42 -0000
@@ -1767,6 +1767,7 @@ check-DEJAGNU: site.exp
 		CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
 		OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
 		LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
+		DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \
 		$(RUNTESTFLAGS); \
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
 	fi
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	16 Mar 2009 05:52:47 -0000
@@ -137,8 +137,6 @@ foreach flags {"" "strip" "--static" "--
 	}
     }
 
-    send_log "compare (tail of) tmpdir/ld2 tmpdir/ld3\n"
-    verbose  "compare (tail of) tmpdir/ld2 tmpdir/ld3"
     if {[istarget "*-*-pe"]
 	|| [istarget "*-*-wince"]
 	|| [istarget "*-*-cygwin*"]
@@ -147,19 +145,19 @@ foreach flags {"" "strip" "--static" "--
 	|| [istarget "*-*-interix*"]
 	|| [istarget "*-*-beospe*"]
 	|| [istarget "*-*-netbsdpe*"]} {
-        # Trim off the date present in PE binaries by only looking
-        #   at the ends of the files
-        # 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
-        catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
-        exec rm tmpdir/ld2tail tmpdir/ld3tail
+	# Trim off the date present in PE binaries by only looking
+	#   at the ends of the files
+	# 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.
+	set do_compare [string map {16 220 f1 tmpdir/ld2 f2 tmpdir/ld3 tmp-foo1 tmpdir/ld2tail tmp-foo2 tmpdir/ld3tail} $DO_COMPARE]
+	send_log "$do_compare\n"
+	verbose  "$do_compare"
+	catch "exec [concat sh -c [list $do_compare]]" exec_output
     } else {
-        send_log "cmp tmpdir/ld2 tmpdir/ld3\n"
-        verbose  "cmp tmpdir/ld2 tmpdir/ld3"
-        catch "exec cmp tmpdir/ld2 tmpdir/ld3" exec_output
+	send_log "cmp tmpdir/ld2 tmpdir/ld3\n"
+	verbose  "cmp tmpdir/ld2 tmpdir/ld3"
+	catch "exec cmp tmpdir/ld2 tmpdir/ld3" exec_output
     }
     set exec_output [prune_warnings $exec_output]
 
@@ -174,4 +172,4 @@ foreach flags {"" "strip" "--static" "--
 }
 
 catch "exec rm -f tmpdir/ld-partial.o tmpdir/ld1 tmpdir/ld2 tmpdir/ld3" status
-catch "exec rm -f tmpdir/ld1tail tmpdir/ld2tail tmpdir/ld3tail" status
+catch "exec rm -f tmpdir/ld2tail tmpdir/ld3tail" status

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-16  6:39       ` Alan Modra
@ 2009-03-16 22:30         ` Dave Korn
  2009-03-16 22:39           ` Dave Korn
  2009-03-16 23:08         ` Dave Korn
  1 sibling, 1 reply; 12+ messages in thread
From: Dave Korn @ 2009-03-16 22:30 UTC (permalink / raw)
  To: Dave Korn, Nick Clifton, binutils

Alan Modra wrote:

> ld/
> 	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
> 	* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
> 	* aclocal.m4: Regenerate.
> 	* configure: Regenerate.
> 	* Makefile.in: Regenerate.

  Doh.  Where is the procedure documented, again?  Innocently cd'ing into the
ld subdir and typing 'aclocal' gives me this warning:

$ aclocal
aclocal:configure.in:96: warning: macro `AM_BINUTILS_WARNINGS' not found in
library

... and then completely replaces the contents of aclocal.m4 with the contents
of libtool.m4!  I have the right versions IIUC:

$ automake --version
automake (GNU automake) 1.9.6

$ autoconf --version
autoconf (GNU Autoconf) 2.59

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-16 22:30         ` Dave Korn
@ 2009-03-16 22:39           ` Dave Korn
  2009-03-16 22:45             ` Dave Korn
  0 siblings, 1 reply; 12+ messages in thread
From: Dave Korn @ 2009-03-16 22:39 UTC (permalink / raw)
  To: Dave Korn; +Cc: Nick Clifton, binutils

Dave Korn wrote:
> Alan Modra wrote:
> 
>> ld/
>> 	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
>> 	* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
>> 	* aclocal.m4: Regenerate.
>> 	* configure: Regenerate.
>> 	* Makefile.in: Regenerate.
> 
>   Doh.  Where is the procedure documented, again?  

  Nevermind, I worked it out:

aclocal -I ../config -I .. -I ../bfd

  Once you get that right, automake and autoconf go smoothly.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-16 22:39           ` Dave Korn
@ 2009-03-16 22:45             ` Dave Korn
  0 siblings, 0 replies; 12+ messages in thread
From: Dave Korn @ 2009-03-16 22:45 UTC (permalink / raw)
  To: Dave Korn; +Cc: binutils

Dave Korn wrote:
> Dave Korn wrote:
>> Alan Modra wrote:
>>
>>> ld/
>>> 	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
>>> 	* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
>>> 	* aclocal.m4: Regenerate.
>>> 	* configure: Regenerate.
>>> 	* Makefile.in: Regenerate.
>>   Doh.  Where is the procedure documented, again?  
> 
>   Nevermind, I worked it out:
> 
> aclocal -I ../config -I .. -I ../bfd

  For anyone who might stumble upon this post in future:

http://sourceware.org/ml/binutils/2007-03/msg00122.html

contains the excellent advice "you always want to match ACLOCAL_AMFLAGS from
Makefile.am".  (The rest of the thread is instructive, too.)  So I got .. and
../config the wrong way round there:

$ grep ACLOCAL_AMFLAGS Makefile.in
ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
        cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)


... and that may well be important, because when I regenerated it with the
includes in the correct order, the generated aclocal.m4 was slightly different:

$ diff -pu a1 aclocal.m4
--- a1  2009-03-16 22:52:50.515625000 +0000
+++ aclocal.m4  2009-03-16 22:53:30.500000000 +0000
@@ -974,11 +974,6 @@ AC_SUBST([am__untar])

 m4_include([../bfd/acinclude.m4])
 m4_include([../bfd/warning.m4])
-m4_include([../libtool.m4])
-m4_include([../ltoptions.m4])
-m4_include([../ltsugar.m4])
-m4_include([../ltversion.m4])
-m4_include([../lt~obsolete.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/extensions.m4])
@@ -989,3 +984,8 @@ m4_include([../config/override.m4])
 m4_include([../config/po.m4])
 m4_include([../config/proginstall.m4])
 m4_include([../config/progtest.m4])
+m4_include([../libtool.m4])
+m4_include([../ltoptions.m4])
+m4_include([../ltsugar.m4])
+m4_include([../ltversion.m4])
+m4_include([../lt~obsolete.m4])

$

  FYI, FTR, HTH etc!

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-16  6:39       ` Alan Modra
  2009-03-16 22:30         ` Dave Korn
@ 2009-03-16 23:08         ` Dave Korn
  2009-03-17  5:34           ` Alan Modra
  1 sibling, 1 reply; 12+ messages in thread
From: Dave Korn @ 2009-03-16 23:08 UTC (permalink / raw)
  To: Dave Korn, binutils

Alan Modra wrote:

> Why don't we leave someone else to worry about portability, and use
> gcc's bootstrap compare?  

  WFM :)

> ld/
> 	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
> 	* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
> 	* aclocal.m4: Regenerate.
> 	* configure: Regenerate.
> 	* Makefile.in: Regenerate.
> ld/testsuite/
> 	* ld-bootstrap/bootstrap.exp: Use DO_COMPARE.  Remove unnecessary
> 	cleanup and log output.


  Verified on Cygwin, thanks for the patch!

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-16 23:08         ` Dave Korn
@ 2009-03-17  5:34           ` Alan Modra
  2009-03-17  5:57             ` Dave Korn
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Modra @ 2009-03-17  5:34 UTC (permalink / raw)
  To: Dave Korn; +Cc: binutils

On Mon, Mar 16, 2009 at 11:18:12PM +0000, Dave Korn wrote:
>   Verified on Cygwin, thanks for the patch!

Committed with a small change.  The concat wasn't really necessary.

While poking in this area I found another problem.  ld/Makefile uses
HOSTING_LIBS and HOSTING_CRT to perform a ld bootstrap.  This hasn't
worked for a very long time.

ld/
	* configure.host (HOSTING_LIBS): Two dollars on shell variable
	expansion to suit make.
ld/testsuite
	* config/default.exp (get_link_files): Replace double dollars with
	single dollars.

Index: ld/configure.host
===================================================================
RCS file: /cvs/src/src/ld/configure.host,v
retrieving revision 1.46
diff -u -p -r1.46 configure.host
--- ld/configure.host	28 Aug 2007 11:02:55 -0000	1.46
+++ ld/configure.host	17 Mar 2009 05:01:44 -0000
@@ -10,7 +10,7 @@
 
 HDEFINES=
 HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; if [ -f ../gcc/libunwind.a ]; then libgcc="$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$libunwind" != xlibunwind.a ]; then libgcc="$libgcc $libunwind"; fi; fi; echo --start-group $libgcc -lc --end-group`'
+HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$$libgcc $$libgcc_eh"; fi; fi; if [ -f ../gcc/libunwind.a ]; then libgcc="$$libgcc ../gcc/libunwind.a"; else libunwind=\`${CC} -print-file-name=libunwind.a\`; if [ x"$$libunwind" != xlibunwind.a ]; then libgcc="$$libgcc $$libunwind"; fi; fi; echo --start-group $$libgcc -lc --end-group`'
 
 #
 #	Generic configurations:
Index: ld/testsuite/config/default.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/config/default.exp,v
retrieving revision 1.13
diff -u -p -r1.13 default.exp
--- ld/testsuite/config/default.exp	28 Aug 2007 13:21:57 -0000	1.13
+++ ld/testsuite/config/default.exp	17 Mar 2009 05:01:45 -0000
@@ -115,9 +115,17 @@ proc get_link_files {varname} {
     global srcdir
     global CC
     if ![info exists $varname] {
-	set status [catch "exec sh -c \"host='$target_triplet' && CC='$CC' && . $srcdir/../configure.host && eval echo \\$$varname\"" result]
+	#configure.host returns variables that can be substituted into
+	#makefile rules, with embedded shell variable expansions.
+	#make wants $$shell_var, we want $shell_var ...
+	set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <<EOF\n\$$varname\nEOF"
+	set status [catch "exec sh -c [list $cmd]" result]
+	if $status { error "Error getting native link files: $result" }
+	set cmd "CC='$CC' && eval echo \"$result\""
+	set status [catch "exec sh -c [list $cmd]" result]
 	if $status { error "Error getting native link files: $result" }
 	set $varname $result
+	send_log "$varname = $result\n"
     }
 }
 

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: "tail +140" no longer works.
  2009-03-17  5:34           ` Alan Modra
@ 2009-03-17  5:57             ` Dave Korn
  0 siblings, 0 replies; 12+ messages in thread
From: Dave Korn @ 2009-03-17  5:57 UTC (permalink / raw)
  To: Dave Korn, binutils

Alan Modra wrote:

> While poking in this area I found another problem.  ld/Makefile uses
> HOSTING_LIBS and HOSTING_CRT to perform a ld bootstrap.  This hasn't
> worked for a very long time.

  Ah, I noticed those definitions when I was looking for somewhere to add
-liconv, but I didn't see there was a problem with them!  They only come into
play for cross-compilation, don't they?

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-03-17  5:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-26  6:32 "tail +140" no longer works Dave Korn
2009-02-27  2:16 ` Alan Modra
2009-03-02 14:58   ` Nick Clifton
2009-03-04 11:54     ` Dave Korn
2009-03-13  4:31     ` Dave Korn
2009-03-16  6:39       ` Alan Modra
2009-03-16 22:30         ` Dave Korn
2009-03-16 22:39           ` Dave Korn
2009-03-16 22:45             ` Dave Korn
2009-03-16 23:08         ` Dave Korn
2009-03-17  5:34           ` Alan Modra
2009-03-17  5:57             ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).