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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ileana Dumitrescu <ileanadumitrescu95 <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#22895: closed (broken handling of spaces after -{L,R,l})
Date: Mon, 21 Oct 2024 17:59:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 21 Oct 2024 20:56:22 +0300
with message-id <33bc5828-6d31-4457-9399-74ada6fe0d20 <at> gmail.com>
and subject line Re: bug#22895: broken handling of spaces after -{L,R,l}
has caused the debbugs.gnu.org bug report #22895,
regarding broken handling of spaces after -{L,R,l}
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
22895: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22895
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
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 6 (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)]

This bug report was last modified 268 days ago.

Previous Next


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