From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13416 Path: news.gmane.org!.POSTED!not-for-mail From: Barry Flartus Newsgroups: gmane.linux.lib.musl.general Subject: Re: Problems with pthreads from a shared object? Date: Thu, 8 Nov 2018 12:14:39 -0500 Message-ID: References: <20181107233142.GV5150@brightrain.aerifal.cx> <20181107234526.GW5150@brightrain.aerifal.cx> <20181108004312.GX5150@brightrain.aerifal.cx> <20181108151715.GA5150@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005f2ede057a2a5f43" X-Trace: blaine.gmane.org 1541697179 2914 195.159.176.226 (8 Nov 2018 17:12:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2018 17:12:59 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13432-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 08 18:12:55 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 1gKnrS-0000bn-WF for gllmg-musl@m.gmane.org; Thu, 08 Nov 2018 18:12:55 +0100 Original-Received: (qmail 11744 invoked by uid 550); 8 Nov 2018 17:15:03 -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 11723 invoked from network); 8 Nov 2018 17:15:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=32alSpnHG8wb/fBxlKfHdiMntIIcyhKORaSt6+jNxF0=; b=W6RscCKSZq5MSgM404py3RVpjLOuGcvGOs8xW4Dy5PgeuGiMGCOL1kExHK3ApCa4zG BMkhxhrVkGUoTg2q22NwMNZnqCDNuOtQwDBe7keDKmeOie157uS2V0eZf8Gjx2dI4GUA PnyliyFRa8hbEfrqNclps7QlVRyL1/nKFTelyLmE807hSLOB3tjJF4fxXl6H2MLWWk1G tQPTd5Wlktct+0lBvDZ7LJ/acxHKKiDao7SJsj5uXfuUqOTRKoskJw1edMbpQdaSWRge DP1Ip0Kl0hFTdZwNTp8iyH79YHJC1c+AR2/2LUnuxsoaJ3jhisBdf50cwMuCYfd1EaiZ 3pgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=32alSpnHG8wb/fBxlKfHdiMntIIcyhKORaSt6+jNxF0=; b=DbLkecsiyhVQA3hRIesxLFX0vQf6sBW12d+smyK/tMHYaBZy30+gvRygcEhl7LRRKP le8gphZvnd++FE6tpYdAkBBp42zP6qiu7V0cJnBcDSONFXChihqiv2k3B886cS0+ljY8 aOTV4iyM5sBdcqWUcO1Kc3107DzKEA7oKH6/R6XjJDxHwzKf5EFnT8P1dBmYS8vpCTpR z16yDeVhy4zW2y49nWC27hAGrL5gLz89vd/0P1/kZQ+Qirq9Pzh1kTLahWG9ng8FmVA/ cQZX2Wxj8zdj+r9BhcqTu7z/GZ02bg7gGrDzGJfAmck8bq9O8UWqKvtPsSNHAAAEsEIh t0Ag== X-Gm-Message-State: AGRZ1gKAoI7iiwzDbSjegkhnzZYBMEv/DF9uKjjG7dDnHzaEtFty1uN3 MUraHUOzeN4me9w7xAlqJXgb95o4yE4ZgB5/taJRnddP X-Google-Smtp-Source: AJdET5ctb4pKbgnPyiPxytr1yXQigaxeZXeW7EGjbBpI1s1iiQ5EG8mtyIk7xnx6WV5IUFTdi0bsmkD772AURv9y0vs= X-Received: by 2002:a05:660c:f8a:: with SMTP id x10mr1694283itl.64.1541697290837; Thu, 08 Nov 2018 09:14:50 -0800 (PST) In-Reply-To: <20181108151715.GA5150@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13416 Archived-At: --0000000000005f2ede057a2a5f43 Content-Type: text/plain; charset="UTF-8" > > I think it would be helpful to understand what you're trying to do. > Thanks for your help so far. Let me try and explain what I'm trying to accomplish. I have a program that runs as an executable and uses pthreads. I've compiled this program with musl statically with the end goal of it being portable across older and newer systems. I want to also be able to compile this program as a shared object so it may be loaded via dlopen() inside of a glibc program. As mentioned previously, if I compile my shared object with glibc, it loads via dlopen(). My lack of understanding is this: if I directly compile in musl's libc.a (which contains its implementation of pthreads) into my shared object, shouldn't it have the relevant pthreads functions compiled in, without having runtime issues? That's what seems to work for my musl-compiled static executable, so I'm trying to wrap my head around why it wouldn't work for a shared object. In my case, I'm considering the shared object just a different form-factor for the same program. --0000000000005f2ede057a2a5f43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think it would be helpful to understa= nd what you're trying to do.

Thanks= for your help so far. Let me try and explain what I'm trying to
<= div>accomplish. I have a program that runs as an executable and uses pthrea= ds.
I've compiled this program with musl statically with the = end goal of it
being portable across older and newer systems. I w= ant to also be able to
compile this program as a shared object so= it may be loaded via dlopen()
inside of a glibc program. As ment= ioned previously, if I compile my shared
object with glibc, it lo= ads via dlopen().

My lack of understanding is this= : if I directly compile in musl's libc.a
(which contains its = implementation of pthreads) into my shared object,
shouldn't = it have the relevant pthreads functions compiled in, without
havi= ng runtime issues? That's what seems to work for my musl-compiled
=
static executable, so I'm trying to wrap my head around why it wou= ldn't
work for a shared object. In my case, I'm consideri= ng the shared object
just a different form-factor for the same pr= ogram.
--0000000000005f2ede057a2a5f43--