From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76309 invoked by alias); 9 Jun 2019 21:34:44 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 76291 invoked by uid 89); 9 Jun 2019 21:34:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=distros, cutting, 2200, HX-HELO:sk:mail-it X-HELO: mail-it1-f193.google.com Received: from mail-it1-f193.google.com (HELO mail-it1-f193.google.com) (209.85.166.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Jun 2019 21:34:42 +0000 Received: by mail-it1-f193.google.com with SMTP id r135so10340480ith.1; Sun, 09 Jun 2019 14:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=sHWV94SFeGIonJmrhiUFylNvfp7yNmxXtvDXX+pULc8=; b=kWWoiI++0W6hYBn61JJPOdM4i+nI5rVdmuB+LRKEMew9KkJrvm4zSWDKNpx8K2Qejx veRPOyoc4Y2bLPeYP2+9WTx/+bkKuXDkrSfA+OQGZpWROgPVynIc13iVR3Dj/Ds8M1oq XHpuqODeufuxefZKMvgYIoackJqs5BDfEWbnqcQl/Z2L7Ies2LRXEFzOqeVLiDn0Nfwb VJD6QPjxb726+DhqMFkmlZ9OCCMIO5cd+vSsRrPneVvhllI1rISKP+IZXOwm8xBGS7gz gKWzw1xppbGGNefEn/0a9R54s9/KF44LUUc8ykCCFQx/5686G6ui1bTIoSkAYCB6uZ/A ynUg== MIME-Version: 1.0 References: In-Reply-To: Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Sun, 09 Jun 2019 21:34:00 -0000 Message-ID: Subject: Re: How to set a system-wide library path policy? To: "Carlos O'Donell" Cc: Binutils , libc-help Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00005.txt.bz2 On Fri, Jun 7, 2019 at 4:46 PM Carlos O'Donell wrote: > > On 6/7/19 10:53 AM, Jeffrey Walton wrote: > > I'm having trouble figuring out how to setup library path policy on Fedora 29. > > The system loader is in glibc. Adding libc-help to the CC. > > > I need to articulate to the system loader: > > > > 1. programs in /bin must only link to libs in /lib64 > > 2. programs in /usr/bin must only link to libs in /usr/lib64 > > 3. programs in /usr/local/bin may use libraries in /usr/local/lib64 or > > /usr/lib64 > > OK. > > > As far as I know, the distro supplies (1) and (2). They know nothing > > about my libraries in /usr/local. When the distro is ready, it will > > push updated programs and libraries as needed. The distro binaries > > should not use my libraries. > > Why would your distro binaries use your libraries? Such libraries are > not present at static link time when they are built in the Feodra builders. > > The only reason your distro libraries would be used is if you used > LD_LIBRARY_PATH that pointed to them, in which case you would be altering > the global search order. Thanks Carlos, Here is a Solaris example because I'm updating Git for the 2.20.0 release. Linux behaves the same way as Solaris, so there' no material difference here. I'm also cutting over to 64-bit default per Sun's recommendation at https://docs.oracle.com/cd/E37838_01/html/E66175/features-1.html. $ command -v git /usr/bin/git $ git checkout master -f && git pull ld.so.1: git: fatal: /usr/local/lib/libpcre2-8.so.0: wrong ELF class: ELFCLASS64 Killed Sun does not follow their own recommendation and provides a 32-bit Git. Then, the distros binaries are using the libraries I am building. As for your question about why this happens... who knows. Some genius thought it was a good idea to link to the wrong library... Personally, I don't get the use case: compile and link against one version of a library at compile time, then runtime link against the wrong library. Apparently someone asserted that was the number one use case, and represented it as such out of the box (q.v.). Jeff