From patchwork Fri Dec 11 21:36:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11969495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB9D0C433FE for ; Fri, 11 Dec 2020 21:36:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51C39233A2 for ; Fri, 11 Dec 2020 21:36:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51C39233A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DC1B96B006E; Fri, 11 Dec 2020 16:36:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D70BE6B0070; Fri, 11 Dec 2020 16:36:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C5F466B0072; Fri, 11 Dec 2020 16:36:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id B11566B006E for ; Fri, 11 Dec 2020 16:36:41 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7894C824999B for ; Fri, 11 Dec 2020 21:36:41 +0000 (UTC) X-FDA: 77582311002.16.girls54_5117eea27404 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 5683A100E6903 for ; Fri, 11 Dec 2020 21:36:41 +0000 (UTC) X-HE-Tag: girls54_5117eea27404 X-Filterd-Recvd-Size: 2843 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Dec 2020 21:36:40 +0000 (UTC) Date: Fri, 11 Dec 2020 13:36:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1607722599; bh=Vql5KOdLOKsBXzP2w5ZiC+qjVWkaxgNf8DRqZZ8o81Q=; h=From:To:Subject:In-Reply-To:From; b=CJ66+UyGOg3XzYy/gi1PKYit4+7U8A9Ty8YTE88QtD19cNGEJQAZ6tBj7lG0yqbKx BO05d7uToJukoTHenflTliJi242O+cNJ6DqdqByntwtUwN6Zy/GyAyG0Mc3gGw4QY5 U2tDS9xpDFc4ec17q8hclOP785sl89Q4cYhWv47s= From: Andrew Morton To: akpm@linux-foundation.org, ardb@kernel.org, arnd@arndb.de, elver@google.com, keescook@chromium.org, linux-mm@kvack.org, masahiroy@kernel.org, michal.lkml@markovi.net, mm-commits@vger.kernel.org, rikard.falkeborn@gmail.com, stable@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 4/8] kbuild: avoid static_assert for genksyms Message-ID: <20201211213638.89W7IFB2b%akpm@linux-foundation.org> In-Reply-To: <20201211133555.88407977f082963499ed343c@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann Subject: kbuild: avoid static_assert for genksyms 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 Suggested-by: Ard Biesheuvel Cc: Masahiro Yamada Cc: Michal Marek Cc: Kees Cook Cc: Rikard Falkeborn Cc: Marco Elver Cc: Signed-off-by: Andrew Morton --- include/linux/build_bug.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/include/linux/build_bug.h~kbuild-avoid-static_assert-for-genksyms +++ a/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 */