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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22895 in the body.
You can then email your comments to 22895 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#22895; Package libtool. (Thu, 03 Mar 2016 10:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael <mhofma <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Thu, 03 Mar 2016 10:26:02 GMT) Full text and rfc822 format available.

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

From: Michael <mhofma <at> googlemail.com>
To: bug-libtool <at> gnu.org
Subject: broken handling of spaces after -{L,R,l}
Date: Thu, 3 Mar 2016 09:40:39 +0100
[Message part 1 (text/plain, inline)]
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
[libtool_fix_space_handling.patch (text/x-patch, attachment)]

Information forwarded to bug-libtool <at> gnu.org:
bug#22895; Package libtool. (Fri, 04 Mar 2016 06:15:02 GMT) Full text and rfc822 format available.

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
>




Information forwarded to bug-libtool <at> gnu.org:
bug#22895; Package libtool. (Fri, 04 Mar 2016 16:33:02 GMT) Full text and rfc822 format available.

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

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

Yes, but only half. Your patch fixes only the missing "x"s in the tests,
but not the missing test for "-l".


Best regards,
Michael





Reply sent to Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>:
You have taken responsibility. (Mon, 21 Oct 2024 17:59:02 GMT) Full text and rfc822 format available.

Notification sent to Michael <mhofma <at> googlemail.com>:
bug acknowledged by developer. (Mon, 21 Oct 2024 17:59:02 GMT) Full text and rfc822 format available.

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

From: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>
To: 22895-done <at> debbugs.gnu.org
Cc: Michael <mhofma <at> googlemail.com>
Subject: Re: bug#22895: broken handling of spaces after -{L,R,l}
Date: Mon, 21 Oct 2024 20:56:22 +0300
[Message part 1 (text/plain, inline)]
Thank you for your bug report and patch. It was addressed in this bug
report [1], and it was patched in this commit [2].

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60731
[2] 
https://git.savannah.gnu.org/cgit/libtool.git/commit/?id=fb617e2ba0809218486323823b74f706cedd9aac

-- 
Ileana Dumitrescu

GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354

[OpenPGP_0x6570EA01146F7354.asc (application/pgp-keys, attachment)]
[OpenPGP_signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Nov 2024 12:24:29 GMT) Full text and rfc822 format available.

This bug report was last modified 171 days ago.

Previous Next


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