diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2018-11-24 23:44:00 -0700 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-07 06:07:35 +0100 |
commit | 5e28bca364c6e8cc44f994c8e3aad8c639b092e1 (patch) | |
tree | 216f253c585abd4df0cc541a16e667df1e0bc49c /src | |
parent | 0616ed746d2e35994f9c7f7c2da9b15d1bb4d51d (diff) |
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 <natechancellor@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/compat/compat.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 <linux/bug.h> #undef BUILD_BUG_ON #define BUILD_BUG_ON(x) |