libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: solaris link line length problem == buggy sed


From: Gary V . Vaughan
Subject: Re: solaris link line length problem == buggy sed
Date: Wed, 18 Jul 2001 01:11:29 +0100

On Wednesday 18 July 2001 12:33 am, Robert Boehne wrote:
> Alex Hornby wrote:
> > My earlier link line truncation problem on solaris was not due to
> > command line length restrictions (getconf reports a healthy 109kb for
> > ARG_MAX).
> >
> > Solaris 2.6 /usr/bin/sed, as used by libtool during the link, has
> > problems with "long" lines of > 3999 characters, truncating them as it
> > sees fit.
> >
> > By putting GNU sed ahead of solaris sed on my PATH the build succeeds.
> >
> > Should libtool work around such broken sed's during the build phase,
> > and would patches be considered that did this?
> >
> > Regards,
> > Alex.
>
> Ok, I'm trying to write a macro for libtool.m4 that will check for
> bugs such as this one in sed.  However, if I create a file inline
> with 8202 characters on one line, Linux bash segfaults!
> It does work under IRIX and Solaris, so my approach seems OK.
> Here is what it basically does:
>
>   cat > conftest.$ac_ext <<EOF
> XXXXXXXXXX<SNIP 8200 'X' characters>
> EOF
>   sed 's/Y/Z/g' conftest.$ac_ext > conftest.out
>   lt_cv_buggy_sed="yes"
>   cmp conftest.$ac_ext conftest.out >/dev/null && lt_cv_buggy_sed="no"
> 2>&1
>   ls -al conftest.$ac_ext conftest.out
>   cat conftest.$ac_ext
> fi
>
> Since bash 1.14.7 under Linux (Redhat 6.2) seems to have a
> problem with such a long inline file, is there a way to
> concatenate a character or characters into a file without
> adding newlines?

The easiest way to do it without tripping over echo non-portabilities is:

  echo | tr '\010' X >> file

Ofcourse tr has some issues of its own, so you might prefer:

  echo | awk '{ printf "X"; }' >> file

But then you have to find a suitable awk binary in your PATH, so maybe 
testing which of the following leaves no droppings and use that:

  echo -n X
  echo 'X\c'
  echo -e 'X\c'

Which takes us back to the start.  Go round a few times, and get off at your 
favourite stop =)O|

> Granted, I can simply skip this if GNU sed is found, but
> I'm sure it will come up again on some other sed/shell
> combination.

This is really an autoconf macro, since it has applicability beyond what 
libtool needs...

Cheers,
        Gary.
-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]