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 | 48c2fd70699d0d9a5294b5b8eca21c9e1a4a9958 (patch) | |
tree | f974f32b905f95b346829be37927a0e2252ce29c /src/compat/compat.h | |
parent | chacha20,poly1305: simplify perlasm fanciness (diff) | |
download | wireguard-monolithic-historical-48c2fd70699d0d9a5294b5b8eca21c9e1a4a9958.tar.xz wireguard-monolithic-historical-48c2fd70699d0d9a5294b5b8eca21c9e1a4a9958.zip |
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>
Diffstat (limited to 'src/compat/compat.h')
-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) |