URL: <https://savannah.gnu.org/support/?111196>
Summary: Linking a static convenience library with fat
objects fails if output already exists
Group: GNU Libtool
Submitter: None
Submitted: Tue 25 Feb 2025 06:32:59 PM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email: [email protected]
Open/Closed: Open
Discussion Lock: Any
Operating System: Mac OS
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 25 Feb 2025 06:32:59 PM UTC By: Anonymous
On macOS, I can generate a static convenience library with "fat" objects with
gnu libtool:
make libfoo.a
/bin/sh ../../libtool --quiet --mode=compile --tag=CC gcc -arch x86_64 -arch
arm64 -o foo.lo -c foo.c
/bin/sh ../../libtool --quiet --mode=link --tag=CC gcc -static -g -Os -o
libfoo.a foo.lo
but if the output archive already exists, it fails (tried with libtool 2.4.7
and 2.5.4):
touch foo.c
make libfoo.a
/bin/sh ../../libtool --quiet --mode=compile --tag=CC gcc -arch x86_64 -arch
arm64 -o foo.lo -c foo.c
/bin/sh ../../libtool --quiet --mode=link --tag=CC gcc -static -g -Os -o
libfoo.a foo.lo
ar: libfoo.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: libfoo.a: Inappropriate file type or format
This makes sense, since libtool just runs 'ar cr' to add the objects into the
archive, and ar won't touch a "fat file".
I can just delete the output archive before generating it again, of course.
But since this "normally" works without doing that, I wasn't sure if this was
known/expected behavior, or if libtool should be smart enough to do something
about this.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/support/?111196>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
