From patchwork Mon Dec 14 17:28:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 343574 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3285843jai; Mon, 14 Dec 2020 11:33:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVCuscQTOlA2653VlU0khjZjm1cK5nMOPe7pgj1qE9LSNi6etnfwuw0v51ETs3eBQ0bX5g X-Received: by 2002:a50:955b:: with SMTP id v27mr25940213eda.324.1607974393539; Mon, 14 Dec 2020 11:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607974393; cv=none; d=google.com; s=arc-20160816; b=R0XR9na04uQBMGib2ekGO/A/3+AU+YYGsgPlwL0Q4bCSZ5KTUOJpbwwWzJR6QxY7xZ XPGX9qSR3KT8olPlKLB0qz93Ks+/e8QQgugR1493lNiKFM8ity7UQcOAflAmMIoWrX3h qQ1dJk3AYDnm7oKYstrbnU4PkbwqbLGv74ImYm0oRMyA0yyADw8A0Vn2FzfbQHab/Mg2 W/4VEHKW/mSzVT89AW8U+1C3//uXWUmun5goFCMLZD/V+/Yi+NAwa11r4TOXjeS6iDyE EzHHJEJM+MA48kADOqY2jhz9VLPsRjAzkSSr+Hu7fieEBQ7SlPBWpkp12E4rFUbwtebk Rvyw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=cHxV9hKGnG+LtvJ3rpAlkKnxslJffSMWcIRg/xuwYaY=; b=UazwLYvjbZDfsCYnVZfkQxjD1azYWWJ11dTDSfXz9J9G/uWxQMYUX08VSN8MntHiZR 2Fgn/b2919RN4EXzH7cyhyCY9/xRUWupe/kIr5TD3+n2dFqahEAIlqcNgpw4BwSTLvIA FTQPBx8XAHIUAhsB3rBmu6IUjWDPIkkFZDW3qKfXQCbSlAbESOze+m5zirV5aOAHwwHq jfV7iNbb5i8jSB9Fjc+gFwC4h28GmRcLjINlkeJXwMhq9+FAHLuIIeuRo2rwJl10M3zj hOks+wRdjR9ARmqeRKfZT1BpBQt8jUsldBpD2I9Uw+Kgw0vQYKz9Z5FmYs1opPq8rl6X uh8g== 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si11123615eds.576.2020.12.14.11.33.13; Mon, 14 Dec 2020 11:33:13 -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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502197AbgLNRfx (ORCPT + 14 others); Mon, 14 Dec 2020 12:35:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:45998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502079AbgLNRfv (ORCPT ); Mon, 14 Dec 2020 12:35:51 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Ard Biesheuvel , Masahiro Yamada , Michal Marek , Kees Cook , Rikard Falkeborn , Marco Elver , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 29/36] kbuild: avoid static_assert for genksyms Date: Mon, 14 Dec 2020 18:28:13 +0100 Message-Id: <20201214172544.733028722@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214172543.302523401@linuxfoundation.org> References: <20201214172543.302523401@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann 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 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 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/build_bug.h | 5 +++++ 1 file changed, 5 insertions(+) --- 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 */