Re: common symbols in static libs on darwin?
Re: common symbols in static libs on darwin?
- Subject: Re: common symbols in static libs on darwin?
- From: Jack Howarth <email@hidden>
- Date: Thu, 26 Mar 2009 14:39:30 -0400
Peter,
Is that better than just building the static lib with
-fno-common? The ranlib man page in Leopard makes it sound
as if this option should be avoided...
-c Include common symbols as definitions with respect to the table of contents. This is seldom the intended behavior for
linking from a library, as it forces the linking of a library member just because it uses an uninitialized global that
is undefined at that point in the linking. This option is included only because this was the original behavior of
ranlib. This option is not the default.
Jack
On Thu, Mar 26, 2009 at 12:56:52PM -0500, Peter O'Gorman wrote:
> Jack Howarth wrote:
> > I got a report of problems linking the libfreeglut.a
> > static lib from my fink packaging of freeglut 2.4.0. The
> > problem seems to arise from the fact that the object files
> > for the static lib of libfreeglut are all compiled without
> > -fno-common. This causes unresolved symbols shared libs
> > that use this static lib are loaded. Are there any
> > recommendations from Apple on best practices for static
> > libs regarding this? I can find information suggesting
> > that -fno-common must be used for shared libs but not the
> > same for static libs. However since any static lib
> > could be linked into a shared lib, shouldn't the static
> > libs on darwin be built with -fno-common by default?
> > Is there any technical reason not to do this?
>
> ranlib -c libfreeglut.a will include common symbols in the archive table
> of contents.
>
> Peter
> --
> Peter O'Gorman
> http://pogma.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden