From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 0FD76385DC35 for ; Fri, 29 May 2020 02:54:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0FD76385DC35 Received: by mail-wm1-x334.google.com with SMTP id n5so1571564wmd.0 for ; Thu, 28 May 2020 19:54:54 -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:from:date:message-id:subject:to; bh=N5yhZTmsTBcqgXu4XvZMUtPTsR3dvMrJXgRwyFsGYvg=; b=bkaXUuDWhfI4JutGNxnWxzKmwa3xpwZAz5USbqc9+4JNICDwxbqrogE4Oh4V91FHbk 5DvF/FmGympgT8LaeuTWXMZeANuz6KQTUiE0tn0l0v2FMBk4uZ77/UpNDUIZZbxmUnG9 +NkHoEHBm1GbamqAxL+mB9KCIdbQEi+egRpSZiuDFDQDvQXYlszQdbaBVhPWTjVslXhf EPxSqWsjeUJgco4oSr1sApakt0pNTyfUTV48R7q06HLv+h+eVRF9MXfE2gI4p06mQIe9 VYEu7hBw+7omS9Rc9jW0D4Anmsl78KqWaHlUIXog+AKjZvMqsrVFuacz2RmT4C6l9mSQ HH3g== X-Gm-Message-State: AOAM532ZiSk2kEQXry83jkB3Yvkm42fKpsLkXNaY36MHUcy86X8SzXH0 BKet68D0DzzF2ebLXbbi68ZSWklSOT5HcRRMJoJjzA== X-Google-Smtp-Source: ABdhPJymoF/8RPuzFJF3/o1yn/Ek9GTm6vxOS0RE9HKEjcT+Cii+N6vVWHacmDu0YcSy7PMX9OS/dSUj66QbVSZfK44= X-Received: by 2002:a1c:a1c5:: with SMTP id k188mr6522549wme.41.1590720892773; Thu, 28 May 2020 19:54:52 -0700 (PDT) MIME-Version: 1.0 From: Patrick Herbst Date: Thu, 28 May 2020 22:54:41 -0400 Message-ID: Subject: multiple installed versions of gcc -- automatically set rpath ?? To: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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 02:54:57 -0000 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++?