Subject: kern/19806: "-O2" always appended to $COPTS when compiling a kernel
To: None <gnats-bugs@gnats.netbsd.org>
From: Toru TAKAMIZU <ttaka@earth.email.ne.jp>
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
>Closed-Date:
>Last-Modified:
>Originator:     Toru TAKAMIZU
>Release:        NetBSD 1.6_STABLE
>Organization:
>Environment:
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
>Description:

sys/conf/Makefile.kern.inc (rev. 1.13.4.8) has a line:

	COPTS+=		${DEFCOPTS}

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.

>How-To-Repeat:

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

>Fix:

Revert to 1.13.4.7.

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.
>Release-Note:
>Audit-Trail:
>Unformatted: