Re: example COPTFLAGS

Dag-Erling Smørgrav <[email protected]> Tue, 09 Jun 2026 13:09:53 +0200
Newsgroups gmane.os.freebsd.questions
Message-ID <[email protected]>
Jan Stary <[email protected]> writes:
> This is wht the exampla make.conf says about COPTFLAGS
> on my freshly installed 15.0-RELEASE:
>
> # To compile just the kernel with special optimizations, you should use
> # this instead of CFLAGS (which is not applicable to kernel builds anyway).
> # There is very little to gain by using higher optimization levels, and doing
> # so can cause problems.
> #
> #COPTFLAGS= -O -pipe
>
> But leaving everything at default apparently uses -O2 -pipe
> for the kernel build? Is the comment out of date then?

The example is outdated.

COPTFLAGS is used for the kernel.  Everything else, including kernel
modules, uses CFLAGS.

DES
-- 
Dag-Erling Smørgrav - [email protected]