From owner-freebsd-current@FreeBSD.ORG Tue May 24 20:41:02 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCEB31065673 for ; Tue, 24 May 2011 20:41:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A05218FC1A for ; Tue, 24 May 2011 20:41:02 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:65b2:fb03:eecb:f6cc] (unknown [IPv6:2001:7b8:3a7:0:65b2:fb03:eecb:f6cc]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 821D65C37; Tue, 24 May 2011 22:41:01 +0200 (CEST) Message-ID: <4DDC17E5.2020700@FreeBSD.org> Date: Tue, 24 May 2011 22:41:09 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110519 Lanikai/3.1.11pre MIME-Version: 1.0 To: Arnaud Lacombe References: <1306267772-31084-1-git-send-email-lacombar@gmail.com> In-Reply-To: <1306267772-31084-1-git-send-email-lacombar@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: current@freebsd.org 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: Tue, 24 May 2011 20:41:02 -0000 On 2011-05-24 22:09, 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 before the > Makefile is interpreted, CFLAGS might already have been set with CPU specific > settings by, which is source from sys.mk. ... > --- a/sys/boot/i386/boot2/Makefile > +++ b/sys/boot/i386/boot2/Makefile ... The problem with this patch is that for some of the things you fixed, stuff like boot-time programs, you NEVER want any CPU specific settings! You must use the default, lowest common denominator setting instead, or there is no guarantee the boot program will be correct. So that is why these Makefiles purposefully overwrite CFLAGS, it is not by accident. Besides, for space-constrained things like boot2, you might not even be able to compile it when using non-standard settings, since the code might grow too large.