From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10586 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: 32 bit musl? Date: Wed, 5 Oct 2016 19:02:43 -0400 Message-ID: <20161005230243.GM19318@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 1475708580 3195 195.159.176.226 (5 Oct 2016 23:03:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2016 23:03:00 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10599-gllmg-musl=m.gmane.org@lists.openwall.com Thu Oct 06 01:02:57 2016 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 1brvDE-0000E0-9X for gllmg-musl@m.gmane.org; Thu, 06 Oct 2016 01:02:56 +0200 Original-Received: (qmail 7981 invoked by uid 550); 5 Oct 2016 23:02:56 -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 7957 invoked from network); 5 Oct 2016 23:02:56 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10586 Archived-At: On Wed, Oct 05, 2016 at 06:20:55PM -0400, John Mudd wrote: > I've been using musl on a 32-bit Linux to build 32-bit apps to run on 32 > and 64-bit Linux machines. That works well. > > I upgraded to a 64 bit development box. I've assumed I would just need to > use -m32 option and I could still build 32 bit apps on my 64 bit machine. I > tried it but it tries to mix 32 & 64 bit code. I guess I was naive. > > It looks like I should build a cross compiler? I see several suggestions on > how to do this so I'm not confident this will work well. Or would it be > easier if I just installed a 32 bit Linux in a VM just for building 32 bit > apps with musl? GCC's multilib (-m32) is built on the assumption that the same set of headers can be used. This is generally an invalid assumption, not just for libc but for third-party libraries whose headers might be in the include paths too. In principle you could hack on the gcc spec files to get it to use different include paths for different ABIs, but a dedicated cross compiler is an easier approach. Rich