Skip to content

Commit

Permalink
fork: Remove the weak insanity
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
  • Loading branch information
KAGA-KOKO committed May 8, 2012
1 parent 0a6ba09 commit 6c0a9fa
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion arch/sh/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
8 changes: 1 addition & 7 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 6c0a9fa

Please sign in to comment.