fork: Remove the weak insanity
authorThomas Gleixner <tglx@linutronix.de>
Sat, 5 May 2012 15:05:40 +0000 (15:05 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 8 May 2012 11:55:20 +0000 (13:55 +0200)
We error out when compiling with gcc4.1.[01] as it miscompiles
__weak. The workaround with magic defines is not longer
necessary. Make it __weak again.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20120505150141.306358267@linutronix.de
arch/sh/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
kernel/fork.c

index 20ee40af16e9b5fae4b6bf7e4f29ba27c6fe698c..09963d4018cb9cb6ff93627538f841a9eeffce74 100644 (file)
@@ -98,7 +98,6 @@ static inline struct thread_info *current_thread_info(void)
 extern struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node);
 extern void free_thread_info(struct thread_info *ti);
 extern void arch_task_cache_init(void);
-#define arch_task_cache_init arch_task_cache_init
 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
 extern void init_thread_xstate(void);
 
index ad6df8ccd715881910f4bb80bc23173c8d754630..8692a166dd4e62652ca26254039b0845b5f39c60 100644 (file)
@@ -284,6 +284,5 @@ static inline bool is_ia32_task(void)
 extern void arch_task_cache_init(void);
 extern void free_thread_info(struct thread_info *ti);
 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
-#define arch_task_cache_init arch_task_cache_init
 #endif
 #endif /* _ASM_X86_THREAD_INFO_H */
index b9372a0bff18c2a042cb4ef7f6d6ea7b25a3583c..a79b36e2e912089a4d2bf2dd7393667cbcfd2f16 100644 (file)
@@ -203,13 +203,7 @@ void __put_task_struct(struct task_struct *tsk)
 }
 EXPORT_SYMBOL_GPL(__put_task_struct);
 
-/*
- * macro override instead of weak attribute alias, to workaround
- * gcc 4.1.0 and 4.1.1 bugs with weak attribute and empty functions.
- */
-#ifndef arch_task_cache_init
-#define arch_task_cache_init()
-#endif
+void __init __weak arch_task_cache_init(void) { }
 
 void __init fork_init(unsigned long mempages)
 {