From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7738 Path: news.gmane.org!not-for-mail From: John Mudd Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: musl xclock? Date: Thu, 21 May 2015 17:36:46 -0400 Message-ID: References: <20150520210801.GK11258@port70.net> <20150520214807.GL11258@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec51a89a05cee9d05169e589e X-Trace: ger.gmane.org 1432244244 23704 80.91.229.3 (21 May 2015 21:37:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 21:37:24 +0000 (UTC) To: musl , John Mudd Original-X-From: musl-return-7750-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 21 23:37:22 2015 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 1YvY9Z-00039z-H1 for gllmg-musl@m.gmane.org; Thu, 21 May 2015 23:37:21 +0200 Original-Received: (qmail 24316 invoked by uid 550); 21 May 2015 21:37:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24295 invoked from network); 21 May 2015 21:37:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ipyu9e5WfV6iviAY8RbFejZtzvpQCSKOPFopaCvrXEw=; b=zvAAh5q16h7NcBDoGSj7e0K/BZ1a5yy6hsyNe+Jjrv+nAwMZrrN8v+hlNFlKakZ47K XCCkTvf3WuEwkPNvC8lOx0pwcNswVRbe5u4gDKQudLPdWhycNxvvBEthvx0PoYxNwfBE vvVUgOa/FAG3aS+N6I3LPCVwfMNKMd0PtjuVAQItsWMnyx0wKXpOGlPKKq7rlABu8eLa MjUqURh8VRrtT9iOt3GLKeQxyhDRdjhq4/d2hA6O5oN5kFSCXgDrqKi3rdnjJmBRXOsY t9p2AzAVwjUKzvXabvW3thVaRN0NOEpCv/KR9tQeeliwdEWT87tFzrlHDqPa8mwVzs1t s7Hg== X-Received: by 10.43.58.201 with SMTP id wl9mr5675619icb.37.1432244226677; Thu, 21 May 2015 14:37:06 -0700 (PDT) In-Reply-To: <20150520214807.GL11258@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:7738 Archived-At: --bcaec51a89a05cee9d05169e589e Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 20, 2015 at 5:48 PM, Szabolcs Nagy wrote: > * Szabolcs Nagy [2015-05-20 23:08:02 +0200]: > > * John Mudd [2015-05-20 16:47:45 -0400]: > > > > > > It listed this: > > > > > > libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libXft.so > > > found libz.so.1 at //lib/i386-linux-gnu/libz.so.1 > > > libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1 > > > > > > > ok so you probably forgot to add libz to the -L path > > and then ld went ahead and found the wrong one > > > > i think -L probably wont help: libz is an indirect dependency > not listed as -lz on the ld commandline > > in that case ld searches different set of paths > you may want to set LD_LIBRARY_PATH or use -Wl,-rpath-link > > I see, so the -L options work for libs specified by -l options but not indirect libs like libz. Strange. So I added -lz to my collect2 command and that much works now. I got an xclock executable but... it goes into an infinite loop when I try to run it. At least I got past the linker error. Thanks! Here's what strace shows and then it pauses (while still using 100% CPU) for about 20 secs. ... open("/usr/share/fonts/X11/Type1", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5 fcntl64(5, F_SETFD, FD_CLOEXEC) = 0 getdents64(5, /* 23 entries */, 2048) = 728 getdents64(5, /* 0 entries */, 2048) = 0 stat64("/usr/share/fonts/X11/Type1/Symbol.afm", {st_mode=S_IFREG|0644, st_size=9532, ...}) = 0 brk(0x9680000) = 0x9680000 open("/usr/share/fonts/X11/Type1/Symbol.afm", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=9532, ...}) = 0 mmap2(NULL, 9532, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb714a000 close(6) = 0 mmap2(NULL, 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7127000 munmap(0xb7127000, 143360) = 0 open("/usr/share/fonts/X11/Type1/._Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/%Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.AppleDouble/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/Symbol.afm/..namedfork/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/Symbol.afm/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/resource.frk/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.resource/Symbol.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) munmap(0xb714a000, 9532) = 0 stat64("/usr/share/fonts/X11/Type1/Symbol.pfb", {st_mode=S_IFREG|0644, st_size=37744, ...}) = 0 open("/usr/share/fonts/X11/Type1/Symbol.pfb", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=37744, ...}) = 0 mmap2(NULL, 37744, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7143000 close(6) = 0 brk(0x9688000) = 0x9688000 brk(0x968a000) = 0x968a000 brk(0x968e000) = 0x968e000 brk(0x9693000) = 0x9693000 then this much more after 20 secs pause: munmap(0xb7143000, 37744) = 0 stat64("/usr/share/fonts/X11/Type1/c0419bt_.afm", {st_mode=S_IFREG|0644, st_size=15395, ...}) = 0 open("/usr/share/fonts/X11/Type1/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=15395, ...}) = 0 mmap2(NULL, 15395, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7149000 close(6) = 0 mmap2(NULL, 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7126000 munmap(0xb7126000, 143360) = 0 open("/usr/share/fonts/X11/Type1/._c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/%c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.AppleDouble/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/c0419bt_.afm/..namedfork/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/c0419bt_.afm/rsrc", O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory) open("/usr/share/fonts/X11/Type1/resource.frk/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/share/fonts/X11/Type1/.resource/c0419bt_.afm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) munmap(0xb7149000, 15395) = 0 stat64("/usr/share/fonts/X11/Type1/c0419bt_.pfb", {st_mode=S_IFREG|0644, st_size=40766, ...}) = 0 open("/usr/share/fonts/X11/Type1/c0419bt_.pfb", O_RDONLY|O_LARGEFILE) = 6 fcntl64(6, F_SETFD, FD_CLOEXEC) = 0 fstat64(6, {st_mode=S_IFREG|0644, st_size=40766, ...}) = 0 mmap2(NULL, 40766, PROT_READ, MAP_PRIVATE, 6, 0) = 0xb7143000 close(6) = 0 brk(0x9698000) = 0x9698000 repeating indefinitely... --bcaec51a89a05cee9d05169e589e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Wed, May 20, 2015 at 5:48 PM, Szabolcs Nagy <nsz@port70.net> wrote:
* Szabolcs Nagy <nsz@port70.net> [2015-05-20 23:08:02 +0200]:
> * John Mudd <johnbmudd@gmail.com> [2015-05-20 16:47:45 -0400]:
> >
> > It listed this:
> >
> > libz.so.1 needed by /home/mudd/musl/libXft-2.3.2.install/lib/libX= ft.so
> > found libz.so.1 at //lib/i386-linux-gnu/libz.so.1
> > libc.so.6 needed by //lib/i386-linux-gnu/libz.so.1
> >
>
> ok so you probably forgot to add libz to the -L path
> and then ld went ahead and found the wrong one
>

