From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13616 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Combine musl compiled library with gcc app? Date: Fri, 18 Jan 2019 10:52:28 -0500 Message-ID: <20190118155228.GO23599@brightrain.aerifal.cx> References: 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 1547826637 14054 195.159.176.226 (18 Jan 2019 15:50:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2019 15:50:37 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13632-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 18 16:50:33 2019 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 1gkWPh-0003YB-0R for gllmg-musl@m.gmane.org; Fri, 18 Jan 2019 16:50:33 +0100 Original-Received: (qmail 23556 invoked by uid 550); 18 Jan 2019 15:52:42 -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 22511 invoked from network); 18 Jan 2019 15:52:41 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13616 Archived-At: On Fri, Jan 18, 2019 at 10:41:38AM -0500, John Mudd wrote: > Is it possible to link a gcc compiled app with a musl compiled library? I > assume this would require linking with both glibc and musl libc libraries. I think you mean glibc, not gcc. If you have built libraries with musl, they are almost certainly not suitable for loading by glibc. They will not reference any versioned glibc symbols so would get ancient, buggy versions of the glibc functions. In some cases, types will mismatch too because of this; on 32-bit archs for example the standard-name functions in glibc taking off_t expect it to be a 32-bit type. The other direction, building a library with glibc and loading it with musl, *is* intended to work in almost all cases as long as you're not using glibc-specific functions or glibc-specific extensions to standard functions which musl does not support. Neither of these is a really good idea though. If you're capable of building the code from source it makes sense to build it properly for the target it's going to be run on. Rich