x86: fix build failure
PATCH 1/1 x86: fix build failure
With KMEMCHECK=y, KASAN=n:
arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration] arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration] arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
Don't #undef memcpy if KASAN=n.
--- arch/x86/include/asm/efi.h | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/include/asm/efi.h +2 -0
@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);extern void __iomem *__init efi_ioremap (unsigned long addr,unsigned long size,u32 type,u64 attribute); +#ifdef CONFIG_KASAN /* * CONFIG_KASAN may redefine memset to __memset. __memset function is present * only in kernel binary. Since the EFI stub linked into a separate binary it
@@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,#undef memcpy#undef memset#undef memmove +#endif #endif /* CONFIG_X86_32 */
Signature · 1 line
2.4.6
Quoted 8 lines · Andrey Ryabinin
With KMEMCHECK=y, KASAN=n:
arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]Don't #undef memcpy if KASAN=n.
Good catch.
This broke my llvmlinux-patches Linux v4.3-rcN.
The subject-line is not very meaningful - to me at least ?
- Sedat -
Quoted 31 lines
Reported-by Ingo Molnar <[email protected]>Reported-by Sedat Dilek <[email protected]>Fixes 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")Signed-off-by Andrey Ryabinin <[email protected]>--- arch/x86/include/asm/efi.h | 2 ++ 1 file changed, 2 insertions(+)arch/x86/include/asm/efi.h +2
-1@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);extern void __iomem *__init efi_ioremap (unsigned long addr,unsigned long size,u32 type,u64 attribute); +#ifdef CONFIG_KASAN /* * CONFIG_KASAN may redefine memset to __memset. __memset function is present * only in kernel binary. Since the EFI stub linked into a separate binary it @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,#undef memcpy#undef memset#undef memmove +#endif #endif /* CONFIG_X86_32 */ --2.4.6
Quoted 7 lines · Sedat Dilek
Quoted 6 lines · Andrey Ryabinin
With KMEMCHECK=y, KASAN=n:
arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
Quoted 8 lines
Quoted 2 lines
Don't #undef memcpy if KASAN=n.
Good catch.
This broke my llvmlinux-patches Linux v4.3-rcN.The subject-line is not very meaningful - to me at least ?
What about...?
"x86, efi, kasan: Fix error implicit declaration of memcpy"
"x86, efi, kasan: Add missing CONFIG_KASAN check for #undef memset/memcpy/memmove"
- Sedat -
Quoted 33 lines
- Sedat -
Quoted 31 lines
Reported-by Ingo Molnar <[email protected]>Reported-by Sedat Dilek <[email protected]>Fixes 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")Signed-off-by Andrey Ryabinin <[email protected]>--- arch/x86/include/asm/efi.h | 2 ++ 1 file changed, 2 insertions(+)arch/x86/include/asm/efi.h +2
-1@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);extern void __iomem *__init efi_ioremap (unsigned long addr,unsigned long size,u32 type,u64 attribute); +#ifdef CONFIG_KASAN /* * CONFIG_KASAN may redefine memset to __memset. __memset function is present * only in kernel binary. Since the EFI stub linked into a separate binary it @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,#undef memcpy#undef memset#undef memmove +#endif #endif /* CONFIG_X86_32 */ --2.4.6
Sedat Dilek
Tested-byQuoted 17 lines · Sedat Dilek
Quoted 7 lines · Sedat Dilek
Quoted 6 lines · Andrey Ryabinin
With KMEMCHECK=y, KASAN=n:
arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]Quoted 8 lines
Quoted 2 lines
Don't #undef memcpy if KASAN=n.
Good catch.
This broke my llvmlinux-patches Linux v4.3-rcN.The subject-line is not very meaningful - to me at least ?
Quoted 7 lines
What about...?
"x86, efi, kasan: Fix error implicit declaration of memcpy"
"x86, efi, kasan: Add missing
CONFIG_KASANcheck for #undef memset/memcpy/memmove"
I tested this with latest llvmlinux kernel and it looks good...
$ grep 'kernel/setup.o' build-log_4.3.0-rc3-10-llvmlinux-amd64.txt CC arch/x86/kernel/setup.o
Feel free to add my...
...when you do a v2.
Thanks.
- Sedat -
Quoted 35 lines
- Sedat -
Quoted 33 lines
- Sedat -
Quoted 31 lines
Reported-by Ingo Molnar <[email protected]>Reported-by Sedat Dilek <[email protected]>Fixes 769a8089c1fd ("x86, efi, kasan: #undef memset/memcpy/memmove per arch")Signed-off-by Andrey Ryabinin <[email protected]>--- arch/x86/include/asm/efi.h | 2 ++ 1 file changed, 2 insertions(+)arch/x86/include/asm/efi.h +2
-1@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);extern void __iomem *__init efi_ioremap (unsigned long addr,unsigned long size,u32 type,u64 attribute); +#ifdef CONFIG_KASAN /* * CONFIG_KASAN may redefine memset to __memset. __memset function is present * only in kernel binary. Since the EFI stub linked into a separate binary it @@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,#undef memcpy#undef memset#undef memmove +#endif #endif /* CONFIG_X86_32 */ --2.4.6
tip-bot for Andrey Ryabinin
merge bot[tip:x86/urgent] x86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels
In reply to Andrey Ryabininx86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels
Commit-ID: 4ac86a6dcec1c3878de9747bf5a2aa4455be69e3 Gitweb: http://git.kernel.org/tip/4ac86a6dcec1c3878de9747bf5a2aa4455be69e3 Author: Andrey Ryabinin <[email protected]> AuthorDate: Tue, 29 Sep 2015 19:40:14 +0300 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 30 Sep 2015 09:29:53 +0200
x86, efi, kasan: Fix build failure on !KASAN && KMEMCHECK=y kernels
With KMEMCHECK=y, KASAN=n we get this build failure:
arch/x86/platform/efi/efi.c:673:3: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
arch/x86/platform/efi/efi_64.c:139:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
arch/x86/include/asm/desc.h:121:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
Don't #undef memcpy if KASAN=n.
--- arch/x86/include/asm/efi.h | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/include/asm/efi.h +2 -0
@@ -86,6 +86,7 @@ extern u64 asmlinkage efi_call(void *fp, ...);extern void __iomem *__init efi_ioremap (unsigned long addr,unsigned long size,u32 type,u64 attribute); +#ifdef CONFIG_KASAN /* * CONFIG_KASAN may redefine memset to __memset. __memset function is present * only in kernel binary. Since the EFI stub linked into a separate binary it
@@ -95,6 +96,7 @@ extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,#undef memcpy#undef memset#undef memmove +#endif #endif /* CONFIG_X86_32 */