Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-06-19 03:01:15

On Sunday 18 June 2006 04:02, Tomas Puverle wrote:
> In the sun.jam toolset file, I see the following code (this is HEAD in
> CVS):
> flags sun.compile OPTIONS <optimization>speed : -fast -xarch=generic ;
> Could you remove the -xarch=generic, please? There are 2 reasons:
> 1) When speccifying an architecture using -xarch/-xtarget, it needs to
> come before the compilation type (e.g. -fast) flags
> 2) It makes it hard to build 64-bit builds using -xarch=v9,v9a and v9b.


> Also, what does this comment mean?
> <quote>
> # On gcc, there are separate options for dll path at runtime and
> # link time. On Solaris, there's only one: -R, so we have to use
> # it, even though it's bad idea.
> flags RPATH <xdll-path> ;
> </quote>
> On sunpro, you can have a different path for -L and -R, so presumably
> that's not what this comment is talking about..?

Yes, -L is not that. With gcc, you have three options:

  "-L", for searching the libraries
  "-R", for hardcoding library paths into the binary
  "-rpath-link". This is the path used when the static linker emulates
     the behaviour of the dynamic linker in attempt to verify that there
     no underfined symbols when you statically link application.

So, if your applications links to, which links to, but
your application does not directly links to, and you don't pass any
extra option, you'll get link error. To fix that, you'd need this (example):

   gcc -Wl,-rpath-link -Wl,`pwd` -o main main.c

using -L in this case does not work. On Solaris, there's no -rpath-link
option, and IIRC Solaris docs suggest that -R is always used to hardcode
library paths into the binary.

Hope this clarifies things.

- Volodya

Vladimir Prus
Boost.Build V2:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at