From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1164 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: installation on bi-arch system Date: Sun, 17 Jun 2012 16:06:13 -0700 Message-ID: <20120617160613.7f599078@newbook> References: <9015794.u7FZ5h2CIA@linuix> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339974565 21212 80.91.229.3 (17 Jun 2012 23:09:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2012 23:09:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1165-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 18 01:09:22 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 1SgOau-0006p3-IV for gllmg-musl@plane.gmane.org; Mon, 18 Jun 2012 01:09:20 +0200 Original-Received: (qmail 21869 invoked by uid 550); 17 Jun 2012 23:09:20 -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 21860 invoked from network); 17 Jun 2012 23:09:20 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=0TBHDP02oJ79zVUIMVOJwpu9KRCXkqYdTL1ptcdYs80pZcn8siXA5FedO/mwqVbuxoLJtqBfTWMJ+J9J2x7QfWvSydSdVJxNg/PUylqtZ3bxH127qaZmOVCr9+Fqi9YAcwiBHLIkGh+Q+VkkzbCkMH+AUVxyjkLX11QMf4nfwwo=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <9015794.u7FZ5h2CIA@linuix> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:1164 Archived-At: On Sun, 17 Jun 2012 19:24:01 +0200 Bruno Haible wrote: > Hi, > > Trying to install musl-0.9.1 as a 32-bit library on a bi-arch x86_64 > glibc system. The usual way to configure packages for this > configuration is > ./configure CC="gcc -m32" > or > CC="gcc -m32" ./configure > See > . > But this does not work with musl's configure script: > > $ CC="gcc -m32" ./configure --prefix=/arch/x86-linux/inst-musl > --exec-prefix=/arch/x86-linux/inst-musl CC="gcc -m32" checking for C > compiler... gcc -m32 checking whether compiler is gcc... no > checking target system type... unknown > ./configure: unable to detect target arch; try ./configure > --target=... 1. musl does not use autoconf, just a handwritten shell script that accepts similar arguments. 2. I had always thought it was CC=gcc CFLAGS=-m32 ... 3. ./configure uses $ type "$CC" to detect whether using $CC will work. This means that all options must be set in CFLAGS. Even if $CC did get accepted, gcc -m32 -dumpmachine (how musl detects $ARCH) may not give i?86-linux-*, thus failing the configure. > As a workaround, I have to create a wrapper script that invokes "gcc > -m32 ..." and pass that as CC. This should not be needed. See 2. Also note the --target= option (--target=i386 in this case). --target=i386 should properly set CFLAGS to include -march=i486 -m32 (unless otherwise specified in CFLAGS). > Additionally, the musl-gcc script that gets created by "make install" > looks like this: > > #!/bin/sh > exec gcc "$@" -specs "/arch/x86-linux/inst-musl/lib/musl-gcc.specs" > > When invoked with option "-c", it produces 64-bit .o files. To produce > 32-bit .o files, it should read like this: > > #!/bin/sh > exec gcc-32 "$@" -specs "/arch/x86-linux/inst-musl/lib/musl-gcc.specs" > > or like this: > > #!/bin/sh > exec gcc -m32 "$@" -specs > "/arch/x86-linux/inst-musl/lib/musl-gcc.specs" Again, I thought the standard was CFLAGS=-m32. The approach you're proposing won't work when someone has both architectures cross-building musl. (Although really, the spec file has to be modified before that works, and that in turn would call for a multiarch build target, which means VPATH/out-of-tree builds or a change in object naming...) > Bruno >