From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 08:48:45 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 9D2141065674 for ; Tue, 5 Jul 2011 08:48:45 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF638FC08 for ; Tue, 5 Jul 2011 08:48:44 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id A26827F38C4; Tue, 5 Jul 2011 10:48:43 +0200 (CEST) Date: Tue, 5 Jul 2011 10:48:43 +0200 From: Roman Divacky To: Robert Millan Message-ID: <20110705084843.GA98162@freebsd.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] FreeBSD compiler extensions 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, 05 Jul 2011 08:48:45 -0000 Why do you need this? Format-extensions are kernel only (which you dont use I presume) and no-align-long-strings is boot only (which you dont use either). Hm? :) roman On Tue, Jul 05, 2011 at 10:27:51AM +0200, Robert Millan wrote: > This patch conditionalizes a pair of FreeBSD compiler extensions so > that its CFLAGS are only used on FreeBSD. > > -- > Robert Millan > 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 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"