Re: [PATCH] Fix CFLAGS overwrite by Makefile

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 24 May 2011 22:41:09 +0200
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<bsd.cpu.mk>, 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.
Received on Tue May 24 2011 - 18:41:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:14 UTC