public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eljay Love-Jensen <eljay@adobe.com>
To: Wesley Smith <wesley.hoke@gmail.com>, GCC-help <gcc-help@gcc.gnu.org>
Subject: Re: runtime link path and g++
Date: Sun, 20 Jul 2008 22:30:00 -0000	[thread overview]
Message-ID: <C4A89515.7226%eljay@adobe.com> (raw)
In-Reply-To: <1079b050807191944i4e4509a7r72b929f4daf6361e@mail.gmail.com>

Hi Wes,

> How can I specify this path to g++? I've seen -R used in some places, but g++
doesn't understand it.

This is a linker issue, not so much a GCC issue.  (Although it would be nice
for the GCC tool chain driver to be a little more rpath savvy across
platforms.)

Try -Wl,-rpath=/path/you/want or consider LD_LIBRARY_PATH=/path/you/want as
an environmental to your executable.

http://en.wikipedia.org/wiki/Rpath_(linking)

I'm not familiar with Ubuntu Linux, so it may do things slightly
differently.

For instance, I've heard that Ubuntu uses a different /bin/sh shell (dash
rather than bash), which results in x100 performance for their shell, and
lots of shell impedance mismatch from those who write bash-isms into what
probably should be /bin/sh clean.  The caveat is:  YMMV.

The rpath option has a few sharp edges.  When used with relative paths, it's
a security hole for the wily and devious.  If using absolute paths, it makes
the application much less mv-able.

The LD_LIBRARY_PATH option may necessitate having a user-convenience
launching script.  That allows your installer to construct the launching
script with all the right baked paths for LD_LIBRARY_PATH, or for the really
tricky, the launching script may figure out those setting dynamically from
how it was launched (using $0).

HTH,
--Eljay

      reply	other threads:[~2008-07-20 12:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-20 12:10 Wesley Smith
2008-07-20 22:30 ` Eljay Love-Jensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C4A89515.7226%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=wesley.hoke@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).