From owner-freebsd-arch@FreeBSD.ORG Wed Nov 17 12:19:58 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52E16106564A for ; Wed, 17 Nov 2010 12:19:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 118478FC08 for ; Wed, 17 Nov 2010 12:19:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:35d6:3174:5c3b:5304] (unknown [IPv6:2001:7b8:3a7:0:35d6:3174:5c3b:5304]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 28F615C43; Wed, 17 Nov 2010 13:19:57 +0100 (CET) Message-ID: <4CE3C86D.3060501@FreeBSD.org> Date: Wed, 17 Nov 2010 13:19:57 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.13pre) Gecko/20101113 Lanikai/3.1.7pre MIME-Version: 1.0 To: Tijl Coosemans References: <201007291718.12687.tijl@coosemans.org> <201008301731.19074.tijl@coosemans.org> <20100830.123636.59640143160044949.imp@bsdimp.com> <201008302210.07110.tijl@coosemans.org> In-Reply-To: <201008302210.07110.tijl@coosemans.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re: Support for cc -m32 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 12:19:58 -0000 On 2010-08-30 22:09, Tijl Coosemans wrote: > On Monday 30 August 2010 20:36:36 M. Warner Losh wrote: >> :> http://people.freebsd.org/~tijl/cc-m32-1.diff >> :> http://people.freebsd.org/~tijl/cc-m32-2.diff >> :> http://people.freebsd.org/~tijl/cc-m32-3.diff >> :> >> :> *cc-m32-1.diff* : Let ld and cc find 32 bit libraries. ... >> I have been trying to get the tbemd patches into the tree and these >> patches conflict with them. Can we hold off until I get them in? >> I've had to rebase things myself a dozen times and each time I've only >> been able to get part of the patches in... >> >> I still have the objections from before, but I'll take a look at the >> new patches to see if they are addressed or not. > > Ok, no problem. Could we please commit that first diff, at least? As it is now, -m32 cannot even produce 'hello world', so it will only be an improvement. It doesn't seem to clash with tbemd changes either. This will also help with binutils 2.17 and certain ports, such as valgrind. Apparently our current ld just warns about arch mismatch, but produces a .so file anyway (!!): ... cc -L/usr/lib32 -m32 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fpic -O -g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-long-long -O2 -pipe -fno-strict-aliasing -Wno-pointer-sign -fno-stack-protector -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst -L/usr/lib32 -m32 -o vgpreload_core-x86-freebsd.so vgpreload_core_x86_freebsd_so-vg_preloaded.o /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crti.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtbeginS.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtendS.o' is incompatible with i386 output /usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/crtn.o' is incompatible with i386 output But in later versions of ld this was changed to a (more appropriate) fatal error. :) Of course the 2nd and 3rd diffs mess around with headers and such, so they'll need more scrutiny, but the first one should be no problem, IMHO.