[haiku-commits] Re: haiku: hrev43453 - in src: build/libbe kits/interface

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 10 Dec 2011 23:33:50 +0100

Fredrik Holmqvist wrote:
> 2011/12/10 Ingo Weinhold <ingo_weinhold@xxxxxx>:
> > This isn't the best way to do it. "m" should be added to HOST_LIBROOT 
> > instead. Please have a look at build/jam/BuildSetup which is the place 
> > where that should happen.
> 
> I'll look into it, but if i understand correctly it won't really help
> with gold. It has a stricter 'no-as-needed' flag set that from what
> I've read means that if libbe_build depends on libroot_build and
> libroot_build is the only one that links to m libbe_build won't build.
> At least that is how I interpreted http://wiki.debian.org/ToolChain/DSOLinking
> 
> I did try to add it to libroot_build first, but maybe now that I think
> about it, perhaps it needs to use math.h as well to declare the
> functions extern.

You misunderstood me. HOST_LIBROOT is a jam variable. It should list all 
libraries that are needed to provide the functionality libroot provides on 
Haiku (respectively the subset that is needed for the build platform). E.g. on 
FreeBDS and Darwin libgnuregex is included. All programs and shared libraries 
built for the host platform that use Haiku API (including libbe_build) link 
against HOST_LIBROOT automatically. So the effect of adding "m" to HOST_LIBROOT 
(and HOST_STATIC_LIBROOT) would be the same as with your change, plus it 
wouldn't have to be duplicated for other programs and libraries that also use 
math functions.

Come to think of it, although ATM all generated build tools link against 
HOST_LIBROOT anyway (IIRC), it's probably even better to add "-lm" to 
HOST_LINKFLAGS.

CU, Ingo

Other related posts: