[patch #10569] FIx old_deplibs usage / archive-in-archive test

Alexandre Janniaux <[email protected]> Tue, 28 Apr 2026 11:08:38 -0400 (EDT)
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
--8323329-1714636915-1777388918=:2233501
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/patch/?10569>=0A=0A                 Summ=
ary: FIx old_deplibs usage / archive-in-archive test=0A                   G=
roup: GNU Libtool=0A               Submitter: espresso=0A               Sub=
mitted: Tue 28 Apr 2026 03:08:32 PM UTC=0A                Category: None=0A=
                Priority: 5 - Normal=0A                  Status: None=0A   =
              Privacy: Public=0A             Assigned to: None=0A        Or=
iginator Email:=0A             Open/Closed: Open=0A         Discussion Lock=
: Unlocked=0A=0A=0A    ____________________________________________________=
___=0A=0AFollow-up Comments:=0A=0A=0A--------------------------------------=
-----------------=0ADate: Tue 28 Apr 2026 03:08:32 PM UTC By: Alexandre Jan=
niaux <espresso>=0AHi,=0A=0AI'm re-submitting patches that I've sent a whil=
e ago, and that=0AI need to make partial linking work properly in VLC.=0A=
=0AYou can find the original submission there:=0A=0A[patch1]:=0Ahttps://lis=
ts.gnu.org/archive/html/libtool-patches/2021-04/msg00000.html=0A[patch2]:=
=0Ahttps://lists.gnu.org/archive/html/libtool-patches/2021-04/msg00001.html=
=0A[repro]:=0Ahttps://lists.gnu.org/archive/html/libtool-patches/2021-04/ms=
g00003.html=0A=0AIn the meantime, I've started using those patches and neve=
r pinged=0Afor the merge as I hadn't 100% understanding of why it was made =
like=0Athis, and I didn't write the test case for it.=0A=0ANow, I'm startin=
g to merge the partial linking feature in VLC and I=0Awould appreciate not =
keeping the patch for myself in our repository as=0Ait is much easier to ha=
ndle, so I've made the test and investigations=0Ato provide context.=0A=0AA=
fter some research, i.e. realizing when writing the test that I was=0Aactua=
lly breaking another one, it seems that I've been solving an=0Aissue origin=
ating[^thomastanner] back to 1999.=0A=0A[^thomastanner]:=0Ahttps://cgit.git=
.savannah.gnu.org/cgit/libtool.git/commit/?id=3D4b506921=0A=0AThe symptoms =
are the following: when doing partial linking with static=0Adependencies, t=
he static libraries from the dependencies are actually=0Aappended to the ar=
chive command and are nested into the archive=0Aitself, leading to the link=
er complaining when using the partially=0Alinked archive in the end:=0A=0A =
   ld: ./.libs/lib.a: member ./.libs/lib.a(libexternal.a) in archive is not=
=0Aan object=0A=0AThe problem was partially addressed[^oldarchivecmds] by P=
eter O'Gorman=0Awho removed the duplicate that was added to old_archive_cmd=
s and=0Aintroduced[^dmacks] the archive-in-archive.at test to signal this,=
=0Ausing AT_XFAIL_IF to notify this was not working correctly.=0A=0A[^oldar=
chivecmds]:=0Ahttps://cgit.git.savannah.gnu.org/cgit/libtool.git/commit/?id=
=3De18e516a=0A[^dmacks]:=0Ahttps://lists.gnu.org/archive/html/libtool-patch=
es/2007-06/msg00004.html=0A=0AThen we also had changes from Peter Rosin tha=
t added partial test=0Asuccess for Microsoft's lib, I guess to have the tes=
tsuite working=0Adespite the behavior.=0A=0AThen, fast-forward to 2021, I s=
tumbled upon the error above when=0Aimplementing the partial linking integr=
ation and created a=0Arepository[^ltrltest] to test and trigger the issue, =
from which I made=0Aand sent the original patches. =0A=0A[^ltrltest]: https=
://github.com/alexandre-janniaux/libtool-relocatable-tests=0A=0AIn my under=
standing, libtool defines the convenience library and=0Aold libraries diffe=
rently, as one is a bundle of object that happens=0Ato be stored as a stati=
c archive, but is really meant to provide the=0Aobjects to the target it's =
linked to, whereas the other is referring=0Ato static library, which means =
that the linker is only pulling what it=0Aneeds to pull from it.=0A=0AIn ad=
dition, when generating a libtool library, it is expected to also=0Ause lib=
tool to link this libtool library against a target, while=0Aforwarding the =
dependencies properly. By that sentence, I mean that if=0Athe dependency is=
 not linked by libtool, that's not a libtool problem,=0Abut if it is, libto=
ol should make sure it forwards and provides the=0Adependencies in an adequ=
ate manner.=0A=0ALibtool does have the necessary mechanism in the libtool a=
rchive, but=0Athe static libraries that were linked against the libtool arc=
hives=0Awere not forwarded through this but the archive itself instead.=0A=
=0AThis patchset fixes this old issue and properly address this last=0Apoin=
t by forwarding those old library dependencies through the=0Adependency_lib=
s field of the libtool archive, so that they are=0Aresolved at the final li=
nk stage. It also updates the tests so that=0Athe problem is marked as reso=
lved.=0A=0A=0A=0A=0A=0A=0A    _____________________________________________=
__________=0AFile Attachments:=0A=0AName: 0001-ltmain.in-ensure-old-librari=
es-are-not-archived.patch Size: 4.6KiB=0A=0A<https://file.savannah.gnu.org/=
file/0001-ltmain.in-ensure-old-libraries-are-not-archived.patch?file_id=3D5=
8521>=0A=0AName: 0002-tests-extend-archive-in-archive-with-dependency-forw.=
patch Size:=0A1.7KiB=0A=0A<https://file.savannah.gnu.org/file/0002-tests-ex=
tend-archive-in-archive-with-dependency-forw.patch?file_id=3D58522>=0A=0ANa=
me: 0003-ltmain.in-defer-warn-dependency-to-static-library.patch Size:=0A1.=
4KiB=0A=0A<https://file.savannah.gnu.org/file/0003-ltmain.in-defer-warn-dep=
endency-to-static-library.patch?file_id=3D58523>=0A=0A=0A=0A    AGPL NOTICE=
=0A=0AThese attachments are served by Savane. You can download the correspo=
nding=0Asource code of Savane at=0Ahttps://savannah.gnu.org/source/savane-c=
36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz=0A=0A    ___________________=
____________________________________=0A=0AReply to this item at:=0A=0A  <ht=
tps://savannah.gnu.org/patch/?10569>=0A=0A_________________________________=
______________=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1777388918=:2233501
Content-Type: APPLICATION/pgp-signature; name=signature.asc

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

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCafDNdgAKCRCqLAuaBUf3
TpJhAQDh3V3t9q/OgXP1cprwrwL2+ZRX7FPD0pYW58eumdvkfgD+LOFmPVHwsZzk
VHSMIYKe6/2AQFV6gBBy0oszhrCYZAM=
=wmxw
-----END PGP SIGNATURE-----

--8323329-1714636915-1777388918=:2233501--