From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8382 Path: news.gmane.org!not-for-mail From: Andy Lutomirski Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl-gcc -m32 is broken Date: Thu, 27 Aug 2015 17:49:07 -0700 Message-ID: <55DFB003.8070107@amacapital.net> References: <20150827014407.GT32742@brightrain.aerifal.cx> <55DF6BDD.6000104@amacapital.net> <20150827200914.GX32742@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1440722969 23489 80.91.229.3 (28 Aug 2015 00:49:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2015 00:49:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8394-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 28 02:49:28 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZV7rE-0003PR-06 for gllmg-musl@m.gmane.org; Fri, 28 Aug 2015 02:49:28 +0200 Original-Received: (qmail 8001 invoked by uid 550); 28 Aug 2015 00:49:25 -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 7954 invoked from network); 28 Aug 2015 00:49:21 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=7ild0bxBjmFQx8FG5GLLso+U08MMKNw70M9aZECAcPA=; b=lkyblMD2Exlt0IZCwMmj996fMkaxLpQxTd/od2MMUFSVrQ8plXM918c98QJXN29cHE Aq44jVPe9ISieYeLixgVU4MEwzT/Ed7M3nxIUHunuu9XbUwy8Ec+Jn7UaMcKx1RRgm22 zHzeOiff8lKkgPECe9r4AC4W4E2l8/V1qZTfFbEQzKNJGrzmt68gXJcs4qWDjmCuIZEY jKHM6v+gUqQKsJfdJs/bQ1pA7mqahw+YSW0KUqBbWVwJVxZLtDGyHVAKz5JB9yhTdmdm JKihvDKusY27Y7wTCNGyT0C2szNgUS+C6pyFZpgbMzhSBVSpQL1C3Ti2cUWqgmv5jO4Z Llhg== X-Gm-Message-State: ALoCoQnEjv//66HI7WB0w3/mBd7C46PO8nuVv9KUj47HBGqkPPbrv2HvtUiuABkFwM+wix1KroD7 X-Received: by 10.66.227.98 with SMTP id rz2mr11462070pac.16.1440722949483; Thu, 27 Aug 2015 17:49:09 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: <20150827200914.GX32742@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:8382 Archived-At: On 08/27/2015 01:09 PM, Rich Felker wrote: > On Thu, Aug 27, 2015 at 12:58:21PM -0700, Andy Lutomirski wrote: >> On 08/26/2015 06:44 PM, Rich Felker wrote: >>> On Wed, Aug 26, 2015 at 03:16:22PM -0700, Andy Lutomirski wrote: >>>> Adding %{m16|m32:-m elf_i386} to the *link spec in musl-gcc.specs >>>> fixes at least the obvious failure for me. >>> >>> Can you clarify? musl-gcc's target is coupled to the target arch that >>> the corresponding musl libc was built for. Switching targets with -m32 >>> and similar options is not going to get you correspondingly switched >>> libraries. Or am I misunderstanding what you're trying to do? >> >> I build for an i386 target on an x86_64 Fedora system using >> CFLAGS=-m32. It built successfully and even seems to work, but >> musl-gcc ends up omitting -m32 in the link stage, so it tries to >> pick up the wrong libraries and fails to link. > > I think -m32 should be part of $CC, not $CFLAGS. Then it should get > incorporated into the musl-gcc script. > I don't suppose the configure script could be taught to do this automatically if I type --target=i386? (Or at least to document this somehow.) I searched for how to handle -m32 musl builds, and I got very conflicting advice. --Andy