From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13410 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Problems with pthreads from a shared object? Date: Wed, 7 Nov 2018 20:28:39 -0500 Message-ID: <20181108012839.GY5150@brightrain.aerifal.cx> References: <20181107233142.GV5150@brightrain.aerifal.cx> <20181107234526.GW5150@brightrain.aerifal.cx> <20181108004312.GX5150@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1541640407 22733 195.159.176.226 (8 Nov 2018 01:26:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2018 01:26:47 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13426-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 08 02:26:43 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 1gKZ5m-0005p3-Oh for gllmg-musl@m.gmane.org; Thu, 08 Nov 2018 02:26:42 +0100 Original-Received: (qmail 32553 invoked by uid 550); 8 Nov 2018 01:28:51 -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 32535 invoked from network); 8 Nov 2018 01:28:51 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13410 Archived-At: On Wed, Nov 07, 2018 at 08:02:01PM -0500, Barry Flartus wrote: > On Wed, Nov 7, 2018 at 7:43 PM Rich Felker wrote: > > > On Wed, Nov 07, 2018 at 06:53:33PM -0500, Barry Flartus wrote: > > > > > > > > OK. Can you run strace -f ./launch (or whatever the launch program > > > > executable is called) and post the output? > > > > > > > > Rich > > > > > > > > > The "launching" program was compiled with gcc: > gcc launch.c -ldl -o launch You can't use shared libraries built for musl with glibc, so it's expected that this doesn't work. > When I attempt to compile the "launching" program with musl-gcc I get the > following output: > vagrant@ubuntu-x64:~$ /usr/local/musl/x86_64/bin/musl-gcc launch.c -ldl -o > launch > vagrant@ubuntu-x64:~$ ./launch > > Launching test... > Dynamic loading not supported Apparently it's static-linked. Did you omit shared libraries when building musl? > The shared object was compiled with musl-gcc: > /usr/local/musl/x86_64/bin/musl-gcc -Wall -lpthread -shared -fPIC test.c -o > test.so If so (if there's no libc.so, only libc.a, present) then this command will also be producing a broken .so file. You can't make shared libraries without a shared libc existing. Rich