From: Dan Kegel <dank@kegel.com>
To: Patrick Herbst <paherbst@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: multiple installed versions of gcc -- automatically set rpath ??
Date: Thu, 28 May 2020 20:07:32 -0700 [thread overview]
Message-ID: <CAPF-yOaZNV244jxWgvDAqnA+MYpg5BuQhcqNkEb_xg6wjDcnjA@mail.gmail.com> (raw)
In-Reply-To: <CACMdL5+OafUu_5G-OVB=E-T7ertMhapLe5sx+6rqByLD5KDm8A@mail.gmail.com>
https://stackoverflow.com/questions/13334300/how-to-build-and-install-gcc-with-built-in-rpath
is a bit dated, but might be helpful. It says in part:

Using --with-boot-ldflags="-Wl,-rpath,/some/path" on the configure
step seems to work for me on gcc 4.8.3. The docs discuss this a bit
https://gcc.gnu.org/install/configure.html
- Dan
On Thu, May 28, 2020 at 7:55 PM Patrick Herbst via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> I have the base gcc that came with my distro and i'd like to have the
> option of using a newer version without replacing the older one.
>
> I'd like to install the newer version in a different path, like /opt.
>
> I run into a problem though when compiling with the newer version in
> /opt, it links against the libstdc++ in /opt, but at runtime the
> executable tries to link with the systems version in /usr/lib.
>
> Is there a way to have the gcc in /opt automatically set the rpath
> when linking so that executables can run against the /opt libstdc++?
>
next prev parent reply other threads:[~2020-05-29 3:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 2:54 Patrick Herbst
2020-05-29 3:07 ` Dan Kegel [this message]
2020-05-29 9:28 ` Patrick Bégou
2020-05-29 11:02 ` Thomas Doczkal
2020-05-29 11:22 ` Jonathan Wakely
2020-05-29 11:33 ` Jonathan Wakely
2020-05-29 17:23 ` Jonathan Wakely
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=CAPF-yOaZNV244jxWgvDAqnA+MYpg5BuQhcqNkEb_xg6wjDcnjA@mail.gmail.com \
--to=dank@kegel.com \
--cc=gcc-help@gcc.gnu.org \
--cc=paherbst@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).