Skip to contentSkip to conversation

2.6.0-test8-microcode

DISCUSSION Thomas Giese 3 participants 3 messages Oct 18, 2003

lore
Share & tools
lore
#0 lore raw

hi,

IA32 microcode fails in compile, in test7 it does not :

linux:/mnt/hdb1/linux-2.6.0-test8 # make
SPLIT include/linux/autoconf.h -> include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CHK include/linux/compile.h
CC [M] arch/i386/kernel/microcode.o
arch/i386/kernel/microcode.c: In function `find_matching_ucodes':
arch/i386/kernel/microcode.c:328: parse error before int' arch/i386/kernel/microcode.c:329: ext_tablep' undeclared (first use in this fun
ction)
arch/i386/kernel/microcode.c:329: (Each undeclared identifier is reported only o
nce
arch/i386/kernel/microcode.c:329: for each function it appears in.) make[1]: *** [arch/i386/kernel/microcode.o] Error 1
make: *** [arch/i386/kernel] Error 2

#1 lore raw

Hi Thomas,

Yes, thank you, it was noticed by several people already. Just apply this patch and it will compile. The version of gcc that I am using didn't have a problem with that:

$ gcc --version
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

Kind regards
Tigran

Quoted 1 line

From [email protected] Sat Oct 18 16:20:08 2003

Date: 17 Oct 2003 16:43:29 -0700
From: Roland Dreier <[email protected]>
To: Linus Torvalds <[email protected]>
Cc: Kernel Mailing List <[email protected]>
Subject: Re: Linux 2.6.0-test8

Here's a fix for compiling with gcc 2.95 (a variable declaration got mixed in with code):

arch/i386/kernel/microcode.c renamed from arch/i386/kernel/microcode.c.orig +2 -1
@@ -324,8 +324,9 @@
 					/* check extended table checksum */
 					if (ext_table_size) {
 						int ext_table_sum = 0;
+						int * ext_tablep;
 						i = ext_table_size / DWSIZE;
-						int * ext_tablep = (((void *) newmc) + MC_HEADER_SIZE + data_size);
+						ext_tablep = (((void *) newmc) + MC_HEADER_SIZE + data_size);
 						while (i--) ext_table_sum += ext_tablep[i];
 						if (ext_table_sum) {
 							printk(KERN_WARNING "microcode: aborting, bad extended signature table checksum\n");
#2 lore raw
In reply to Thomas Giese
Quoted 9 lines · Thomas Giese

IA32 microcode fails in compile, in test7 it does not :
linux:/mnt/hdb1/linux-2.6.0-test8 # make
SPLIT include/linux/autoconf.h -> include/config/*
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CHK include/linux/compile.h
CC [M] arch/i386/kernel/microcode.o
arch/i386/kernel/microcode.c: In function `find_matching_ucodes':
arch/i386/kernel/microcode.c:328: parse error before int' arch/i386/kernel/microcode.c:329: ext_tablep' undeclared (first use in this

Quoted 8 lines

fun
ction)
arch/i386/kernel/microcode.c:329: (Each undeclared identifier is reported only o
nce
arch/i386/kernel/microcode.c:329: for each function it appears in.) make[1]: *** [arch/i386/kernel/microcode.o] Error 1
make: *** [arch/i386/kernel] Error 2

Hmm, you're supposed to declare variables before any code appears in C. Maybe all this C99 stuff is turning it into C++.

-- wli

arch/i386/kernel/microcode.c +2 -1
diff -prauN linux-2.6.0-test8/arch/i386/kernel/microcode.c microcode-2.6.0-test8-1/arch/i386/kernel/microcode.c
@@ -323,9 +323,10 @@ static int find_matching_ucodes (void) 
 					memcpy(newmc, &mc_header, MC_HEADER_SIZE);
 					/* check extended table checksum */
 					if (ext_table_size) {
+						int *ext_tablep;
 						int ext_table_sum = 0;
 						i = ext_table_size / DWSIZE;
-						int * ext_tablep = (((void *) newmc) + MC_HEADER_SIZE + data_size);
+						ext_tablep = (((void *) newmc) + MC_HEADER_SIZE + data_size);
 						while (i--) ext_table_sum += ext_tablep[i];
 						if (ext_table_sum) {
 							printk(KERN_WARNING "microcode: aborting, bad extended signature table checksum\n");