diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 4e6551125..0ec3f24ec 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -84,7 +84,12 @@ rule init ( version ? : command * : options * ) # (for unit-test/run rules). if $(command) { - local lib_path = $(root)/lib ; + # 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)/lib $(root)/lib32 $(root)/lib64 ; if $(.debug-configuration) { ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ;