From owner-freebsd-arch@FreeBSD.ORG Wed Nov 17 20:55:33 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 EE2AF1065675; Wed, 17 Nov 2010 20:55:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 839458FC1C; Wed, 17 Nov 2010 20:55:33 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oAHKtPD7031845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Nov 2010 22:55:25 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oAHKtOZ4014889; Wed, 17 Nov 2010 22:55:24 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oAHKtO36014888; Wed, 17 Nov 2010 22:55:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Nov 2010 22:55:24 +0200 From: Kostik Belousov To: Warner Losh Message-ID: <20101117205524.GX2392@deviant.kiev.zoral.com.ua> References: <201007291718.12687.tijl@coosemans.org> <4CE417B3.3030102@bsdimp.com> <201011172058.05683.tijl@coosemans.org> <4CE43B7A.8030202@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ia1W/kazkNZ7h/Wz" Content-Disposition: inline In-Reply-To: <4CE43B7A.8030202@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Warner Losh , freebsd-arch@freebsd.org, Tijl Coosemans , Dimitry Andric , Garrett Cooper 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 20:55:34 -0000 --Ia1W/kazkNZ7h/Wz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 17, 2010 at 01:30:50PM -0700, Warner Losh wrote: > On 11/17/2010 12:57, Tijl Coosemans wrote: > >On Wednesday 17 November 2010 18:58:11 Warner Losh wrote: > >>On 11/17/2010 10:21, Garrett Cooper wrote: > >>>On Wed, Nov 17, 2010 at 4:19 AM, Dimitry Andric wro= te: > >>>>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 > >>This patch looks good. I agree we should commit it right away. I can > >>do the honors later today, or dim@ can. I'm agnostic who does the push. > >Committed as r215439. > > > >>>>>>:> http://people.freebsd.org/~tijl/cc-m32-2.diff > >>>>>>:> http://people.freebsd.org/~tijl/cc-m32-3.diff > >>Now that we have tbemd in the tree, we should take a fresh look at these > >>patches. I'll try to look at these later today as well. > >I've updated them to today's CURRENT. They're a bit smaller now because > >some amd64 headers have been moved to x86. This also solved the problem > >with the kdump build. > > > >Here are the commit logs: > > > >cc-m32-2.diff: > > > > Install i386 headers on amd64. > > > > Machine specific headers for an architecture $arch are now installed > > under /usr/include/$arch. This means machine headers are always in = the > > same location whether you are cross compiling or not. > > > > /usr/include/machine is a symlink to /usr/include/${MACHINE}. > Yea, I don't like this (the sym link) at all because. Machine headers=20 > wind up being wrong for amd64, so you have to resort to the following=20 > kludge. > >cc-m32-3.diff: > > Modify amd64 headers to include i386 headers when compiling 32 bit= =20 > > code. > > > > All amd64 headers follow the following format: > > > > #ifndef _AMD64_HEADER_H_ > > #define _AMD64_HEADER_H_ > > > > #ifdef __i386__ > > #include > > #else > > > > /* Amd64 declarations go here. */ > > > > #endif /* __i386__ */ > > #endif /* !_AMD64_HEADER_H_ */ > ... you wind up with stuff like this, which is also wrong. It precludes= =20 > implementing -mpc98 for building on amd64, for example. Isn't the ABI on pc98 port identical to i386 ABI ? If yes, I do not see a reason to want -mpc98. -m32 is a way to compile for the "32bit usermode twin" of the current architecture only, and never intended to be a cross-compilation environment. >=20 > I'd rather we install {i386,amd64} into /usr/include/ and have machine=20 > be generated from those two directories (or three, if we supported=20 > -mpc98 ever). That way, we wouldn't "forget" to add this code to new=20 > headers, etc. The generated code would be trivial: >=20 > #ifdef __i386__ > #include > #else > #include > #endif >=20 > (which is extensible to support pc98 too, if we wanted to add -mpc98). >=20 > Of course, I'd really rather we have a /usr/include32 which has a=20 > separate, pristine copy of everything in it. But that's a much larger=20 > patch. I think it would be cleaner, but there seems to be universal=20 > resistance to this sort of scheme. >=20 > Warner >=20 > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" --Ia1W/kazkNZ7h/Wz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzkQTwACgkQC3+MBN1Mb4hhyQCfUV8Xgi2OgIjdichxpoNGfuF+ HW4AoNFnc0M99ggFaKB+pWdT1Zq3KS9j =88hY -----END PGP SIGNATURE----- --Ia1W/kazkNZ7h/Wz--