Boost logo

Boost-Build :

Subject: Re: [Boost-build] specifying libraries on the link line, was "incorrect library names embedded on hp-ux ia64"
From: Jim Gallagher (jim_at_[hidden])
Date: 2009-06-11 14:15:41

>> OK, I have learned more over at the HP IT Resource Center. On hp-ux, a
>> dependent shared lib supplied to the linker by a path will have the
>> supplied path embedded as the dependent library name
>> (<>).
>> This would appear to be a good thing only if you are linking against
>> libraries that are in their final installed location and you supply
>> the full path. Do other unix variants work the same?
>Usual unix variants have a special option to make a shared library
>contain 'soname'. If a executable is linking to a shared library,
>it will reference it via 'soname', not the name specified on the link
>line. Can you figure of HPUX has something like that>

Yes, I did run across that. On hp-ux it is +h<internal name>. However,
it doesn't seem to work when multiple libs are involved. For example,
if I have three libs, foo, bar and baz, bar depends on foo and baz depends
on bar, and I add appropriate build requirements using +h:

Libbar links fine, but libbaz does not:

$ for DIR in foo bar baz; do^Jcd $DIR^Jbjam clean^Jbjam -d+2^Jcd ..^Jdone
...found 1 target...
...updating 1 target...
common.Clean clean
...updated 1 target...
acc.compile.c bin/acc/debug/foo.o

    aCC -Ae -c +d +Z -g -o "bin/acc/debug/foo.o" "foo.c" bin/acc/debug/

    aCC -AA -b -g -Wl,+h, -o "bin/acc/debug/"

...found 1 target...
...updating 1 target...
common.Clean clean
...updated 1 target...
acc.compile.c bin/acc/debug/bar.o

    aCC -Ae -c +d +Z -g -I"../foo" -o "bin/acc/debug/bar.o" "bar.c" bin/acc/debug/

    aCC -AA -b -g -Wl,+h, -o "bin/acc/debug/"
"bin/acc/debug/bar.o" "../foo/bin/acc/debug/"

...found 1 target...
...updating 1 target...
common.Clean clean
...updated 1 target...
acc.compile.c bin/acc/debug/baz.o

    aCC -Ae -c +d +Z -g -I"../bar" -I"../foo" -o
"bin/acc/debug/baz.o" "baz.c" bin/acc/debug/

    aCC -AA -b -g -Wl,+h, -o "bin/acc/debug/"
"bin/acc/debug/baz.o" "../bar/bin/acc/debug/"

ld: Can't find dependent library ""
Fatal error.
...failed updating 1 target...

Yet, both and appear to have the correct
dependencies and embedded names:
$ elfdump -L foo/bin/acc/debug/


                *** DYNAMIC Section ***


Index Tag Value

0 Soname
1 Runpath /usr/lib/hpux32:/opt/langtools/lib/hpux32
2 Flags 0x0
3 HP Flags 0x0
4 Link tab 0x40010010
5 Hash 0x40002e8
6 Dynstr 0x4000278
7 Dynsym 0x4000218
8 PltRsrv 0x40010000
9 GSTHshVl 0x4000368
10 GSTVersn 0x1
11 HPTime Thu Jun 11 11:06:53 2009
12 HPChksum 0xf6566078
13 HPSyCksm 0x509b87c5
14 Strsz 0x6f
15 Syment 0x10

$ elfdump -L bar/bin/acc/debug/


                *** DYNAMIC Section ***


Index Tag Value

0 Needed
1 Soname
2 Runpath /usr/lib/hpux32:/opt/langtools/lib/hpux32
3 Flags 0x0
4 HP Flags 0x0
5 Link tab 0x40010018
6 Hash 0x4000340
7 Dynstr 0x40002c0
8 Dynsym 0x4000250
9 PltRsrv 0x40010010
10 GSTHshVl 0x40003d8
11 GSTVersn 0x1
12 HPTime Thu Jun 11 11:06:55 2009
13 HPChksum 0xcea03a5d
14 HPSyCksm 0xa65c4ebe
15 Rela 0x4000368
16 Relasz 0xc
17 Pltrel 0x7
18 Jmprel 0x4000368
19 Pltrelsz 0xc
20 Relaent 0xc
21 Strsz 0x7d
22 Syment 0x10

I think it should work, but it doesn't.

>> So, how can I make boost-build tell the linker about dependent libs
>> the normal unix way, using -L<search dir> -l<lib name>?
>It's not possible now. I can change to do it this way, but please check
>if some soname equivalent is available.
>- Volodya


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at