summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-12-11 13:36:38 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:25:39 +0100
commitfd2583d25c2346061f99881f44af86d027b98195 (patch)
tree830da9bc591b3d4d378ccaff38723aef4fa9f2eb /include
parent95190daaf93dc77a30d3d3b3f91d3cf26a37741c (diff)
downloadlinux-stable-fd2583d25c2346061f99881f44af86d027b98195.tar.gz
linux-stable-fd2583d25c2346061f99881f44af86d027b98195.tar.bz2
linux-stable-fd2583d25c2346061f99881f44af86d027b98195.zip
kbuild: avoid static_assert for genksyms
commit 14dc3983b5dff513a90bd5a8cc90acaf7867c3d0 upstream. genksyms does not know or care about the _Static_assert() built-in, and sometimes falls back to ignoring the later symbols, which causes undefined behavior such as WARNING: modpost: EXPORT symbol "ethtool_set_ethtool_phy_ops" [vmlinux] version generation failed, symbol will not be versioned. ld: net/ethtool/common.o: relocation R_AARCH64_ABS32 against `__crc_ethtool_set_ethtool_phy_ops' can not be used when making a shared object net/ethtool/common.o:(_ftrace_annotated_branch+0x0): dangerous relocation: unsupported relocation Redefine static_assert for genksyms to avoid that. Link: https://lkml.kernel.org/r/20201203230955.1482058-1-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Ard Biesheuvel <ardb@kernel.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Michal Marek <michal.lkml@markovi.net> Cc: Kees Cook <keescook@chromium.org> Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com> Cc: Marco Elver <elver@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/build_bug.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
index 43d1fd50d433..6099f754aad7 100644
--- a/include/linux/build_bug.h
+++ b/include/linux/build_bug.h
@@ -80,4 +80,9 @@
#endif /* __CHECKER__ */
+#ifdef __GENKSYMS__
+/* genksyms gets confused by _Static_assert */
+#define _Static_assert(expr, ...)
+#endif
+
#endif /* _LINUX_BUILD_BUG_H */