__current_thread_info is currently defined in the header file, but when we link the kernel with LTO it shows up in all files which include this header file and causes conflicts with itself. Move the definition into the only function which uses it to prevent these problems. This fixes the build with LTO. Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx> --- arch/mips/include/asm/thread_info.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 4993db40482c..9348776e16a3 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h @@ -49,11 +49,11 @@ struct thread_info { .addr_limit = KERNEL_DS, \ } -/* How to get the thread information struct from C. */ -register struct thread_info *__current_thread_info __asm__("$28"); - static inline struct thread_info *current_thread_info(void) { + /* How to get the thread information struct from C. */ + register struct thread_info *__current_thread_info __asm__("$28"); + return __current_thread_info; } -- 2.11.0