[Cbe-oss-dev] [HACK 1:10] Workaround gcc (4.1.1) problem with __weak 'empty' functions

Luke Browning lukebr at linux.vnet.ibm.com
Fri May 23 06:08:57 EST 2008


Workaround gcc (4.1.1) problem with __weak 'empty' functions

The compiler is optimizing weak functions that are empty.  This 
patch prevents the function from being optimized by the compiler
as it is not longer empty.   

This enabled me to boot the 2.6.26-rc3 kernel on a cell machine.

Note this is not a proper solution and is just being provided
to workaround a boot problem.  You may or may not have this problem
depending on the level of the compiler that you use.

Don't submit upstream.

Index: linux-2.6.25/init/main.c
===================================================================
--- linux-2.6.25.orig/init/main.c
+++ linux-2.6.25/init/main.c
@@ -529,6 +529,8 @@ void __init __weak smp_setup_processor_i
 
 void __init __weak thread_info_cache_init(void)
 {
+	/* Should be replaced by linker for PPC */
+	BUG_ON(1);
 }
 
 asmlinkage void __init start_kernel(void)





More information about the cbe-oss-dev mailing list