URL:
  <https://savannah.gnu.org/patch/?10581>

                 Summary: ltmain.in: improve parsing of "-Wl,-rpath" arguments
                   Group: GNU Libtool
               Submitter: mwhitlock
               Submitted: Thu 25 Jun 2026 02:46:13 AM UTC
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 25 Jun 2026 02:46:13 AM UTC By: Matt Whitlock <mwhitlock>
Libtool means to parse "-Wl,-rpath" options given on the command line to add
their arguments to the 'finalize_rpath' list. However, there are three cases
where the existing parsing logic fails:
1. When the option is passed with its argument in a single "-Wl" flag using
comma separators (e.g., "-Wl,-rpath,/foo"), Libtool was failing to recognize
the option because the pattern "-Wl,-rpath,*" does not match the rewritten
form "-Wl,-rpath -Wl,/foo".
2. When the option is written as a single argument using an equals sign (e.g.,
"-Wl,-rpath=/foo"), Libtool was failing to recognize the option because there
was no case to handle this syntax, despite that this is the syntax documented
in the GNU ld(1) man page!
3. When the option argument is given as a colon-separated list of paths,
either in a separate argument (e.g., "-Wl,-rpath,/foo:/bar" or "-Wl,-rpath
-Wl,/foo:/bar") or as a single argument using an equals sign (e.g.,
"-Wl,-rpath=/foo:/bar"), Libtool was failing to process each path
individually.
This commit fixes up the logic so that _all_ of the following forms are
recognized:
* -Wl,-rpath=/foo
* -Wl,-rpath,/foo
* -Wl,-rpath -Wl,/foo
* -Wl,-rpath=/foo:/bar
* -Wl,-rpath,/foo:/bar
* -Wl,-rpath -Wl,/foo:/bar

I believe this patch may also fix the bug reported
[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24296 here] by Ray Satiro
<raysatiro <at> yahoo.com>.






    _______________________________________________________
File Attachments:

0001-ltmain.in-improve-parsing-of-Wl-rpath-arguments.patch

Name: 0001-ltmain.in-improve-parsing-of-Wl-rpath-arguments.patch Size: 3.5KiB

<https://file.savannah.gnu.org/file/0001-ltmain.in-improve-parsing-of-Wl-rpath-arguments.patch?file_id=58754>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?10581>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to