amd64: -O2 even with DEBUG

Warner Losh imp at bsdimp.com
Fri Jul 26 07:51:28 UTC 2013


On Jul 26, 2013, at 12:14 AM, Andriy Gapon wrote:
> I wonder why amd64 is distinguished to have -O2 in COPTFLAGS even when DEBUG is
> defined.  For all other archs it's -O for that case.
> 
> Perhaps, this was discussed / explained in the past, but I would appreciate it
> being said again (or even written as a comment in kern.pre.mk).

I think you may have it wrong. Everybody gets -O2, except arm and mips which get -O for dodgy historical reasons...  At least for userland...  But I don't think that's what you are talking about.

For the kernel, we get everybody having -O2, except powerpc (and except DEBUG).

Looking at the code for the latter, it sure looks to me to be a mistake. We should be setting _MINUS_O ala the powerpc case. And the -frename-registers looks misplaced to me as well...

Warner



More information about the freebsd-arch mailing list