From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12414 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: BUG: $ORIGIN does not seem to work Date: Sat, 27 Jan 2018 11:42:04 -0500 Message-ID: <20180127164204.GJ1627@brightrain.aerifal.cx> References: <17b31628-04b5-3181-4623-046ffc4c0cab@petroprogram.com> <20180126142137.GH4418@port70.net> <20180127110722.GI4418@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1517071235 7961 195.159.176.226 (27 Jan 2018 16:40:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Jan 2018 16:40:35 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12430-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 27 17:40:31 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1efTWZ-0000sv-Bw for gllmg-musl@m.gmane.org; Sat, 27 Jan 2018 17:40:15 +0100 Original-Received: (qmail 9342 invoked by uid 550); 27 Jan 2018 16:42:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 9324 invoked from network); 27 Jan 2018 16:42:16 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12414 Archived-At: On Sat, Jan 27, 2018 at 06:20:27PM +0200, Stefan Fröberg wrote: > Hi > > > Szabolcs Nagy kirjoitti 27.01.2018 klo 13:07: > > * Stefan Fröberg [2018-01-27 01:50:21 +0200]: > >> My ldd is just symbolic link inside musl chroot environment, to > >> /lib/ld-musl-x86_64.so.1 > >> and it's symbolic link to /lib/libc.so > >> > >> Here is readelf output of that test program > >> readelf -d x > >> > >> Dynamic section at offset 0xe10 contains 24 entries: > >>   Tag        Type                         Name/Value > >>  0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.1] > > ^^^^^^^^^^^^^^^^ > > this looks like the wrong library version > > > > if you had straced the ldd output you would have seen > > that musl tries to open lib/libcrypto.so.1.1, but you > > probably only have lib/libcrypto.so.1.0.0 based on the > > glibc ldd output below. > No, that ldd was run inside, pure, chrooted musl environment. No glibc > inside. > These are the only libcrypto* files inside that chroot environment: > >  ls -lah /usr/lib/libcrypto.* > -rw-r--r--    1 0        0           5.0M Dec 17 00:24 /usr/lib/libcrypto.a > lrwxrwxrwx    1 0        0             16 Dec 17 00:24 > /usr/lib/libcrypto.so -> libcrypto.so.1.1 > -rwxr-xr-x    1 0        0           3.0M Jan 26 12:58 > /usr/lib/libcrypto.so.1.1 OK, but it still means ld picked up a different version of libcrypto (at link time) and encoded the dependency on that different version. You need to ensure that gcc/ld is searching your lib dir at link time. BTW running the program itself or ldd under strace can be very informative to see what's happening. Rich