[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201203230955.1482058-1-arnd@kernel.org>
Date: Fri, 4 Dec 2020 00:09:44 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-kbuild@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>
Cc: Arnd Bergmann <arnd@...db.de>, stable@...r.kernel.org,
Ard Biesheuvel <ardb@...nel.org>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Rikard Falkeborn <rikard.falkeborn@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] kbuild: avoid static_assert for genksyms
From: Arnd Bergmann <arnd@...db.de>
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.
Cc: stable@...r.kernel.org
Suggested-by: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
include/linux/build_bug.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
index e3a0be2c90ad..7bb66e15b481 100644
--- a/include/linux/build_bug.h
+++ b/include/linux/build_bug.h
@@ -77,4 +77,9 @@
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
+#ifdef __GENKSYMS__
+/* genksyms gets confused by _Static_assert */
+#define _Static_assert(expr, ...)
+#endif
+
#endif /* _LINUX_BUILD_BUG_H */
--
2.27.0
Powered by blists - more mailing lists