|
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.
Done.
> 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 sun.link 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 libbar.so, which links to libfoo.so, but
your application does not directly links to libfoo.so, 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 libbar.so
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 http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk