From owner-freebsd-arch@FreeBSD.ORG Thu Nov 17 14:59:58 2011 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 CE3A71065677; Thu, 17 Nov 2011 14:59:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A23498FC1B; Thu, 17 Nov 2011 14:59:58 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4F2AC46B0A; Thu, 17 Nov 2011 09:59:58 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DC1A78A053; Thu, 17 Nov 2011 09:59:57 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 17 Nov 2011 09:59:56 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201111170959.56767.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 17 Nov 2011 09:59:58 -0500 (EST) Cc: Kostik Belousov , Adrian Chadd , freebsd-arch@freebsd.org, Robert Millan Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers 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: Thu, 17 Nov 2011 14:59:58 -0000 On Thursday, November 17, 2011 1:46:33 am Robert Millan wrote: > 2011/11/16 Warner Losh : > > My second reaction was why not have > > > > #ifndef __FreeBSD_kernel__ > > #define __FreeBSD_kernel__ __FreeBSD__ > > #endif > > > > in sys/param.h and then just change __FreeBSD__ to __FreeBSD_kernel__ in the headers that are affected? But I'm not quite sure what effects that would have on your environment. > > I'm fine with this. > > > Why do you think people wouldn't be fond of the __FreeBSD_kernel__ being defined? > > See archived discussion: > > http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/035721.html > > particularly this mail in which you participated: > > http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/035823.html I recall the discussion from earlier. I can't recall if I had replied to it though. :-/ In my current opinion, I think it would be fine to define __FreeBSD_kernel__ on FreeBSD and to do it in for now until all the compilers we use have been updated to define it automatically (which may be a long time). I think it will also be fine to patch in-system headers to use __FreeBSD_kernel__ once is defined. Unfortunately headers in 3rd party software are going to have to check for both __FreeBSD__ and __FreeBSD_kernel__ to support both GNU/kFreeBSD and older FreeBSD for the foreseeable future. I think that is fine, but that the sooner we add __FreeBSD_kernel__ on FreeBSD the sooner we get the clock started for a day when those extra checks can go away. I would also be fine with MFC'ing the addition of __FreeBSD_kernel__ to older branches (at least 7 - 9) as well. -- John Baldwin