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-12 13:01:12


>Can you try the attached patch? (If it does not apply for some reason,
>both actions are modified by adding:
>and there's a new flag setting.
>At the same time, can you lookup two things in docs:
>1. Is there an option to set rpath encoded in the libraries --
>that is the path there libraries will be searched at runtime.
>I notice your dump of binaries include it, so it must be
>possible to specify it as well.
>2. Is there an option to separately control where linker looks
>for dependency shared libraries. It's called "rpath-link" in
>Linux, maybe same for ACC.

The patch works well, thank very much, it's a life saver.

I changed
-Wl,+h$(SPACE)-Wl,$(<[-1]:D=) to
Looks a little cleaner and works the same.

Here is the output from the build:

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

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

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

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

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

        aCC -AA -b -g -o "bin/acc/debug/"
-L"/home/tce/ul081b/foo/bin/acc/debug" -Wl,
"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 -g -I"../bar" -I"../foo" -o "bin/acc/debug/baz.o" "baz.c" bin/acc/debug/

        aCC -AA -b -g -o "bin/acc/debug/"
-L"/home/tce/ul081b/foo/bin/acc/debug" -Wl,
"bin/acc/debug/baz.o" "../bar/bin/acc/debug/"

And the internals of
$ elfdump -L baz/bin/acc/debug/


                *** DYNAMIC Section ***


Index Tag Value

0 Needed
1 Needed
2 Soname
3 Runpath
4 Flags 0x0
5 HP Flags 0x0
6 Link tab 0x40010018
7 Hash 0x4000398
8 Dynstr 0x40002c8
9 Dynsym 0x4000258
10 PltRsrv 0x40010010
11 GSTHshVl 0x4000430
12 GSTVersn 0x1
13 HPTime Fri Jun 12 09:36:08 2009
14 HPChksum 0x78065ff5
15 HPSyCksm 0x2014100c
16 Rela 0x40003c0
17 Relasz 0xc
18 Pltrel 0x7
19 Jmprel 0x40003c0
20 Pltrelsz 0xc
21 Relaent 0xc
22 Strsz 0xcd
23 Syment 0x10

So, everything looks good. For my case, I will probably add
+nodefaultrpath, which will
prevent the embedding of the paths supplied with -L. Those paths are
needed at link time,
but they are not appropriate for our runtime configuration.

To shift gears a bit, I have been following the mailing list for a
while, and I agree
with your (the maintainers) philosophy, that boost-build should not
surprise users
and should do what is usually the right thing. I think this is a case
that, at least
for HP-UX and Linux systems, and maybe for Unix in general, that
boost-build is doing
something that is surprising and not what most developers would want.
I suggest that
the default boost-build link lines for Unix systems should use the -L
and -l path
and lib specifiers.

Thanks again,


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