From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by sourceware.org (Postfix) with ESMTPS id 7CFFC3851C0E for ; Fri, 29 May 2020 03:07:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7CFFC3851C0E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kegel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=daniel.r.kegel@gmail.com Received: by mail-lj1-f169.google.com with SMTP id c11so769294ljn.2 for ; Thu, 28 May 2020 20:07:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=I/Ha7TiC6d6pQiZL5nutv7Jjh1thtIbTMCz1IfxDUZs=; b=TCava+UfkRpB4XBYJQ+vcXGcVp/gb789fnc4iqWW3mAydEVMjNpVd8HCk1jXiFuv2/ I4G9XHqcIlMyWsOMo8kV5M/NqkW1XfniV2zM10FRzRjSSXvyc51oEAf4dPCptg45KQiU eAgn+jhPNvHKmRMNY1N9peJngC7AsZWeNLslb4so83MM4BQIGaMtCi/gybuAYlbLmb0x mUPUEGRSV6JoMxyMNINXlGsJdY5ubsEnAqNPSoQr2i9dSQUuh7pqm4c+JAtF8Wgl795R xlrzhmn/FS+9E4JocRKxcf3KWk1vQKyFKXayPv02RPtyhcRNVeCZeOqsKYp8ddbxiPCJ FK9g== X-Gm-Message-State: AOAM531/78j5iy+ClwyP4PH1GCOHFR8KVq29VDN20YV+EssWxfcbCibB 0Bz0iMbfEElfy6+p8lVVJ8QBb4lqtiHnH5qDV1k= X-Google-Smtp-Source: ABdhPJzBoqANk0Wu5uPJBHoAaA7n3/KemREMaXuL9CZIXLPVfmCOXmejTu1bLik78VR6p9aa6GZDRpLrIlf4PZ0JwQY= X-Received: by 2002:a2e:a0cd:: with SMTP id f13mr83302ljm.139.1590721664047; Thu, 28 May 2020 20:07:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dan Kegel Date: Thu, 28 May 2020 20:07:32 -0700 Message-ID: Subject: Re: multiple installed versions of gcc -- automatically set rpath ?? To: Patrick Herbst Cc: gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2020 03:07:47 -0000 https://stackoverflow.com/questions/13334300/how-to-build-and-install-gcc-w= ith-built-in-rpath is a bit dated, but might be helpful. It says in part: =EF=BF=BC Using --with-boot-ldflags=3D"-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 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++? >