From owner-freebsd-current@FreeBSD.ORG Thu May 26 18:57:57 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD2A2106566B for ; Thu, 26 May 2011 18:57:57 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 944168FC13 for ; Thu, 26 May 2011 18:57:57 +0000 (UTC) Received: by pwj8 with SMTP id 8so598927pwj.13 for ; Thu, 26 May 2011 11:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tLpKth4vIh0f8eSwkPpryhbPlaiQGQzIHIgJNpWXX7Q=; b=C8LJRgsOuG0YW5/OLASLQkDCwknLMUcjKSzuoDqoRgpj4hpoV3I/m10jiTj/MjPt7z 4EhtvoTQGCLtzEVFQbCK9/4XlCZnynrvrZQE79Yzwef8IyHVW79h48oAuBCRc5AupMzz QbYhI57Dv6ynwxofcJt1663dQRyk2Q/tDSLks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Isso3W7dPyvFfns/wwEPMqunOjIygiHhkfCkJYIGraKKV53m8zqz/ZdckEGrXnjIAB BIFZTvH4iV/OOc88EVAi574/ctrz5L03hi91sGVbN9B9WHMXrXrhT34Zz5YYvPRv0jGZ l1eovitDWKSHxvWvNTQ0Vs+Ccsvy9/QQkRmoo= MIME-Version: 1.0 Received: by 10.68.58.103 with SMTP id p7mr474625pbq.518.1306436276896; Thu, 26 May 2011 11:57:56 -0700 (PDT) Received: by 10.68.54.193 with HTTP; Thu, 26 May 2011 11:57:56 -0700 (PDT) In-Reply-To: <1306267772-31084-1-git-send-email-lacombar@gmail.com> References: <1306267772-31084-1-git-send-email-lacombar@gmail.com> Date: Thu, 26 May 2011 14:57:56 -0400 Message-ID: From: Arnaud Lacombe To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Arnaud Lacombe Subject: Re: [PATCH] Fix CFLAGS overwrite by Makefile X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 18:57:57 -0000 Hi, On Tue, May 24, 2011 at 4:09 PM, Arnaud Lacombe wrote: > Many Makefile (espectially under sys/boot/) overwrite the value of CFLAGS= . > This is an issue if you want to generate code for a specific CPU as befor= e the > Makefile is interpreted, CFLAGS might already have been set with CPU spec= ific > settings by , which is source from sys.mk. > For the record, I maintain the bootloader part of that patch. So far, it has not been (technically) proven that optimizing the bootloader for a specific CPU breaks it in any way. So when I, as a FreeBSD integrator, explicitly tells the build to target a given CPU, I expect _all_ the component to be optimized for such a CPU. Beside that contention point, I'd hope that the gvinum part can be committe= d. - Arnaud > Signed-off-by: Arnaud Lacombe > --- > =A0sbin/gvinum/Makefile =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/arm/at91/Makefile.inc =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/i386/boot2/Makefile =A0 =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/i386/gptboot/Makefile =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/i386/gptzfsboot/Makefile =A0 =A0| =A0 =A02 +- > =A0sys/boot/i386/kgzldr/Makefile =A0 =A0 =A0 =A0| =A0 =A02 +- > =A0sys/boot/i386/zfsboot/Makefile =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/pc98/boot2/Makefile =A0 =A0 =A0 =A0 | =A0 =A02 +- > =A0sys/boot/pc98/kgzldr/Makefile =A0 =A0 =A0 =A0| =A0 =A02 +- > =A0sys/boot/powerpc/boot1.chrp/Makefile | =A0 =A02 +- > =A0sys/boot/sparc64/boot1/Makefile =A0 =A0 =A0| =A0 =A02 +- > =A011 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/sbin/gvinum/Makefile b/sbin/gvinum/Makefile > index 8cccf56..465b617 100644 > --- a/sbin/gvinum/Makefile > +++ b/sbin/gvinum/Makefile > @@ -5,7 +5,7 @@ SRCS=3D =A0 gvinum.c gvinum.h geom_vinum_share.c > =A0MAN=3D =A0 gvinum.8 > > =A0WARNS?=3D =A0 =A0 =A0 =A02 > -CFLAGS=3D =A0 =A0 =A0 =A0-I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDI= R}/edit > +CFLAGS+=3D-I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit > > =A0DPADD=3D ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} > =A0LDADD=3D -ledit -ltermcap -ldevstat -lkvm -lgeom > diff --git a/sys/boot/arm/at91/Makefile.inc b/sys/boot/arm/at91/Makefile.= inc > index 2f528e3..db37c7d 100644 > --- a/sys/boot/arm/at91/Makefile.inc > +++ b/sys/boot/arm/at91/Makefile.inc > @@ -8,7 +8,7 @@ __at91_boot_Makefile.inc__: > =A0# tsc, bwct, kb920x, centipad are the supported flavors > =A0BOOT_FLAVOR?=3Dkb920x > > -CFLAGS=3D-Os -mcpu=3Darm9 -ffreestanding \ > +CFLAGS+=3D-Os -mcpu=3Darm9 -ffreestanding \ > =A0 =A0 =A0 =A0-I${.CURDIR}/../libat91 \ > =A0 =A0 =A0 =A0-I${.CURDIR}/../../../.. \ > =A0 =A0 =A0 =A0-I${.CURDIR}/../../../../arm \ > diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile > index 9568c1c..fc231e6 100644 > --- a/sys/boot/i386/boot2/Makefile > +++ b/sys/boot/i386/boot2/Makefile > @@ -22,7 +22,7 @@ BOOT2_UFS?=3D =A0 UFS1_AND_UFS2 > =A0#BOOT2_UFS?=3D =A0 UFS2_ONLY > =A0#BOOT2_UFS?=3D =A0 UFS1_ONLY > > -CFLAGS=3D =A0 =A0 =A0 =A0-Os \ > +CFLAGS+=3D-Os \ > =A0 =A0 =A0 =A0-fno-guess-branch-probability \ > =A0 =A0 =A0 =A0-fomit-frame-pointer \ > =A0 =A0 =A0 =A0-fno-unit-at-a-time \ > diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makef= ile > index 5642220..18c0f35 100644 > --- a/sys/boot/i386/gptboot/Makefile > +++ b/sys/boot/i386/gptboot/Makefile > @@ -19,7 +19,7 @@ GPTBOOT_UFS?=3D UFS1_AND_UFS2 > =A0#GPTBOOT_UFS?=3D UFS2_ONLY > =A0#GPTBOOT_UFS?=3D UFS1_ONLY > > -CFLAGS=3D =A0 =A0 =A0 =A0-DBOOTPROG=3D\"gptboot\" \ > +CFLAGS+=3D-DBOOTPROG=3D\"gptboot\" \ > =A0 =A0 =A0 =A0-Os \ > =A0 =A0 =A0 =A0-fno-guess-branch-probability \ > =A0 =A0 =A0 =A0-fomit-frame-pointer \ > diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot= /Makefile > index f0ee578..6e7d543 100644 > --- a/sys/boot/i386/gptzfsboot/Makefile > +++ b/sys/boot/i386/gptzfsboot/Makefile > @@ -16,7 +16,7 @@ REL1=3D 0x700 > =A0ORG1=3D =A00x7c00 > =A0ORG2=3D =A00x0 > > -CFLAGS=3D =A0 =A0 =A0 =A0-DBOOTPROG=3D\"gptzfsboot\" \ > +CFLAGS+=3D-DBOOTPROG=3D\"gptzfsboot\" \ > =A0 =A0 =A0 =A0-Os \ > =A0 =A0 =A0 =A0-fno-guess-branch-probability \ > =A0 =A0 =A0 =A0-fomit-frame-pointer \ > diff --git a/sys/boot/i386/kgzldr/Makefile b/sys/boot/i386/kgzldr/Makefil= e > index a124474..e8a4157 100644 > --- a/sys/boot/i386/kgzldr/Makefile > +++ b/sys/boot/i386/kgzldr/Makefile > @@ -7,7 +7,7 @@ BINDIR=3D ${LIBDIR} > =A0NO_MAN=3D > > =A0SRCS=3D =A0start.s boot.c inflate.c lib.c crt.s sio.s > -CFLAGS=3D =A0 =A0 =A0 =A0-Os > +CFLAGS+=3D-Os > =A0CFLAGS+=3D-DKZIP > =A0NO_SHARED=3D > =A0LDFLAGS=3D-Wl,-r > diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makef= ile > index 06ff863..aa1bfbe 100644 > --- a/sys/boot/i386/zfsboot/Makefile > +++ b/sys/boot/i386/zfsboot/Makefile > @@ -14,7 +14,7 @@ REL1=3D 0x700 > =A0ORG1=3D =A00x7c00 > =A0ORG2=3D =A00x2000 > > -CFLAGS=3D =A0 =A0 =A0 =A0-DBOOTPROG=3D\"zfsboot\" \ > +CFLAGS+=3D-DBOOTPROG=3D\"zfsboot\" \ > =A0 =A0 =A0 =A0-Os -g \ > =A0 =A0 =A0 =A0-fno-guess-branch-probability \ > =A0 =A0 =A0 =A0-fomit-frame-pointer \ > diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile > index 18bf251..e9f1506 100644 > --- a/sys/boot/pc98/boot2/Makefile > +++ b/sys/boot/pc98/boot2/Makefile > @@ -22,7 +22,7 @@ BOOT2_UFS?=3D =A0 UFS1_AND_UFS2 > =A0#BOOT2_UFS?=3D =A0 UFS2_ONLY > =A0#BOOT2_UFS?=3D =A0 UFS1_ONLY > > -CFLAGS=3D =A0 =A0 =A0 =A0-Os \ > +CFLAGS+=3D-Os \ > =A0 =A0 =A0 =A0-fno-guess-branch-probability \ > =A0 =A0 =A0 =A0-fomit-frame-pointer \ > =A0 =A0 =A0 =A0-fno-unit-at-a-time \ > diff --git a/sys/boot/pc98/kgzldr/Makefile b/sys/boot/pc98/kgzldr/Makefil= e > index 2303fd9..645cc58 100644 > --- a/sys/boot/pc98/kgzldr/Makefile > +++ b/sys/boot/pc98/kgzldr/Makefile > @@ -7,7 +7,7 @@ BINDIR=3D ${LIBDIR} > =A0NO_MAN=3D > > =A0SRCS=3D =A0start.s boot.c inflate.c lib.c crt.s sio.s > -CFLAGS=3D =A0 =A0 =A0 =A0-Os > +CFLAGS+=3D-Os > =A0CFLAGS+=3D-DKZIP > =A0NO_SHARED=3D > =A0LDFLAGS=3D-Wl,-r > diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot= 1.chrp/Makefile > index f3f7e4d..88358b5 100644 > --- a/sys/boot/powerpc/boot1.chrp/Makefile > +++ b/sys/boot/powerpc/boot1.chrp/Makefile > @@ -13,7 +13,7 @@ SRCS=3D =A0 =A0 =A0 =A0 boot1.c ashldi3.c > =A0INTERNALPROG=3D > =A0NO_MAN=3D > > -CFLAGS=3D -ffreestanding -msoft-float -Os \ > +CFLAGS+=3D-ffreestanding -msoft-float -Os \ > =A0 =A0 =A0 =A0-I${.CURDIR}/../../common -I${.CURDIR}/../../../ > =A0LDFLAGS=3D-nostdlib -static -N > > diff --git a/sys/boot/sparc64/boot1/Makefile b/sys/boot/sparc64/boot1/Mak= efile > index dec3e09..29e14f8 100644 > --- a/sys/boot/sparc64/boot1/Makefile > +++ b/sys/boot/sparc64/boot1/Makefile > @@ -8,7 +8,7 @@ SRCS=3D =A0 _start.s boot1.c > > =A0BOOTBLOCKBASE=3D 0x4000 > > -CFLAGS=3D =A0 =A0 =A0 =A0-mcmodel=3Dmedlow -Os -I${.CURDIR}/../../common > +CFLAGS+=3D-mcmodel=3Dmedlow -Os -I${.CURDIR}/../../common > =A0LDFLAGS=3D-Ttext ${BOOTBLOCKBASE} -Wl,-N > > =A0# Construct boot1. sunlabel expects it to contain zeroed-out space for= the > -- > 1.7.5.rc1.23.g0cac8.dirty > >