From 48c2fd70699d0d9a5294b5b8eca21c9e1a4a9958 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sat, 24 Nov 2018 23:44:00 -0700 Subject: compat: don't undef BUILD_BUG_ON for Clang >=8 This has been fixed upstream. To keep this hack working for toolchains that don't have it, use CONFIG_CLANG_VERSION, which was added in commit 469cb7376c06 ("kconfig: add CC_IS_CLANG and CLANG_VERSION"), introduced in 4.18. I have added the '!defined(CONFIG_CLANG_VERSION)' to keep the hack around for Android. Most custom kernel developers are using AOSP's Clang, which currently does not have the fix and might not for a while (although it is probably on Google's mind given that it has been an issue for ChromeOS on 4.19: https://crbug.com/897215). I have verified this change against my Pixel 2 kernel and 4.20-rc3 with the latest ToT Clang. Link: https://github.com/ClangBuiltLinux/linux/issues/7 Signed-off-by: Nathan Chancellor --- src/compat/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/compat/compat.h b/src/compat/compat.h index c4b20ae..e52f53b 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -749,7 +749,7 @@ static inline void crypto_xor_cpy(u8 *dst, const u8 *src1, const u8 *src2, #endif /* https://github.com/ClangBuiltLinux/linux/issues/7 */ -#ifdef __clang__ +#if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000) #include #undef BUILD_BUG_ON #define BUILD_BUG_ON(x) -- cgit v1.2.3-59-g8ed1b