Why ar doesn't call ranlib on Mac?

Alexy Khrabrov deliverable at gmail.com
Wed Mar 4 19:06:57 PST 2009


On Mar 4, 2009, at 6:39 PM, Peter O'Gorman wrote:
>
> Then ar is calling ranlib for you unless you are passing it the -S  
> flag.
>
> If you are building for multiple arches then you should pass ar the -s
> flag (as Rainer said) to ar to ensure that the table of contents is
> created. As you can see from the ar sources it calls ranlib -q  
> normally,
> and ranlib -f if it saw the -s flag. Ranlib -q will "Do nothing if a
> universal file would be created." whereas ranlib -f will create the  
> fat
> archive.

Hmm -- I don't do anything special to build universal binaries.  The  
problem arises in GODI, an OCaml packaging system, from a plain command

ar cr libdigest.a

-- and adding

ranlib libdigest.a

solved the problem.  Does a regular compilation

gcc x.c

with Apple's gcc on an Intel Mac try to create a universal binary?

Cheers,
Alexy


More information about the macports-users mailing list