GNU bug report logs - #22895
broken handling of spaces after -{L,R,l}

Previous Next

Package: libtool;

Reported by: Michael <mhofma <at> googlemail.com>

Date: Thu, 3 Mar 2016 10:26:02 UTC

Severity: normal

Done: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 22895 <at> debbugs.gnu.org (full text, mbox):

From: Gilles Gouaillardet <gilles.gouaillardet <at> gmail.com>
To: Michael <mhofma <at> googlemail.com>
Cc: 22895 <at> debbugs.gnu.org
Subject: Re: bug#22895: broken handling of spaces after -{L,R,l}
Date: Fri, 4 Mar 2016 15:14:40 +0900
That sounds like a duplicate of
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21137

Cheers,

Gilles

On Thu, Mar 3, 2016 at 5:40 PM, Michael <mhofma <at> googlemail.com> wrote:
> Hi,
>
> in m4/libtool.m4, the handling of spaces after -{L,R,l} for parsing
> linker commands looks as follows:
>
>   case $prev$p in
>     -L* | -R* | -l*)
>       # Some compilers place space between "-{L,R}" and the path.
>       # Remove the space.
>       if test x-L = "$p" ||
>          test x-R = "$p"; then
>          prev=$p
>          continue
>       fi
>
> This seems to be broken for two reasons:
> 1. The case handling captures -l, but the following tests consider only
> -L and -R.
> 2. The tests for equality use an x on the left side, but not on the
> right side.
>
> A working code should look as follows (patch is attached):
>
>   case $prev$p in
>     -L* | -R* | -l*)
>       # Some compilers place space between "-{L,R,l}" and the path.
>       # Remove the space.
>       if test x-L = "x$p" ||
>          test x-R = "x$p" ||
>          test x-l = "x$p"; then
>          prev=$p
>          continue
>       fi
>
> I stumbled across this bug when using gfortran (5.3.1) which emits the
> following (valid) line:
>
>   Driving: gfortran -v conftest.o -l gfortran -l m -shared-libgcc
>
> The current (broken) libtool leads to "-l -l" in the "postdeps_FC"
> variable. After the fix, the correct "-lgfortran -lm" appears.
>
>
> Best regards,
> Michael
>
> _______________________________________________
> Bug-libtool mailing list
> Bug-libtool <at> gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-libtool
>




This bug report was last modified 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.