From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2435 Path: news.gmane.org!not-for-mail From: croco@openwall.com Newsgroups: gmane.linux.lib.musl.general Subject: Re: static linking and dlopen Date: Sun, 9 Dec 2012 10:36:58 +0400 Message-ID: <20121209063658.GA2925@openwall.com> References: <20121208225237.GV20323@brightrain.aerifal.cx> <50C3CA75.8000504@comcast.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1355035011 27276 80.91.229.3 (9 Dec 2012 06:36:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2012 06:36:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2436-gllmg-musl=m.gmane.org@lists.openwall.com Sun Dec 09 07:37:05 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ThaVb-0000QJ-Nj for gllmg-musl@plane.gmane.org; Sun, 09 Dec 2012 07:37:03 +0100 Original-Received: (qmail 24430 invoked by uid 550); 9 Dec 2012 06:36:51 -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 24422 invoked from network); 9 Dec 2012 06:36:51 -0000 Content-Disposition: inline In-Reply-To: <50C3CA75.8000504@comcast.net> User-Agent: Mutt/1.5.18 (2008-05-17) Xref: news.gmane.org gmane.linux.lib.musl.general:2435 Archived-At: Hi folks, On Sat, Dec 08, 2012 at 03:17:09PM -0800, Charlie Kester wrote: > I wonder if most of what people want to do with dlopen couldn't be done > just as well (or better) with good old fork() and exec(), along with > some suitable interprocess communication. The thing I recalled right off, is that, e.g., interpreters of Tcl are able to load C-written functions to extend the functionality of the interpreter (e.g. with a domain-specific set of functions), and this is done with dlopen. I think Tcl is not the only interpreter doing so. I even used the same technique in one of my works (it was an interpreter of (small subset of) Lisp, extendable in the same way). Well, may be this (in theory) can be done with fork/exec, with some protocol on the pipes, etc., but as for me, I would never use such a solution, preferring to keep the interpreter non-extendable: having library functions' implementations in an external process conflicts with my sense of aesthetics :-) IMHO, for some (monstrous) programs such as browsers, or Gimp, or whatever alike, having all the dynamic linking logic inside is not a catastrophe, because the catastrophe is their size as such. For interpreters, the catastrophe is the fact of interpreted execution, and dlopen will add next to nothing to it. Anyway, for a lot of existing programs, the absense of dlopen will mean a necessity for heavy rewritings in order to compile them with musl - perhaps too heavy to be done at all. P.S. thank you for the great work you do! -- Cheers, Croco