[PATCH] Fix CFLAGS overwrite by Makefile

Dimitry Andric dim at FreeBSD.org
Tue May 24 20:41:02 UTC 2011


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.


More information about the freebsd-current mailing list