From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 12 21:38:12 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BC301065673; Tue, 12 Jul 2011 21:38:12 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A06078FC14; Tue, 12 Jul 2011 21:38:11 +0000 (UTC) Received: by vws18 with SMTP id 18so5238329vws.13 for ; Tue, 12 Jul 2011 14:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=mQP06jiZAQhTok4F3PTr0tRo3Ln5JHlG/wevEJbrflk=; b=rD1RSzntgYDFoHS3Tg72jF/hdfPmLSbZfS6MybXcc/AtudGTPF/v4YLn/c1bAyX3mc DPcM4qzX/9lJrMD9XNUgh8fad5uirVR+3N1L3bkLpD5GUdngkqtGvl3nQcoHLAQIZzix FxcUi2OgVrjCGGOTmnrmNcqs+22ZWYFwErXIw= Received: by 10.52.22.148 with SMTP id d20mr429083vdf.453.1310506690705; Tue, 12 Jul 2011 14:38:10 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id bd5sm2401925vcb.35.2011.07.12.14.38.09 (version=SSLv3 cipher=OTHER); Tue, 12 Jul 2011 14:38:09 -0700 (PDT) Date: Tue, 12 Jul 2011 17:38:03 -0400 From: Alexander Kabaev To: Robert Millan Message-ID: <20110712173803.4979d741@kan.dnsalias.net> In-Reply-To: References: <20110712164337.07e387eb@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/CDX74KCQylI=NdEgh1ZfMG1"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org, Ed, Maste , Oliver Pinter Subject: Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 21:38:12 -0000 --Sig_/CDX74KCQylI=NdEgh1ZfMG1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 12 Jul 2011 23:06:12 +0200 Robert Millan wrote: > 2011/7/12 Alexander Kabaev : > > Whatever happened to using a proper cross-tool to do the job? >=20 > Why would one need to build a cross-compiler in order to compile > userland-agnostic code for the same CPU architecture? This would be > like requiring a cross-compiler in order to build things like GRUB or > SeaBIOS. >=20 > > Why is this hack needed? >=20 > The kernel tree expects flags like __linux__ or __FreeBSD__ to have a > different meaning when compiling for kernel space. Instead of "we're > building code that will run on $foo", they mean "we're building $foo > itself". This assumption is correct most of the time, but not always > so. My patch addresses some of the situations in which the assumption > fails. >=20 > --=20 > Robert Millan The fact that Linux compiler with manually undefined and re-defined platform macros can compile is a coincidence and is not guaranteed to work and certainly is not a goal of FreeBSD project so this can be broken at any moment. Relying on that is unwise, putting hacks into FreeBSD sources to legitimize the practice is not the move I would support as well. Traditionally, IMHO. --=20 Alexander Kabaev --Sig_/CDX74KCQylI=NdEgh1ZfMG1 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOHL6/Q6z1jMm+XZYRAgbpAJ9a/Cfw3W/rYKV/A/ZxuxL3V9C1EQCgop6T SbL4a1iQYhKO1Mw/5rGSEyM= =EVg+ -----END PGP SIGNATURE----- --Sig_/CDX74KCQylI=NdEgh1ZfMG1--