Boost logo

Boost-Build :

Subject: [Boost-build] incorrect library names embedded on hp-ux ia64
From: Jim Gallagher (jim_at_[hidden])
Date: 2009-06-10 16:26:07


Hi,

I'm having a problem figuring out how to tell boost-build the right
way pass the names of dependent shared libs on the link line.

For example, if I have a project "Test" with two libraries, foo and
bar, where bar depends on foo:

----foo
| foo.c
| Jamfile
|
----bar
| bar.c
| Jamfile
|
|
Jamroot

Jamroot contains:
using acc ;

project Test
        : requirements
                <address-model>64
                <threading>multi
                <exception-handling>on
                <extern-c-nothrow>on
                <warnings>on
                <debug-symbols>on
                <optimization>off
                <runtime-link>shared
                <link>shared
        : default-build debug
;

foo/Jamfile contains:
lib foo : [ glob *.cpp ] [ glob *.c ] : : : <include>.
;

bar/Jamfile contains:
lib bar : [ glob *.cpp ] [ glob *.c ] /Test//foo
;

The link command for libbar generated by boost-build is:
    aCC -AA -b +DD64 -g -mt -o
"bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so"
  "bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/bar.o"
"../foo/bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libfoo.so"

The above link line causes libbar to have libfoo's path embedded as
part of its name, as shown below:

$ chatr ./bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so
./bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so:
         64-bit ELF shared library
         shared library dynamic path search:
             LD_LIBRARY_PATH enabled first
             SHLIB_PATH enabled second
             embedded path enabled third
/usr/lib/hpux64:/opt/langtools/lib/hpux64
         shared library list:
             ../foo/bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libfoo.so
             libpthread.so.1

This prevents libfoo from loading at runtime, regardless of how
LD_LIBRARY_PATH is set. An appropriate link line looks like this:

aCC -AA -b +DD64 -g -mt -o
"bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so"
  "bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/bar.o"
-L "../foo/bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi"
-lfoo

This link line results in the following embedded attributes, which
work correctly:
$ chatr ./bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so
./bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi/libbar.so:
         64-bit ELF shared library
         shared library dynamic path search:
             LD_LIBRARY_PATH enabled first
             SHLIB_PATH enabled second
             embedded path enabled third
../foo/bin/acc/debug/address-model-64/extern-c-nothrow-on/threading-multi:/usr/lib/hpux64:/opt/langtools/lib/hpux64
         shared library list:
             libfoo.so
             libpthread.so.1

So, am I not suppling the correct usage information for libfoo, or
does the HP-UX linker work different than other systems and
boost-build is not driving it correctly?

Thanks,
Jim


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