Subject: pkg/24811: cpuflags vs pkgsrc GCC_REQD=3.3 on 1.6.2
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <dan@geek.com.au>
List: netbsd-bugs
Date: 03/17/2004 15:06:02
>Number:         24811
>Category:       pkg
>Synopsis:       cpuflags.mk calls wrong gcc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 17 04:07:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Carosone
>Release:        NetBSD 1.6.2
>Organization:
dis-
>Environment:
pkgsrc on 1.6.2 (or anything else with older gcc, or a different compiler in PKGSRC_COMPILER probably)
>Description:

At the top of my global mk.conf, I have:
.sinclude "/usr/pkg/share/mk/cpuflags.mk"

The other day, I wanted to build some packages on a pentium4 running
1.6.2, and I wanted them to run fast.  I set GCC_REQD?=3.3 in that
machine's local mk.conf, and kicked off pkg_chk

The compiler framework built and installed gcc3.3.3 as a dependency
before the other packages, as expected, and I can only presume that
the package compilers were using it via buildlink.

However, cpuflags.mk was still seeing the system 2.95 compiler, and
setting flags to -march=pentiumpro which then was passed to gcc3 once
the buildlink environment was set up.

mrg wanted me to note, also, that cpuflags could be calling gcc
-dumpversion rather than messing with ${CC} -v | awk in the way it
does now.

>How-To-Repeat:
as above
>Fix:
Probably the compiler/buildlink framework needs to learn about
cpuflags, and look for a switch variable from mk.conf to run it at the
right time against the right compiler.
>Release-Note:
>Audit-Trail:
>Unformatted: