From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 21977C56202 for ; Fri, 13 Nov 2020 19:56:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C79D62076B for ; Fri, 13 Nov 2020 19:56:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rz7bo515" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgKMT4N (ORCPT ); Fri, 13 Nov 2020 14:56:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbgKMT4K (ORCPT ); Fri, 13 Nov 2020 14:56:10 -0500 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07B3AC0613D1; Fri, 13 Nov 2020 11:56:10 -0800 (PST) Received: by mail-qk1-x742.google.com with SMTP id k4so18207qko.13; Fri, 13 Nov 2020 11:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=Rz7bo5155yveyQ9ZrU3UXRmgFVAlpmKkI/wTgDabwLcf/AW274xZWtGwKaoFUHCuWV AlUe5BkWT/spMfkjOhGCLbH/P6zUhfVdE0Ya0L1jSSCP5uofyayDsp4lUMXVQtrOM4iq ymSNPlt7IqY/MlDkIJMQo1VjmPcK94pRwWf4QkNu+vVjHunZEg9cnxjY4plQCq/MKl+H cCHXsuMrxAVYpHLpMIehHAJKLLkv6OrYRA/SZyIZR3JxxDw5jpL2lTKg1vC3GAVhk/rE /vPKiSV5CAXK/3t0WeX1/3ZNsY/Ul5dLS8lV0uol/Cj+UtRt/Zk4sIh6yididMuf64Ba GLBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=BLzRq/P/QWekU+gDPg7eza519SYU+aSLpb/osMB1xMepK0o3AYRfwyDDv8ekGtRjMG bB7FD790pTZOH+E6WVcEAgVU4VHWozdreoJpkcrX6DGQlZy5OuiV4YqnXr7LIGNUVuFN 0WG6tQY4qHH7NFxCDNWnJ9FTJnxSp5zPEai3bk3flezcv3tcS1AN67NU0/i3DwJ6yLgW SoPshUedqnymvoWbiY3XE94bv1FsFTCBBl9xFxkPyTAg91tzsCqM/TFg8iKADcCZkWBz gd6XE4e7dMU52zK8gFUjcZRqCaJVAwspJDcEZkqL52y475wEEMDgq4IcX+YO/dUDeLy9 ih2w== X-Gm-Message-State: AOAM530j8ncCxRGYXJeuYa6mX/a+KxFwQiF1vcKYt6Mhv/MYLlx0d5m1 GpeePJwcMdKEfWIUZJUYAfs= X-Google-Smtp-Source: ABdhPJzdFZIQVJ1DipALLbMQzdXhQ7LqTzyxp6paaFlRduPmNj6wrsGfChmfjhdHmK67f9IFeZWQKQ== X-Received: by 2002:ae9:dec5:: with SMTP id s188mr3767153qkf.250.1605297369148; Fri, 13 Nov 2020 11:56:09 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id z26sm6977757qki.40.2020.11.13.11.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 11:56:08 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Kees Cook Cc: Russell King , Catalin Marinas , Will Deacon , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Nick Desaulniers , Arvind Sankar , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, clang-built-linux@googlegroups.com, Nathan Chancellor , "kernelci . org bot" , Mark Brown Subject: [PATCH 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1 Date: Fri, 13 Nov 2020 12:55:53 -0700 Message-Id: <20201113195553.1487659-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201113195553.1487659-1-natechancellor@gmail.com> References: <20201113195553.1487659-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ld.lld 10.0.1 spews a bunch of various warnings about .rela sections, along with a few others. Newer versions of ld.lld do not have these warnings. As a result, do not add '--orphan-handling=warn' to LDFLAGS_vmlinux if ld.lld's version is not new enough. Reported-by: Arvind Sankar Reported-by: kernelci.org bot Reported-by: Mark Brown Link: https://github.com/ClangBuiltLinux/linux/issues/1187 Link: https://github.com/ClangBuiltLinux/linux/issues/1193 Signed-off-by: Nathan Chancellor --- MAINTAINERS | 1 + init/Kconfig | 6 +++++- scripts/lld-version.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/lld-version.sh diff --git a/MAINTAINERS b/MAINTAINERS index 3da6d8c154e4..4b83d3591ec7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4284,6 +4284,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues C: irc://chat.freenode.net/clangbuiltlinux F: Documentation/kbuild/llvm.rst F: scripts/clang-tools/ +F: scripts/lld-version.sh K: \b(?i:clang|llvm)\b CLEANCACHE API diff --git a/init/Kconfig b/init/Kconfig index a270716562de..40c9ca60ac1d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -47,6 +47,10 @@ config CLANG_VERSION int default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) +config LLD_VERSION + int + default $(shell,$(srctree)/scripts/lld-version.sh $(LD)) + config CC_CAN_LINK bool default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT @@ -1349,7 +1353,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION own risk. config LD_ORPHAN_WARN - def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) + def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) && (!LD_IS_LLD || LLD_VERSION >= 110000) config SYSCTL bool diff --git a/scripts/lld-version.sh b/scripts/lld-version.sh new file mode 100755 index 000000000000..cc779f412e39 --- /dev/null +++ b/scripts/lld-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# ld.lld-version ld.lld-command +# +# Print the linker version of `ld.lld-command' in a 5 or 6-digit form +# such as `100001' for ld.lld 10.0.1 etc. + +linker="$*" + +if ! ( $linker --version | grep -q LLD ); then + echo 0 + exit 1 +fi + +VERSION=$($linker --version | cut -d ' ' -f 2) +MAJOR=$(echo $VERSION | cut -d . -f 1) +MINOR=$(echo $VERSION | cut -d . -f 2) +PATCHLEVEL=$(echo $VERSION | cut -d . -f 3) +printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 26A59C55ABD for ; Fri, 13 Nov 2020 19:57:54 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BEC821D79 for ; Fri, 13 Nov 2020 19:57:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rz7bo515" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BEC821D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CXq5B42VgzDqlm for ; Sat, 14 Nov 2020 06:57:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::744; helo=mail-qk1-x744.google.com; envelope-from=natechancellor@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Rz7bo515; dkim-atps=neutral Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CXq3K0PrRzDr74 for ; Sat, 14 Nov 2020 06:56:12 +1100 (AEDT) Received: by mail-qk1-x744.google.com with SMTP id 199so9949541qkg.9 for ; Fri, 13 Nov 2020 11:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=Rz7bo5155yveyQ9ZrU3UXRmgFVAlpmKkI/wTgDabwLcf/AW274xZWtGwKaoFUHCuWV AlUe5BkWT/spMfkjOhGCLbH/P6zUhfVdE0Ya0L1jSSCP5uofyayDsp4lUMXVQtrOM4iq ymSNPlt7IqY/MlDkIJMQo1VjmPcK94pRwWf4QkNu+vVjHunZEg9cnxjY4plQCq/MKl+H cCHXsuMrxAVYpHLpMIehHAJKLLkv6OrYRA/SZyIZR3JxxDw5jpL2lTKg1vC3GAVhk/rE /vPKiSV5CAXK/3t0WeX1/3ZNsY/Ul5dLS8lV0uol/Cj+UtRt/Zk4sIh6yididMuf64Ba GLBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=eUid7PqHsH3abMYOHqK4rJoRgggS05/0S8LCsPKMbnFV8NzGIQb1aaVzEqO+S9Bxxe G4Vda105tw8+wjo4Jlo8fjFkQ1wVOg49rpW87vyfJMsN825lvfXcOJLnyC8wo+Vb8CDX XG1BRyyLu/39TZ/9NO3qcEymOVNeWHLi4QX++xrbRgTcq8uDJprWrprOjzJagAZadD0f r6awfQQct7tAlg7aif4yo49vTBlpA8KfcguWX4c6zRK41Dnx01w/jr6upnPXVm7T4UgY ub5/kP0rShBI/h6yorJzMjCz/Okwq7acb7GQIxLdqVkAtT5LNo3tHmpIvzkH7XmIqykB 5DGw== X-Gm-Message-State: AOAM530+0By4NzdkB+xE+vg7TNYXmsT90OywxMyxsuHyfWvyHBro3LHB gqCjA+HMu01O+vYyXxhitgE= X-Google-Smtp-Source: ABdhPJzdFZIQVJ1DipALLbMQzdXhQ7LqTzyxp6paaFlRduPmNj6wrsGfChmfjhdHmK67f9IFeZWQKQ== X-Received: by 2002:ae9:dec5:: with SMTP id s188mr3767153qkf.250.1605297369148; Fri, 13 Nov 2020 11:56:09 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id z26sm6977757qki.40.2020.11.13.11.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 11:56:08 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Kees Cook Subject: [PATCH 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1 Date: Fri, 13 Nov 2020 12:55:53 -0700 Message-Id: <20201113195553.1487659-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201113195553.1487659-1-natechancellor@gmail.com> References: <20201113195553.1487659-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, "kernelci . org bot" , linux-kbuild@vger.kernel.org, Catalin Marinas , Mark Brown , x86@kernel.org, Nick Desaulniers , Russell King , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Arvind Sankar , Ingo Molnar , Borislav Petkov , Thomas Gleixner , Will Deacon , Nathan Chancellor , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" ld.lld 10.0.1 spews a bunch of various warnings about .rela sections, along with a few others. Newer versions of ld.lld do not have these warnings. As a result, do not add '--orphan-handling=warn' to LDFLAGS_vmlinux if ld.lld's version is not new enough. Reported-by: Arvind Sankar Reported-by: kernelci.org bot Reported-by: Mark Brown Link: https://github.com/ClangBuiltLinux/linux/issues/1187 Link: https://github.com/ClangBuiltLinux/linux/issues/1193 Signed-off-by: Nathan Chancellor --- MAINTAINERS | 1 + init/Kconfig | 6 +++++- scripts/lld-version.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/lld-version.sh diff --git a/MAINTAINERS b/MAINTAINERS index 3da6d8c154e4..4b83d3591ec7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4284,6 +4284,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues C: irc://chat.freenode.net/clangbuiltlinux F: Documentation/kbuild/llvm.rst F: scripts/clang-tools/ +F: scripts/lld-version.sh K: \b(?i:clang|llvm)\b CLEANCACHE API diff --git a/init/Kconfig b/init/Kconfig index a270716562de..40c9ca60ac1d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -47,6 +47,10 @@ config CLANG_VERSION int default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) +config LLD_VERSION + int + default $(shell,$(srctree)/scripts/lld-version.sh $(LD)) + config CC_CAN_LINK bool default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT @@ -1349,7 +1353,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION own risk. config LD_ORPHAN_WARN - def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) + def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) && (!LD_IS_LLD || LLD_VERSION >= 110000) config SYSCTL bool diff --git a/scripts/lld-version.sh b/scripts/lld-version.sh new file mode 100755 index 000000000000..cc779f412e39 --- /dev/null +++ b/scripts/lld-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# ld.lld-version ld.lld-command +# +# Print the linker version of `ld.lld-command' in a 5 or 6-digit form +# such as `100001' for ld.lld 10.0.1 etc. + +linker="$*" + +if ! ( $linker --version | grep -q LLD ); then + echo 0 + exit 1 +fi + +VERSION=$($linker --version | cut -d ' ' -f 2) +MAJOR=$(echo $VERSION | cut -d . -f 1) +MINOR=$(echo $VERSION | cut -d . -f 2) +PATCHLEVEL=$(echo $VERSION | cut -d . -f 3) +printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 BEF3AC55ABD for ; Fri, 13 Nov 2020 19:56:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 509B12076B for ; Fri, 13 Nov 2020 19:56:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VWXMIOpx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rz7bo515" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 509B12076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pQuXC8Yc3OrORxXb9PJ4f86u/5m00AMH9hJ5vyy+sg8=; b=VWXMIOpxXpvEWbdiiwjN+Rmwj 3fZBYY6WmZr44lNZ5CoxM1G927wQ7O2HRDQJ+GdeMiV/jYLFXB1FL9+jirClGOcgYmJKDQnaw+KTR qhgJxHdAnpoITWRzKUqkLL6Wl5R1HVUhNBwibQKImPEBs2Sf5nXLxUD6xTI7KNso9PHkgfD6X9ny+ Wfo1orrp4m7JyR0YBifceSzO42Yc4HTlHuPQUd3DUgJOWnICbJsUUHFDjjOZXfxJH+DAp2RZSWQuj WmdxICwPg9fxSae4LLJed+OEjxw9d7/fUQAL/QAkGkx9EjWUtUNSfO8eWz6A/Wujnr2nMDqlQK0C9 dc8FOrrQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdfBD-0002aT-34; Fri, 13 Nov 2020 19:56:19 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdfB5-0002XJ-27 for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 19:56:12 +0000 Received: by mail-qk1-x741.google.com with SMTP id n132so9977141qke.1 for ; Fri, 13 Nov 2020 11:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=Rz7bo5155yveyQ9ZrU3UXRmgFVAlpmKkI/wTgDabwLcf/AW274xZWtGwKaoFUHCuWV AlUe5BkWT/spMfkjOhGCLbH/P6zUhfVdE0Ya0L1jSSCP5uofyayDsp4lUMXVQtrOM4iq ymSNPlt7IqY/MlDkIJMQo1VjmPcK94pRwWf4QkNu+vVjHunZEg9cnxjY4plQCq/MKl+H cCHXsuMrxAVYpHLpMIehHAJKLLkv6OrYRA/SZyIZR3JxxDw5jpL2lTKg1vC3GAVhk/rE /vPKiSV5CAXK/3t0WeX1/3ZNsY/Ul5dLS8lV0uol/Cj+UtRt/Zk4sIh6yididMuf64Ba GLBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BuSBR3W0Up+xs4RMbJtfRRlgixduLeoiJlhk7xnEIR0=; b=rtB9PbJYOrmLoYwFq1Q4B5+oBOOal3hn6oWoPlVPGWgDCza7mV0bxazqqbbhj7E4WA Sx58u0BAvpPtuTv4Y6sGfhuTah5zAC0KFdzbcuTlE/NvNj4MlGC+m6U0Fw2PxQb53KNi IYA35WgGMMR4SqF/BbH/ME4+9KoAszcQATYc/7b90eizuB74N4xu7FAGoc67AhWknKoT fYLevFGXRXEHLDu8AfqTdqMLMG0ZCcH/1Tlp4w9loSBs9PCBE+UhpJ+9U6Iips3PWNr7 RgLVxKAUQqjJDBKeg14rnUPexpiPpWU6gLnbAm7kbboaU7JpwjbZqhsVprhhqj1f1Frc PZSA== X-Gm-Message-State: AOAM5317gGz6qddy6zZdfYn9GrI9iiaAg+cOMm+rO96Pt8X/Lds87XY6 H8nHNfBoNckuoA1WGqGhbko= X-Google-Smtp-Source: ABdhPJzdFZIQVJ1DipALLbMQzdXhQ7LqTzyxp6paaFlRduPmNj6wrsGfChmfjhdHmK67f9IFeZWQKQ== X-Received: by 2002:ae9:dec5:: with SMTP id s188mr3767153qkf.250.1605297369148; Fri, 13 Nov 2020 11:56:09 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id z26sm6977757qki.40.2020.11.13.11.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 11:56:08 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Kees Cook Subject: [PATCH 2/2] kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1 Date: Fri, 13 Nov 2020 12:55:53 -0700 Message-Id: <20201113195553.1487659-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201113195553.1487659-1-natechancellor@gmail.com> References: <20201113195553.1487659-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_145611_180462_E770F35E X-CRM114-Status: GOOD ( 16.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, "kernelci . org bot" , linux-kbuild@vger.kernel.org, Catalin Marinas , Mark Brown , x86@kernel.org, Nick Desaulniers , Russell King , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Arvind Sankar , Ingo Molnar , Borislav Petkov , Michael Ellerman , Thomas Gleixner , Will Deacon , Nathan Chancellor , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ld.lld 10.0.1 spews a bunch of various warnings about .rela sections, along with a few others. Newer versions of ld.lld do not have these warnings. As a result, do not add '--orphan-handling=warn' to LDFLAGS_vmlinux if ld.lld's version is not new enough. Reported-by: Arvind Sankar Reported-by: kernelci.org bot Reported-by: Mark Brown Link: https://github.com/ClangBuiltLinux/linux/issues/1187 Link: https://github.com/ClangBuiltLinux/linux/issues/1193 Signed-off-by: Nathan Chancellor --- MAINTAINERS | 1 + init/Kconfig | 6 +++++- scripts/lld-version.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/lld-version.sh diff --git a/MAINTAINERS b/MAINTAINERS index 3da6d8c154e4..4b83d3591ec7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4284,6 +4284,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues C: irc://chat.freenode.net/clangbuiltlinux F: Documentation/kbuild/llvm.rst F: scripts/clang-tools/ +F: scripts/lld-version.sh K: \b(?i:clang|llvm)\b CLEANCACHE API diff --git a/init/Kconfig b/init/Kconfig index a270716562de..40c9ca60ac1d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -47,6 +47,10 @@ config CLANG_VERSION int default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) +config LLD_VERSION + int + default $(shell,$(srctree)/scripts/lld-version.sh $(LD)) + config CC_CAN_LINK bool default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT @@ -1349,7 +1353,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION own risk. config LD_ORPHAN_WARN - def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) + def_bool ARCH_WANT_LD_ORPHAN_WARN && $(ld-option,--orphan-handling=warn) && (!LD_IS_LLD || LLD_VERSION >= 110000) config SYSCTL bool diff --git a/scripts/lld-version.sh b/scripts/lld-version.sh new file mode 100755 index 000000000000..cc779f412e39 --- /dev/null +++ b/scripts/lld-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# ld.lld-version ld.lld-command +# +# Print the linker version of `ld.lld-command' in a 5 or 6-digit form +# such as `100001' for ld.lld 10.0.1 etc. + +linker="$*" + +if ! ( $linker --version | grep -q LLD ); then + echo 0 + exit 1 +fi + +VERSION=$($linker --version | cut -d ' ' -f 2) +MAJOR=$(echo $VERSION | cut -d . -f 1) +MINOR=$(echo $VERSION | cut -d . -f 2) +PATCHLEVEL=$(echo $VERSION | cut -d . -f 3) +printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel