From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 12 21:06:13 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 A421A106566C; Tue, 12 Jul 2011 21:06:13 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 60D778FC0C; Tue, 12 Jul 2011 21:06:13 +0000 (UTC) Received: by iyb11 with SMTP id 11so6450350iyb.13 for ; Tue, 12 Jul 2011 14:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8pDwIWnNGqCqHzoyxZoNMUL68gr3cYARECJNiorBLns=; b=F1vSmk6jaizJz2xGMdSToZe8Dyk7t/iEr2qfY8x2vftVX5XL1lF7WNM1Is6tTPUf9r SpzyCQmZFvUrXg/3SYBzlqJxap9Tjzxrwmz+qF9U0GOt53RpgcC/9SVxobs9Q+dUeG2b tNuCApOILwpP7MaHByCXrOoW9rc9p4Cd5Jw14= MIME-Version: 1.0 Received: by 10.42.204.3 with SMTP id fk3mr332814icb.515.1310504772730; Tue, 12 Jul 2011 14:06:12 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.7 with HTTP; Tue, 12 Jul 2011 14:06:12 -0700 (PDT) In-Reply-To: <20110712164337.07e387eb@kan.dnsalias.net> References: <20110712164337.07e387eb@kan.dnsalias.net> Date: Tue, 12 Jul 2011 23:06:12 +0200 X-Google-Sender-Auth: GKoTVnla8ZTgztJ5UgAWbM0OoqY Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 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:06:13 -0000 2011/7/12 Alexander Kabaev : > Whatever happened to using a proper cross-tool to do the job? 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. > Why is this hack needed? 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. -- Robert Millan