From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 28 23:30:09 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8040F1065673 for ; Thu, 28 Jul 2011 23:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3E6A58FC14 for ; Thu, 28 Jul 2011 23:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SNU9ud029726 for ; Thu, 28 Jul 2011 23:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p6SNU9bb029724; Thu, 28 Jul 2011 23:30:09 GMT (envelope-from gnats) Resent-Date: Thu, 28 Jul 2011 23:30:09 GMT Resent-Message-Id: <201107282330.p6SNU9bb029724@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 [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EEF9106566B for ; Thu, 28 Jul 2011 23:26:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 7FA938FC15 for ; Thu, 28 Jul 2011 23:26:53 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6SNQrFk032885 for ; Thu, 28 Jul 2011 23:26:53 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p6SNQrRR032884; Thu, 28 Jul 2011 23:26:53 GMT (envelope-from nobody) Message-Id: <201107282326.p6SNQrRR032884@red.freebsd.org> Date: Thu, 28 Jul 2011 23:26:53 GMT From: Robert Millan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/159278: [PATCH] FreeBSD compiler extensions 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: Thu, 28 Jul 2011 23:30:09 -0000 >Number: 159278 >Category: kern >Synopsis: [PATCH] FreeBSD compiler extensions >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 28 23:30:08 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: Debian GNU/kFreeBSD "sid" >Organization: >Environment: >Description: This patch conditionalizes a pair of FreeBSD compiler extensions so that its CFLAGS are only used on FreeBSD. See also: http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/035766.html >How-To-Repeat: >Fix: Patch attached with submission follows: Index: sys/conf/kern.mk =================================================================== --- sys/conf/kern.mk (revision 223736) +++ sys/conf/kern.mk (working copy) @@ -1,11 +1,21 @@ # $FreeBSD$ +.if !defined(OPSYS) +OPSYS!= uname -s +.endif + # # Warning flags for compiling the kernel and components of the kernel: # +.if ${OPSYS} == "FreeBSD" +# FreeBSD extension, not available in upstream GCC +format_extensions= -fformat-extensions +no_align_long_strings= -mno-align-long-strings +.endif + CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -Wundef -Wno-pointer-sign -fformat-extensions \ + -Wundef -Wno-pointer-sign ${format_extensions} \ -Wmissing-include-dirs -fdiagnostics-show-option # # The following flags are next up for working on: @@ -32,7 +42,7 @@ # .if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +CFLAGS+= ${no_align_long_strings} -mpreferred-stack-boundary=2 -mno-sse .else CFLAGS+= -mno-aes -mno-avx .endif >Release-Note: >Audit-Trail: >Unformatted: