Skip to contentSkip to conversation

2.6.15-rc2-git3 build fails at mtrr/ipi_handler undeclared

DISCUSSION Bob Gill 2 participants 3 messages Nov 24, 2005 Networking

lore
Share & tools
lore

Bob Gill

author
#0 lore raw

Hi. I am trying to build 2.6.15-rc2-git3, but it fails with an error:
make: *** [arch/i386/kernel] Error 2

 CHK     include/linux/version.h
 CHK     include/linux/compile.h
 CHK     usr/initramfs_list
 CC      arch/i386/kernel/cpu/mtrr/main.o

arch/i386/kernel/cpu/mtrr/main.c: In function `set_mtrr':
arch/i386/kernel/cpu/mtrr/main.c:225: error: `ipi_handler' undeclared (first use in this function)
arch/i386/kernel/cpu/mtrr/main.c:225: error: (Each undeclared identifier is reported only once
arch/i386/kernel/cpu/mtrr/main.c:225: error: for each function it appears in.)
make[3]: *** [arch/i386/kernel/cpu/mtrr/main.o] Error 1
make[2]: *** [arch/i386/kernel/cpu/mtrr] Error 2
make[1]: *** [arch/i386/kernel/cpu] Error 2
make: *** [arch/i386/kernel] Error 2
CHK include/linux/version.h
...
(vmlinuz/initial ramdisk image are not built, etc.)
....
but ipi_handler seems to be defined at line 141 in /arch/i386/kernel/cpu/mtrr/main.c. However, my build script does not include SMP (I'm on a single cpu machine), and ipi_handler is wrapped in #ifdef CONFIG_SMP
#endif
(my SMP build options are):
CONFIG_BROKEN_ON_SMP=y
# CONFIG_X86_BIGSMP is not set
# CONFIG_SMP is not set
CONFIG_X86_FIND_SMP_CONFIG=y
....
(The obvious solution is to change my script to CONFIG_SMP=Y, but I suspect there is a more elegant solution).
2.6.15-rc2 builds/runs ok with the same build script.
Please mail me directly as I'm not on the list.
TIA
Bob

#1 lore raw
Quoted 6 lines · Bob Gill

Hi. I am trying to build 2.6.15-rc2-git3, but it fails with an error:
make: *** [arch/i386/kernel] Error 2

CHK     include/linux/version.h
CHK     include/linux/compile.h
CHK     usr/initramfs_list
CC      arch/i386/kernel/cpu/mtrr/main.o
Quoted 11 lines

arch/i386/kernel/cpu/mtrr/main.c: In function `set_mtrr':
arch/i386/kernel/cpu/mtrr/main.c:225: error: `ipi_handler' undeclared (first use in this function)
arch/i386/kernel/cpu/mtrr/main.c:225: error: (Each undeclared identifier is reported only once
arch/i386/kernel/cpu/mtrr/main.c:225: error: for each function it appears in.) make[3]: *** [arch/i386/kernel/cpu/mtrr/main.o] Error 1
make[2]: *** [arch/i386/kernel/cpu/mtrr] Error 2
make[1]: *** [arch/i386/kernel/cpu] Error 2
make: *** [arch/i386/kernel] Error 2
CHK include/linux/version.h

That's one of the things fixed by Andrew's patch below (though Linus fixed it differently in the end).
Or you could just wait for 2.6.15-rc2-git4, should be along soon.

Hugh

include/linux/smp.h renamed from include/linux/smp.h~smp_call_function-must-be-a-macro +1 -7
diff -puN include/linux/smp.h~smp_call_function-must-be-a-macro include/linux/smp.h
@@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void);
  */
 #define raw_smp_processor_id()			0
 #define hard_smp_processor_id()			0
-
-static inline int smp_call_function(void (*func) (void *info), void *info,
-				    int retry, int wait)
-{
-	return 0;
-}
-
+#define smp_call_function(func,info,retry,wait)	({ 0; })
 #define on_each_cpu(func,info,retry,wait)	({ func(info); 0; })
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()			1
net/core/flow.c renamed from net/core/flow.c~smp_call_function-must-be-a-macro +1 -1
diff -puN net/core/flow.c~smp_call_function-must-be-a-macro net/core/flow.c
@@ -292,7 +292,7 @@ void flow_cache_flush(void)
 	init_completion(&info.completion);
 
 	local_bh_disable();
-	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
+	(void)smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
 	flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 
author
#2 lore raw
Quoted 32 lines · Hugh Dickins

That's one of the things fixed by Andrew's patch below (though Linus fixed it differently in the end).
Or you could just wait for 2.6.15-rc2-git4, should be along soon.

Hugh

diff -puN include/linux/smp.h~smp_call_function-must-be-a-macro include/linux/smp.h

include/linux/smp.h renamed from include/linux/smp.h~smp_call_function-must-be-a-macro +1 -7
@@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void);
 */
 #define raw_smp_processor_id()			0
 #define hard_smp_processor_id()			0
-
-static inline int smp_call_function(void (*func) (void *info), void *info,
-				    int retry, int wait)
-{
-	return 0;
-}
-
+#define smp_call_function(func,info,retry,wait)	({ 0; })
 #define on_each_cpu(func,info,retry,wait)	({ func(info); 0; })
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()			1

diff -puN net/core/flow.c~smp_call_function-must-be-a-macro net/core/flow.c

net/core/flow.c void flow_cache_flush(void) · line 298

Quoted 8 lines
net/core/flow.c renamed from net/core/flow.c~smp_call_function-must-be-a-macro +1 -1
@@ -292,7 +292,7 @@ void flow_cache_flush(void)
 	init_completion(&info.completion);
 
 	local_bh_disable();
-	smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
+	(void)smp_call_function(flow_cache_flush_per_cpu, &info, 1, 0);
 	flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 

Done! Thanks for your reply. I built 2.6.15-rc2-git4 and its running it as I type this. Linus' final looks very much like the patch above, except for the void typecast in smp_call_funciton. Thanks again,
Bob