Opened 10 years ago

Last modified 9 years ago

#2438 assigned Bugs

gcc.jam sets LD_LIBRARY_PATH which breaks FreeBSD build

Reported by: pisymbol@… Owned by: Vladimir Prus
Milestone: Boost 1.42.0 Component: build
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: smr@…


In build/tools/v2/tools/gcc.jam we are setting the LD_LIBRARY_PATH for compilation to:


Couple of points:

  • /usr/bin (?) :D
  • /usr/lib on FreeBSD does not contain major number libs so most if not all binaries will not pick up anything from here
  • /usr/lib32 on FreeBSD DOES CONTAIN major number libs so if you are building on 32-bit this will work, HOWEVER if you are building 64-bit then this will cause failures
  • /usr/lib64 does not exist on FreeBSD (I believe this is a Linux thing)

Based on the comments within gcc.jam I FEEL as do some other people (see thread reference) that if bjam is *really* going to rely on rtld then it should do so by NOT setting anything to LD_LIBRARY_PATH which many have pointed out is only to be used when the standard search path is not enough. Setting this PATH is very dangerous and for 99% of the build cases, rtld does the right thing.


If it is decided to set LD_LIBRARY_PATH then we need to make this OS specific and unset it for FreeBSD (or minimally add back /lib which Steven pointed out in the above thread is probably not the right solution given LD_LIBRARY_PATH's semantics).

Change History (4)

comment:1 Changed 10 years ago by Steven Watanabe

Component: Building Boostbuild
Owner: set to Vladimir Prus

comment:2 Changed 9 years ago by smr@…

Cc: smr@… added

comment:3 Changed 9 years ago by Vladimir Prus

Milestone: Boost 1.37.0Boost 1.42.0
Status: newassigned

I'll try to sort this, one way or another, soonish.

comment:4 Changed 9 years ago by jim@…

I have no input on the right way to fix it, but as a point of reference, this fix-up in gcc.jam works for 64-bit FreeBSD. See today's trunk test results (

local lib_path = $(root)/bin $(root)/lib $(root)/lib64 /lib ;

For FreeBSD-64, yanking $(root)/lib32 and adding /lib is req'd, or at least putting /lib before $(root)/lib32. Glad to try other things if you want.

Note: See TracTickets for help on using tickets.