[patch #10581] ltmain.in: improve parsing of "-Wl,-rpath" arguments

Matt Whitlock <[email protected]> Wed, 24 Jun 2026 22:46:17 -0400 (EDT)
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
--8323329-1714636915-1782355577=:3609757
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/patch/?10581>=0A=0A                 Summ=
ary: ltmain.in: improve parsing of "-Wl,-rpath" arguments=0A               =
    Group: GNU Libtool=0A               Submitter: mwhitlock=0A            =
   Submitted: Thu 25 Jun 2026 02:46:13 AM UTC=0A                Category: N=
one=0A                Priority: 5 - Normal=0A                  Status: None=
=0A                 Privacy: Public=0A             Assigned to: None=0A    =
    Originator Email:=0A             Open/Closed: Open=0A         Discussio=
n Lock: Unlocked=0A=0A=0A    ______________________________________________=
_________=0A=0AFollow-up Comments:=0A=0A=0A--------------------------------=
-----------------------=0ADate: Thu 25 Jun 2026 02:46:13 AM UTC By: Matt Wh=
itlock <mwhitlock>=0ALibtool means to parse "-Wl,-rpath" options given on t=
he command line to add=0Atheir arguments to the 'finalize_rpath' list. Howe=
ver, there are three cases=0Awhere the existing parsing logic fails:=0A1. W=
hen the option is passed with its argument in a single "-Wl" flag using=0Ac=
omma separators (e.g., "-Wl,-rpath,/foo"), Libtool was failing to recognize=
=0Athe option because the pattern "-Wl,-rpath,*" does not match the rewritt=
en=0Aform "-Wl,-rpath -Wl,/foo".=0A2. When the option is written as a singl=
e argument using an equals sign (e.g.,=0A"-Wl,-rpath=3D/foo"), Libtool was =
failing to recognize the option because there=0Awas no case to handle this =
syntax, despite that this is the syntax documented=0Ain the GNU ld(1) man p=
age!=0A3. When the option argument is given as a colon-separated list of pa=
ths,=0Aeither in a separate argument (e.g., "-Wl,-rpath,/foo:/bar" or "-Wl,=
-rpath=0A-Wl,/foo:/bar") or as a single argument using an equals sign (e.g.=
,=0A"-Wl,-rpath=3D/foo:/bar"), Libtool was failing to process each path=0Ai=
ndividually.=0AThis commit fixes up the logic so that _all_ of the followin=
g forms are=0Arecognized:=0A* -Wl,-rpath=3D/foo=0A* -Wl,-rpath,/foo=0A* -Wl=
,-rpath -Wl,/foo=0A* -Wl,-rpath=3D/foo:/bar=0A* -Wl,-rpath,/foo:/bar=0A* -W=
l,-rpath -Wl,/foo:/bar=0A=0AI believe this patch may also fix the bug repor=
ted=0A[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24296 here] by Ray S=
atiro=0A<raysatiro <at> yahoo.com>.=0A=0A=0A=0A=0A=0A=0A    _______________=
________________________________________=0AFile Attachments:=0A=0A0001-ltma=
in.in-improve-parsing-of-Wl-rpath-arguments.patch=0A=0AName: 0001-ltmain.in=
-improve-parsing-of-Wl-rpath-arguments.patch Size: 3.5KiB=0A=0A<https://fil=
e.savannah.gnu.org/file/0001-ltmain.in-improve-parsing-of-Wl-rpath-argument=
s.patch?file_id=3D58754>=0A=0A=0A=0A    AGPL NOTICE=0A=0AThese attachments =
are served by Savane. You can download the corresponding=0Asource code of S=
avane at=0Ahttps://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7=
fd30e48f9142870.tar.gz=0A=0A    ___________________________________________=
____________=0A=0AReply to this item at:=0A=0A  <https://savannah.gnu.org/p=
atch/?10581>=0A=0A_______________________________________________=0AMessage=
 sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1782355577=:3609757
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCajyWeQAKCRCqLAuaBUf3
TnwxAPwL4ILa6lHqA4tyceVtV9rJ5Vna+nZhH9yWHyzdToZp+wD/U+byexZB9Y94
IaQj0V/by4NoPk6MIxvjRP09PZAa0w0=
=vYWi
-----END PGP SIGNATURE-----

--8323329-1714636915-1782355577=:3609757--