From patchwork Thu Dec 3 23:09:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 336962 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp696794ilb; Thu, 3 Dec 2020 15:10:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnru0Y60okIJDfVyCKlNc04yd8jDjMcaD7FfxymLDhQLIVtBQv+pgXE8rZVco0rzDgVumS X-Received: by 2002:a17:906:e082:: with SMTP id gh2mr4424743ejb.406.1607037044938; Thu, 03 Dec 2020 15:10:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607037044; cv=none; d=google.com; s=arc-20160816; b=jKLTM2EA53WM6sz7fLKRGvB4ILXG156PJpqSW45S0OvjZVqKo938i+7JBGB5WIh9n8 3OogHT1Z/T+X1YJIfqWqNnYVB7qUwEdAfqkhHzzb2xDvb7I+uDj2btTC3LKnNSfpOypp TF2CRNtviTL2bOTifmsGVNdEfAKHp60QFrvgJmAnwDZxhafhke1/2YcmPh+5aDYYrKQI pG0etozLiwDY4z8S5aXHQ7d7gtl+wao1W62bEb2ch+JkIhrQwTlIXEzPY3KKZeLfzsy+ 5K6GZ8cdJ6D/WNX2QEAnY01O8qBbJNoa2Xr40rZXOF+YbYFmXf+PglFbO1SnTCfeDf0J DpPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=dUPgyNhRazDipmxsWvN+Z/wVJoXn4o+aBxkcBoQBXJ8=; b=WiOhuOpH4xSZwpfG4Yh+c0sR+o8tpxQNi7luN0yFjqrIav++7cJVBwdtCf0bGaEIeZ 6FCy5VVEJlkB9Qi5dcFTVypLq4ZmT5pdquGjQIYF596fqkeDwdrMpPkgttogpq/iwqPT nTGZM4iMli1USh0mi4Qgc0akfUb3FpAEGc2i5EZL9V9MQo77mqFE450OOW4wkK31TMWL 58rbEcRLrSQLx/xY0cQ5pzbp5akwI2zyWs7vFSkOO/9hi/OqjGf7Qd04UQe/3mi5l91v ou2Z/UdhT2XJ7Ni+Z1v/ofsNOmpS2kpSu0L6KRC2QhuoTYPMzDGifulSa1pAmksh+gBW DX9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nx22si272888ejb.503.2020.12.03.15.10.44; Thu, 03 Dec 2020 15:10:44 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbgLCXKo (ORCPT + 14 others); Thu, 3 Dec 2020 18:10:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:34396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgLCXKn (ORCPT ); Thu, 3 Dec 2020 18:10:43 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Andrew Morton , linux-kbuild@vger.kernel.org, Masahiro Yamada , Michal Marek Cc: Arnd Bergmann , stable@vger.kernel.org, Ard Biesheuvel , Kees Cook , Masahiro Yamada , Rikard Falkeborn , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: avoid static_assert for genksyms Date: Fri, 4 Dec 2020 00:09:44 +0100 Message-Id: <20201203230955.1482058-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann 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@vger.kernel.org Suggested-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann --- include/linux/build_bug.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.27.0 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 */