i think -L probably wont help: libz is an indirect dependency
not listed as -lz on the ld commandline

in that case ld searches different set of paths
you may want to set LD_LIBRARY_PATH or use -Wl,-rpath-link


I see, so the -L op= tions work for libs specified by -l options but not indirect libs like libz= . Strange. So I added -lz to my collect2 command and that much works now.= =A0I got an xclock executable but... it goes into an infinite loop when I t= ry to run it.

At least I got past the linker error. Thanks!

Here's what strace show= s and then it pauses (while still using 100% CPU) for about 20 secs.
<= div class=3D"gmail_extra">
...
open("/usr/share/fo= nts/X11/Type1", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) =3D 5
fcntl64(5, F_SETFD, FD_CLOEXEC) =A0 =A0 =A0 =A0= =3D 0
getdents64(5, /* 23 entries */, 2048= ) =A0 =3D 728
getdents64(5, /* 0 entries */= , 2048) =A0 =A0=3D 0
stat64("/usr/shar= e/fonts/X11/Type1/Symbol.afm", {st_mode=3DS_IFREG|0644, st_size=3D9532= , ...}) =3D 0
brk(0x9680000) =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x9680000
open("/usr/share/fonts/X11/Type1/Symbol.afm", O_RDONLY|= O_LARGEFILE) =3D 6
fcntl64(6, F_SETFD, FD_C= LOEXEC) =A0 =A0 =A0 =A0 =3D 0
fstat64(6, {s= t_mode=3DS_IFREG|0644, st_size=3D9532, ...}) =3D 0
mmap2(NULL, 9532, PROT_READ, MAP_PRIVATE, 6, 0) =3D 0xb714a000
close(6) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0
mmap2(NULL= , 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0xb71= 27000
munmap(0xb7127000, 143360) =A0 =A0 = =A0 =A0 =A0 =A0 =A0=3D 0
open("/usr/sh= are/fonts/X11/Type1/._Symbol.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENOENT= (No such file or directory)
open("/us= r/share/fonts/X11/Type1/%Symbol.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENO= ENT (No such file or directory)
open("= /usr/share/fonts/X11/Type1/.AppleDouble/Symbol.afm", O_RDONLY|O_LARGEF= ILE) =3D -1 ENOENT (No such file or directory)
open("/usr/share/fonts/X11/Type1/Symbol.afm/..namedfork/rsrc"= , O_RDONLY|O_LARGEFILE) =3D -1 ENOTDIR (Not a directory)
open("/usr/share/fonts/X11/Type1/Symbol.afm/rsrc", = O_RDONLY|O_LARGEFILE) =3D -1 ENOTDIR (Not a directory)
open("/usr/share/fonts/X11/Type1/resource.frk/Symbol.afm&q= uot;, O_RDONLY|O_LARGEFILE) =3D -1 ENOENT (No such file or directory)
=
open("/usr/share/fonts/X11/Type1/.resource/= Symbol.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENOENT (No such file or dire= ctory)
munmap(0xb714a000, 9532) =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0=3D 0
stat64("/usr= /share/fonts/X11/Type1/Symbol.pfb", {st_mode=3DS_IFREG|0644, st_size= =3D37744, ...}) =3D 0
open("/usr/share= /fonts/X11/Type1/Symbol.pfb", O_RDONLY|O_LARGEFILE) =3D 6
fcntl64(6, F_SETFD, FD_CLOEXEC) =A0 =A0 =A0 =A0 =3D 0
fstat64(6, {st_mode=3DS_IFREG|0644, st_size= =3D37744, ...}) =3D 0
mmap2(NULL, 37744, PR= OT_READ, MAP_PRIVATE, 6, 0) =3D 0xb7143000
= close(6) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D= 0
brk(0x9688000) =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x9688000
br= k(0x968a000) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x968a0= 00
brk(0x968e000) =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x968e000
br= k(0x9693000) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x96930= 00


then this much more after 20 sec= s pause:

munmap(0xb7143000, 37744) =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =3D 0
stat64("/usr/share/fonts/X11/Type1= /c0419bt_.afm", {st_mode=3DS_IFREG|0644, st_size=3D15395, ...}) =3D 0<= /div>
open("/usr/share/fonts/X11/Type1/c0419bt_.afm", O_RDONL= Y|O_LARGEFILE) =3D 6
fcntl64(6, F_SETFD, FD_CLOEXEC) =A0 =A0 =A0 = =A0 =3D 0
fstat64(6, {st_mode=3DS_IFREG|0644, st_size=3D15395, ..= .}) =3D 0
mmap2(NULL, 15395, PROT_READ, MAP_PRIVATE, 6, 0) =3D 0x= b7149000
close(6) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0=3D 0
mmap2(NULL, 143360, PROT_READ|PROT_WRITE, M= AP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0xb7126000
munmap(0xb7126000= , 143360) =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0
open("/usr/share/= fonts/X11/Type1/._c0419bt_.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENOENT (= No such file or directory)
open("/usr/share/fonts/X11/Type1/= %c0419bt_.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENOENT (No such file or d= irectory)
open("/usr/share/fonts/X11/Type1/.AppleDouble/c041= 9bt_.afm", O_RDONLY|O_LARGEFILE) =3D -1 ENOENT (No such file or direct= ory)
open("/usr/share/fonts/X11/Type1/c0419bt_.afm/..namedfo= rk/rsrc", O_RDONLY|O_LARGEFILE) =3D -1 ENOTDIR (Not a directory)
=
open("/usr/share/fonts/X11/Type1/c0419bt_.afm/rsrc", O_RDONL= Y|O_LARGEFILE) =3D -1 ENOTDIR (Not a directory)
open("/usr/s= hare/fonts/X11/Type1/resource.frk/c0419bt_.afm", O_RDONLY|O_LARGEFILE)= =3D -1 ENOENT (No such file or directory)
open("/usr/share/= fonts/X11/Type1/.resource/c0419bt_.afm", O_RDONLY|O_LARGEFILE) =3D -1 = ENOENT (No such file or directory)
munmap(0xb7149000, 15395) =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
stat64("/usr/share/fonts/X11/T= ype1/c0419bt_.pfb", {st_mode=3DS_IFREG|0644, st_size=3D40766, ...}) = =3D 0
open("/usr/share/fonts/X11/Type1/c0419bt_.pfb", O= _RDONLY|O_LARGEFILE) =3D 6
fcntl64(6, F_SETFD, FD_CLOEXEC) =A0 = =A0 =A0 =A0 =3D 0
fstat64(6, {st_mode=3DS_IFREG|0644, st_size=3D4= 0766, ...}) =3D 0
mmap2(NULL, 40766, PROT_READ, MAP_PRIVATE, 6, 0= ) =3D 0xb7143000
close(6) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0=3D 0
brk(0x9698000) =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 0x9698000


repeating indefinitely...
--bcaec51a89a05cee9d05169e589e--