From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 17 23:00:27 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F42616A422 for ; Fri, 17 Feb 2006 23:00:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 116DE43D45 for ; Fri, 17 Feb 2006 23:00:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1HN0PdP061484 for ; Fri, 17 Feb 2006 23:00:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1HN0PP0061483; Fri, 17 Feb 2006 23:00:25 GMT (envelope-from gnats) Resent-Date: Fri, 17 Feb 2006 23:00:25 GMT Resent-Message-Id: <200602172300.k1HN0PP0061483@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Robert Millan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EDB316A420 for ; Fri, 17 Feb 2006 22:58:16 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id D95F743D46 for ; Fri, 17 Feb 2006 22:58:15 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1HMwFsK099041 for ; Fri, 17 Feb 2006 22:58:15 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k1HMwF7Q099040; Fri, 17 Feb 2006 22:58:15 GMT (envelope-from nobody) Message-Id: <200602172258.k1HMwF7Q099040@www.freebsd.org> Date: Fri, 17 Feb 2006 22:58:15 GMT From: Robert Millan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/93502: [patch] Fixes for non-FreeBSD in sys/conf/*.mk X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2006 23:00:27 -0000 >Number: 93502 >Category: kern >Synopsis: [patch] Fixes for non-FreeBSD in sys/conf/*.mk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Feb 17 23:00:25 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: GNU/kFreeBSD 7.0-1-686 i686 >Organization: >Environment: System: GNU/kFreeBSD orthanc 7.0-1-686 #0 Fri Feb 17 22:46:33 CET 2006 i686 i386 Intel(R) Pentium(R) 4 CPU 1.80GHz GNU/kFreeBSD Architecture: i686 >Description: Please could you apply a pair of fixes in sys/conf/*.mk to support building the kernel of FreeBSD in a non-FreeBSD system? - On non-FreeBSD systems: - disable FreeBSD extensions to GCC - install modules as group "root" instead of "wheel" Thanks for considering >How-To-Repeat: >Fix: diff -ur sys.old/conf/kern.mk sys/conf/kern.mk --- sys.old/conf/kern.mk 2006-02-17 20:25:31.000000000 +0100 +++ sys/conf/kern.mk 2006-02-17 20:34:31.000000000 +0100 @@ -1,5 +1,9 @@ # $FreeBSD: src/sys/conf/kern.mk,v 1.46 2005/07/15 11:45:30 ache Exp $ +.if !defined(OPSYS) +OPSYS!= uname -s +.endif + # # Warning flags for compiling the kernel and components of the kernel. # @@ -9,10 +13,14 @@ .if ${CC} == "icc" #CWARNFLAGS= -w2 # use this if you are terribly bored CWARNFLAGS= -.else -CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ +.elif !defined(CWARNFLAGS) +CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -fformat-extensions -std=c99 + -std=c99 +.if ${OPSYS} == "FreeBSD" +# FreeBSD extensions, not available in upstream GCC +CWARNFLAGS+= -fformat-extensions +.endif .endif # # The following flags are next up for working on: @@ -30,8 +38,12 @@ # reserved for user applications. # .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \ +CFLAGS+= -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 +.if ${OPSYS} == "FreeBSD" +# FreeBSD extensions, not available in upstream GCC +CFLAGS+= -mno-align-long-strings +.endif INLINE_LIMIT?= 8000 .endif diff -ur sys.old/conf/kern.post.mk sys/conf/kern.post.mk --- sys.old/conf/kern.post.mk 2006-02-17 20:25:31.000000000 +0100 +++ sys/conf/kern.post.mk 2006-02-17 20:35:39.000000000 +0100 @@ -1,5 +1,15 @@ # $FreeBSD: src/sys/conf/kern.post.mk,v 1.92 2006/02/07 13:37:26 ru Exp $ +.if !defined(OPSYS) +OPSYS!= uname -s +.endif + +.if ${OPSYS} == "FreeBSD" +WHEEL_GROUP?= wheel +.else +WHEEL_GROUP?= root +.endif + # Part of a unified Makefile for building kernels. This part includes all # the definitions that need to be after all the % directives except %RULES # and ones that act like they are part of %RULES. @@ -226,16 +234,16 @@ fi .endif mkdir -p ${DESTDIR}${KODIR} - ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR} + ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) - ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} + ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif kernel-reinstall: @-chflags -R noschg ${DESTDIR}${KODIR} - ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR} + ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) - ${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} + ${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif config.o env.o hints.o vers.o vnode_if.o: >Release-Note: >Audit-Trail: >Unformatted: