[sr #111196] Linking a static convenience library with fat objects fails if output already exists
anonymous <[email protected]> Tue, 25 Feb 2025 13:33:04 -0500 (EST)
| Newsgroups | gmane.comp.gnu.libtool.general |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1852675709-1740508384=:2233934
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
URL:=0A <https://savannah.gnu.org/support/?111196>=0A=0A S=
ummary: Linking a static convenience library with fat=0Aobjects fails if ou=
tput already exists=0A Group: GNU Libtool=0A =
Submitter: None=0A Submitted: Tue 25 Feb 2025 06:32:59 PM U=
TC=0A Category: None=0A Priority: 5 - Normal=
=0A Severity: 3 - Normal=0A Status: None=0A=
Privacy: Public=0A Assigned to: None=0A =
Originator Email: [email protected]=0A Open/Closed: Open=
=0A Discussion Lock: Any=0A Operating System: Mac OS=0A=0A=
=0A _______________________________________________________=0A=0AFollow-=
up Comments:=0A=0A=0A------------------------------------------------------=
-=0ADate: Tue 25 Feb 2025 06:32:59 PM UTC By: Anonymous=0AOn macOS, I can g=
enerate a static convenience library with "fat" objects with=0Agnu libtool:=
=0A=0A=0Amake libfoo.a=0A/bin/sh ../../libtool --quiet --mode=3Dcompile --t=
ag=3DCC gcc -arch x86_64 -arch=0Aarm64 -o foo.lo -c foo.c=0A/bin/sh ../..=
/libtool --quiet --mode=3Dlink --tag=3DCC gcc -static -g -Os -o=0Alibfoo=
.a foo.lo=0A=0A=0Abut if the output archive already exists, it fails (tried=
with libtool 2.4.7=0Aand 2.5.4):=0A=0A=0Atouch foo.c=0Amake libfoo.a=0A/bi=
n/sh ../../libtool --quiet --mode=3Dcompile --tag=3DCC gcc -arch x86_64 -=
arch=0Aarm64 -o foo.lo -c foo.c=0A/bin/sh ../../libtool --quiet --mode=3Dli=
nk --tag=3DCC gcc -static -g -Os -o=0Alibfoo.a foo.lo=0Aar: libfoo.a is =
a fat file (use libtool(1) or lipo(1) and ar(1) on it)=0Aar: libfoo.a: Inap=
propriate file type or format=0A=0A=0AThis makes sense, since libtool just =
runs 'ar cr' to add the objects into the=0Aarchive, and ar won't touch a "f=
at file".=0A=0AI can just delete the output archive before generating it ag=
ain, of course.=0ABut since this "normally" works without doing that, I was=
n't sure if this was=0Aknown/expected behavior, or if libtool should be sma=
rt enough to do something=0Aabout this.=0A=0A=0A=0A=0A=0A=0A=0A ________=
_______________________________________________=0A=0AReply to this item at:=
=0A=0A <https://savannah.gnu.org/support/?111196>=0A=0A___________________=
____________________________=0AMessage sent via Savannah=0Ahttps://savannah=
.gnu.org/=0A
--8323329-1852675709-1740508384=:2233934
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZ74M4AAKCRCqLAuaBUf3
TnqwAQC4vxwgb/zFhIgFgv6sx1IGuiwHEsJxbeEwR7fmVj2+BgEApdin7Wx0/eNR
VnXoKUYuokrDqVv0nOWO9Pqk6xheRA4=
=Kg8d
-----END PGP SIGNATURE-----
--8323329-1852675709-1740508384=:2233934--