Hi,
I think this excert from the Unix Porting guide probably explains
why I am hitting the issue :
" The library archive utility, ar, cannot work with libraries
containing code for more than one
architecture (or single-architecture libraries generated with lipo)
after ranlib has added a table
of contents to them. Thus, if you need to add additional object
files to a library, you must keep a
separate copy without a TOC. "
I have a archive wrapper that basically does some sanity checking
before calling "ar cr .." and does a
"ranlib -s" after that.This is done for each .o file that needs to
be archived , as and when the .o files are
compiled on the fly , incrementally creating the whole library.
I have a question related to the "ranlib -s" command that I run for
each .o file . Is "ranlib -s" supposed to be run
at the end , after all the .o's have been archived ( ar cr .. ) , or
is it fine to run it for each .o that gets archived ?
If so , are there any side effects incase we run it each time ?
Because , I do see a lot of warnings like as below
for each .o file that gets archived through my wrapper script :
ranlib: file: libarchive.a(qme.o) has no symbols
Tx,
~
Terry Lambert wrote:
On Jul 22, 2008, at 7:52 AM, Rohitash Panda wrote:
Hi,
I face an issue quite often , which seems to be accidentally
mixing 32-bit & 64-bit code in an archive.
When I try to see the contents of such an archive running "ar tv
<Libarchive>" , it doesn't allow me
to see the contents :
$ ar tv libarchive.a
ar: libarchive.a is a fat file (use libtool(1) or lipo(1) and
ar(1) on it)
ar: libarchive.a: Inappropriate file type or format
Is there any tool which can give a listing ( Eg objdump -a
<libarchive> on Linux ) along with its architecture information
, so as to catch the culprit ?
A Universal binary has multiple mach-o files. Generally, you lipo
out the mach-o you want to look at with "ar" and look at it with
"ar".
file <library name>
otool -f <library name>
You may also want to take ar's advice and look at libtool,
specifically the -arch_only flag.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden