Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

-rpath relative to executable location

2,720 views
Skip to first unread message

Andrei Voropaev

unread,
Jul 23, 2010, 5:42:33 AM7/23/10
to
Hello!

As far as I can see, the -rpath option with relative path sets the
searching directory relative to current one. Is there any way to set the
directory relative to the executable location? I've seen something about
@loader_path and @executable_path, but couldn't find any documentation
on this.

BTW, why the relative directories in -rpath are relative to the current
directory, and not to the location of executable?

--
Minds, like parachutes, function best when open

Andrew Haley

unread,
Jul 23, 2010, 6:23:50 AM7/23/10
to
Andrei Voropaev <avo...@mail.ru> wrote:

> As far as I can see, the -rpath option with relative path sets the
> searching directory relative to current one. Is there any way to set
> the directory relative to the executable location? I've seen
> something about @loader_path and @executable_path, but couldn't find
> any documentation on this.

man ld.so:

"ld.so understands the string $ORIGIN (or equivalently ${ORIGIN}) in
an rpath specification (DT_RPATH or DT_RUNPATH) to mean the directory
containing the application executable."

> BTW, why the relative directories in -rpath are relative to the current
> directory, and not to the location of executable?

That's ancient history. Maybe no-one knows any more.

Andrew.

Andrei Voropaev

unread,
Jul 26, 2010, 3:58:58 AM7/26/10
to
On 2010-07-23, Andrew Haley <andr...@littlepinkcloud.invalid> wrote:
> Andrei Voropaev <avo...@mail.ru> wrote:
>
>> As far as I can see, the -rpath option with relative path sets the
>> searching directory relative to current one. Is there any way to set
>> the directory relative to the executable location? I've seen
>> something about @loader_path and @executable_path, but couldn't find
>> any documentation on this.
>
> man ld.so:
>
> "ld.so understands the string $ORIGIN (or equivalently ${ORIGIN}) in
> an rpath specification (DT_RPATH or DT_RUNPATH) to mean the directory
> containing the application executable."

Thank you. I've checked the man for ld, but forgot about ld.so. Silly :)

0 new messages