|
Boost-Build : |
Subject: [Boost-build] gcc.jam weirdness (was: Boost-1.36.0 FreeBSD patches for review)
From: Steve M. Robbins (steve_at_[hidden])
Date: 2008-10-24 04:04:16
On Thu, Oct 23, 2008 at 10:46:58PM -0400, Alexander Sack wrote:
> In the meantime, I would like comments on the following three patches:
> - gcc.jam.patch
>
> The gcc toolset is set with a LD_LIBRARY_PATH without /lib.
My reading of the linux runtime loader manpage suggests that
LD_LIBRARY_PATH should be reserved for *NONSTANDARD* library
locations. Here is an excerpt from "man ld-linux":
The necessary shared libraries needed by the program are searched
for in the following order
o Using the environment variable LD_LIBRARY_PATH
(LD_AOUT_LIBRARY_PATH for a.out programs). Except if the
executable is a setuid/setgid binary, in which case it is
ignored.
o From the cache file /etc/ld.so.cache which contains a compiled
list of candidate libraries previously found in the augmented
library path.
o In the default path /lib, and then /usr/lib.
In my view, it would be a mistake to add /lib. Alexander: what
problem does that solve for you?
Reading gcc.jam (from trunk) I find this bit at line 160:
# If gcc is installed in non-standard location, we'd need to add
# LD_LIBRARY_PATH when running programs created with it (for unit-test/run
# rules).
if $(command)
{
# On multilib 64-bit boxes, there are both 32-bit and 64-bit libraries
# and all must be added to LD_LIBRARY_PATH. The linker will pick the
# right onces. Note that we don't provide a clean way to build 32-bit
# binary with 64-bit compiler, but user can always pass -m32 manually.
local lib_path = $(root)/bin $(root)/lib $(root)/lib32 $(root)/lib64 ;
if $(.debug-configuration)
{
ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ;
}
toolset.flags gcc.link RUN_PATH $(condition) : $(lib_path) ;
}
The comment introducing this block seems correct, to me. However, it
appears that the $(lib_path) is set and used regardless of whether gcc
is installed in a standard or non-standard location. Is this correct,
or am I misreading the jam file?
As mentioned above, I don't think you want to have standard library
locations added to the link line. It appears that $(root) is set to
the root install directory of gcc. So if root is /usr, will /usr/lib
and friends be added to the link line?
Finally, $(root)/bin looks plain wrong. Is it a Microsoft thing?
Regards,
-Steve
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