Subject: kern/18533: syssrc/arch/i386/i386/pmc.c won't compile
To: None <gnats-bugs@gnats.netbsd.org>
From: None <xavier@xavhome.fr.eu.org>
List: netbsd-bugs
Date: 10/04/2002 23:46:47
>Number:         18533
>Category:       kern
>Synopsis:       Can't build kernel with 20021003 CVS
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 04 14:47:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Xavier HUMBERT
>Release:        NetBSD 1.6H
>Organization:
>Environment:
System: NetBSD arnor.xavhome.fr.eu.org 1.6H NetBSD 1.6H (XAVIER) #27: Mon Sep 9 19:08:59 CEST 2002 root@arnor.xavhome.fr.eu.org:/usr/src/sys/arch/i386/compile/XAVIER i386
Architecture: i386
Machine: i386
>Description:
	While trying to build 1.6I kernel, with 20021003 source, it fails on
arch/i386/i386/pmc.c whith message :
----------------------------------------------------------------------------
/usr/tools/bin/i386--netbsdelf-gcc  -pipe -ffreestanding  -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized  -Di386 -I.  -I../../../../arch -I../../../.. -nostdinc -DIPSEC_DEBUG -DFRENCH_KBD -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c /usr/src/sys/arch/i386/compile/XAVIER/../../../../arch/i386/i386/pmc.c
/usr/src/sys/arch/i386/compile/XAVIER/../../../../arch/i386/i386/pmc.c: In function `pmc_init':
/usr/src/sys/arch/i386/compile/XAVIER/../../../../arch/i386/i386/pmc.c:77: `cpu_vendor' undeclared (first use in this function)
/usr/src/sys/arch/i386/compile/XAVIER/../../../../arch/i386/i386/pmc.c:77: (Each undeclared identifier is reported only once
/usr/src/sys/arch/i386/compile/XAVIER/../../../../arch/i386/i386/pmc.c:77: for each function it appears in.)
*** Error code 1
-----------------------------------------------------------------------------
The code source involved is :

/* $NetBSD: pmc.c,v 1.4 2002/06/07 04:04:47 gmcgarry Exp $  */
[...]
static void
pmc_init(void)
{
[...]
   switch (cpu_class) {
      case CPUCLASS_586:
--->   if (strcmp(cpu_vendor, "GenuineIntel") == 0) {
[...]
-----------------------------------------------------------------------------

The char * cpu_vendor variable is not declared in the file, neither static,
nor extern.

Grepping at the headers, i noticed :

[root@arnor root]# cd /sys/arch/     
[root@arnor arch]# find . -name "*.h" | xargs grep cpu_vendor                          
./i386/include/cpu.h:   int cpu_vendor;
./i386/include/cpu.h:   const char *cpu_vendorname;
./i386/include/cpu.h:   int cpu_vendor;
./i386/include/cpu.h:   const char *cpu_vendorname;
./x86_64/include/cpu.h:extern char cpu_vendor[];

Which seems curious.


>How-To-Repeat:
	cd /usr/src/sys/arch/i386/compile/XAVIER && make depend && make
>Fix:
	I am actually trying to compile without "options PERFCTRS" and it 
seems to compile, as I write this (poor old P200 is not fast enough for
immediate result :-)
(After compile) Yes, it does fix

Best regards,

-- 
Xav
http://www.freetibet.org
http://www.tibet.fr/

>Release-Note:
>Audit-Trail:
>Unformatted: