From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15212 invoked by alias); 20 Dec 2012 00:19:15 -0000 Received: (qmail 15150 invoked by uid 22791); 20 Dec 2012 00:19:14 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Dec 2012 00:19:07 +0000 Received: by mail-ie0-f175.google.com with SMTP id qd14so3686042ieb.20 for ; Wed, 19 Dec 2012 16:19:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.179.33 with SMTP id dd1mr8677097igc.31.1355962747025; Wed, 19 Dec 2012 16:19:07 -0800 (PST) Received: by 10.43.5.199 with HTTP; Wed, 19 Dec 2012 16:19:06 -0800 (PST) In-Reply-To: References: <1355959256.52229.YahooMailClassic@web160504.mail.bf1.yahoo.com> Date: Thu, 20 Dec 2012 00:19:00 -0000 Message-ID: Subject: Re: A question about RPATH From: Jonathan Wakely To: Dennis Clarke Cc: Jim Rice , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00103.txt.bz2 On 20 December 2012 00:15, Dennis Clarke wrote: > >> > I am a firm believer that LD_LIBRARY_PATH is evil, certainly >> > at least dangerous and the >> > output binary from any compile should have an RPATH set to >> > ensure that the correct >> > libs are found that the developer wanted. >> > >> > Having said all that, is there a magic >> > LD_OPTIONS_INCANTATION=-Wl,-rpath=/usr/local/lib type thing >> > to set to ensure I get my RPATH ? I should point out >> > this is trivial to do in the Solaris world and perhaps I am >> > missing something really obvious here. GCC does not tell the linker to set RPATH unless explicitly requested, see http://gcc.gnu.org/faq.html#rpath > So I will rebuild gcc with LD_RUN_PATH=/usr/local/lib:/usr/local/gcc4/lib64 and see what > I get. That's what I've done when building on Solaris, although in my case it was for the runtime libs, not the gcc executables (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354#c9). There has been a suggestion to add a new configure option to set RPATHs, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45508#c10