From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10213 Path: news.gmane.org!not-for-mail From: Andrei Pozolotin Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl ldd: swt build: Error relocating / symbol not found Date: Thu, 23 Jun 2016 15:39:46 +0000 Message-ID: <576C02C2.7070006@gmail.com> References: <576B58E6.6040400@gmail.com> <20160623042448.GX10893@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------050308010906090004000305" X-Trace: ger.gmane.org 1466696430 15349 80.91.229.3 (23 Jun 2016 15:40:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 15:40:30 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10226-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 23 17:40:19 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bG6jr-0003xl-7L for gllmg-musl@m.gmane.org; Thu, 23 Jun 2016 17:40:19 +0200 Original-Received: (qmail 32752 invoked by uid 550); 23 Jun 2016 15:40:16 -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 32724 invoked from network); 23 Jun 2016 15:40:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=7XY2zSVlTvvwCr8A0TpjmvRRIHWeAjR+dca6G8JzRSo=; b=RmBezx5B7norsc2hQ/CI5XeQz6wcIT/3kE0aOIkmtMfIdpty7Mh+DTgQHCVa5cfRCH fujq2B1yArraVD+xJlGLVlCQMVF2YclP1YO+l1mgCMVuEefIqvfTnzUct5wfGUCj+Vbv xGsERUwqu9gVFJdTEs0jKL29S1Jp35rS2G/wEYck6HAC9SmOAZ3uGuo8j2XcqKPbujRG jxK7lJg+9r+ZRBD20OscU6hT21rwL6myUSGpE6g25vhzIzuQ3PClW/VGJXucO2qQL1P1 Gsj00ksLToiSTWgBLqVR1cvHbTaCltGz7YVVL4RqInEndR9nDXTd/NhQK6ar6ldQ9LqV sJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=7XY2zSVlTvvwCr8A0TpjmvRRIHWeAjR+dca6G8JzRSo=; b=Me2LQyUCcA6S2wRXpXS3vW9Onf1PwN2z9DkE59K7CHY8ggbsDsyy/fn3/DQWnA3amQ mKquB11e2+fueXDnzGe6PvhrRAUvNKP/A3sfsQHjNHFGecE+UvGK73b/oaj+Vm0TyxW/ InNyHjEZGJ/HjG1GjNH80aMKrSb3ZvD/d222yYFHWJAwPusd3l0AyIRrxDCtrAogEgOa cy/woyCbBeZgEbXANxwee5ZzAO5Xy77+akZhhhsdYCak8XjkiKjJmZJ7k9G1LdRL+wwS Aswc+ayvgBzNt5h32JMbaXDe8IQ+bRkP2I9knYqxbvEcsls+zy85JpVx8tpCbxk+axh9 EaKg== X-Gm-Message-State: ALyK8tLM7IA/awyi0je6ueznwJPet766WtHS6Q/figaD3eQAwTie7czs5dMQmbZx1oX2wA== X-Received: by 10.36.78.20 with SMTP id r20mr21698785ita.20.1466696402835; Thu, 23 Jun 2016 08:40:02 -0700 (PDT) X-Google-Original-From: Andrei Pozolotin X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <20160623042448.GX10893@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:10213 Archived-At: This is a multi-part message in MIME format. --------------050308010906090004000305 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Rich: On 06/23/2016 04:24 AM, Rich Felker wrote: > On Thu, Jun 23, 2016 at 03:35:02AM +0000, Andrei Pozolotin wrote: >> https://github.com/random-alpiner/repository/blob/master/bugs/01/1-app.log >> https://github.com/random-alpiner/repository/blob/master/bugs/01/2-ldd.log >> https://github.com/random-alpiner/repository/blob/master/bugs/01/3-readelf.log >> >> My first guess would be that something else in the application >> (eclipse) has already caused an older/stale version of libgobject to >> be loaded, so that the version containing the symbol definition does >> not get loaded. You could confirm this by running strace on the >> program and checking what library files it loads/maps. Thank you for the tip. 1) the trace shows: https://github.com/random-alpiner/repository/blob/master/bugs/01/4-strace.log 2) that the proper /usr/lib/libgobject-2.0.so.0 is in fact loaded before /usr/lib/libswt-atk-gtk-4530.so 3) however, the loading starts from /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so, which is an eclipse default library bundled with the eclipse application, and which is compiled against foreign libc.6.so: lddtree /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so libswt-gtk-4530.so => /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so (interpreter => none) libc.so.6 => not found 4) the library loading logic of eclipse is: first try to load bundled libraries from private paths, and if that fails, then try to load these libraries from the public paths, such as "/usr/lib/*", etc. 5) I do provide replacement libswt-* libraries built against musl on the public path "/usr/lib/*", and the assumption was that when private path library loading fails, then the library will be loaded from the public path, which "sort of almost works", so: * was that a wrong assumption? * will in fact musl ld.so reject libraries linked to the libc.so.6? * if not, is there a way to tell musl ld.so to blacklist private path libraries? --------------050308010906090004000305 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Rich:

On 06/23/2016 04:24 AM, Rich Felker wrote:
On Thu, Jun 23, 2016 at 03:35:02AM +0000, Andrei Pozolotin wrote:
    https://github.com/random-alpiner/repository/blob/master/bugs/01/1-app.log
    https://github.com/random-alpiner/repository/blob/master/bugs/01/2-ldd.log
    https://github.com/random-alpiner/repository/blob/master/bugs/01/3-readelf.log

My first guess would be that something else in the application
(eclipse) has already caused an older/stale version of libgobject to
be loaded, so that the version containing the symbol definition does
not get loaded. You could confirm this by running strace on the
program and checking what library files it loads/maps.
Thank you for the tip.

1) the trace shows:
https://github.com/random-alpiner/repository/blob/master/bugs/01/4-strace.log

2) that the proper /usr/lib/libgobject-2.0.so.0 is in fact loaded before /usr/lib/libswt-atk-gtk-4530.so

3) however, the loading starts from /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so,
which is an eclipse default library bundled with the eclipse application, and which is compiled against foreign libc.6.so:
lddtree /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so
libswt-gtk-4530.so => /home/work/space/none-4.5.0/conf/org.eclipse.osgi/748/0/.cp/libswt-gtk-4530.so (interpreter => none)
    libc.so.6 => not found
4) the library  loading logic of eclipse is: first try to load bundled libraries from private paths,
and if that fails, then try to load these libraries from the public paths, such as "/usr/lib/*", etc.

5) I do provide replacement libswt-* libraries built against musl on the public path "/usr/lib/*",
and the assumption was that when private path library loading fails,
then the library will be loaded from the public path, which "sort of almost works",
so:
* was that a wrong assumption? 
* will in fact musl ld.so reject libraries linked to the libc.so.6?
* if not, is there a way to tell musl ld.so to blacklist private path libraries?

--------------050308010906090004000305--