Subject: kern/19806: "-O2" always appended to $COPTS when compiling a kernel
To: None <>
From: Toru TAKAMIZU <>
List: netbsd-bugs
Date: 01/12/2003 18:57:57
>Number:         19806
>Category:       kern
>Synopsis:       "-O2" always appended to ${COPTS}
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 12 01:59:00 PST 2003
>Originator:     Toru TAKAMIZU
>Release:        NetBSD 1.6_STABLE
System: NetBSD localhost 1.6_STABLE NetBSD 1.6_STABLE (MIWA) #21: Mon Jan 6 17:47:05 JST 2003 toru@localhost:/usr/src/sys/arch/i386/compile/MIWA i386
Architecture: i386
Machine: i386

sys/conf/ (rev. has a line:


that unconditionally appends "-O2" to ${COPTS}. Because of this,
even if you set "-O0" as your ${COPTS}, it is replaced with the one
with "-O2".

According to CVS log, this change is for avoiding sparc problem.


Go into sys/arch/YOURARCH/compile/KERNNAME and "make" specifing your
own COPTS, for example "-O0", and you'll see "-O2" on the screen.


Revert to

As for sparc problem addressed in CVS log, it can (or should?) be
treated in MD way, for instance, in sys/arch/sparc/conf/Makefile.sparc.