Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3941710pxj; Mon, 21 Jun 2021 09:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuqyd+vsb20pd2x9F0dr1eWvJ2psYb15pVq/4wG4xBQSrsIzn+t8NsUqNkTTHKhTxjmFhA X-Received: by 2002:a02:1988:: with SMTP id b130mr18875401jab.44.1624294280257; Mon, 21 Jun 2021 09:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294280; cv=none; d=google.com; s=arc-20160816; b=m9WTQ6mzMkgoo6kIidHvwvObZ8vuMawvw1AjFK0n9if54GclaiYe2jwzB34D8uxj2C mEI50ATkZB92zbrgKfhq1eAtPkbQx/1B36KlYxRN9BHa/cVUVnIrxj6cwoBS/RtSwnJU fEHHkl3iSLhRwipDaj33tdkj5MJn3dKlWI00KWaUFIMQ2mMQXlXDulVpmVCeHzN2AV5i fI1zoJoU3ZRgYq3OD3sgAyOLw6ZGnJK9gR+gOFnj+bAmZBnqgMntTldLXCCDnUUDLJ9A ujkKrmXzpe8YllyC+ano9YIQYcYSJb7ulLiwue4PGWoTkXlKC4jPcVNf5FtCnH+0GWVD 5Slg== 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:dkim-signature; bh=MONZqXnTNekAimmy+TKgrH6iufgA2JnlOX9U8LualHQ=; b=YQ1/MqKBr7M1/q94c3z5w91snIvp0QFkIUYqoV8RUKoBREf3ikWUYFVVDYueS6G8pw BgTfwq0eASGGQdzHTSSSsatLxj7MSLkOBkP4F9RTPgencog21/q6fnDUzFkhQWVkluB6 iqWoXjO6XjfXFSFnW/WxoCPQLtzc2vVMDD0eH5FGVg69YPEMkfVfjZmBDeq0oU3gMb6t j9mYDMo1UZnC+zTCYlMaYHwep636EMwycJ4ofIevJzMgzeor8nY1EoCADmiSUJ/emKnU GGipxaRX0R/T84QJhSVPsuzwsGbpuv9lPY5usCeyyYSR7bArmlzZWFiXrieWZ9ZyJkDN mjoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zyFHsfM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 y6si14771257ilu.110.2021.06.21.09.51.08; Mon, 21 Jun 2021 09:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zyFHsfM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231281AbhFUQv5 (ORCPT + 99 others); Mon, 21 Jun 2021 12:51:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232739AbhFUQr6 (ORCPT ); Mon, 21 Jun 2021 12:47:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FFDA61414; Mon, 21 Jun 2021 16:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293235; bh=DpdsOizRZRHCAWcMf9zuFxLYtF6OIS/+YhzrZKAY7VM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zyFHsfM0eDS5XVllWMw5nzooKthijMPcV2QYR+Ydtq8BmHfgoWLB2lWi7XL5Xve43 UymsAB54HVT6bYF7L5eSpaPEWnXPIhZaNWlIk+tn4CTjZM9hE/cSa+ucdJYLJHiCSV by0OqzNAHPCOHjYq+88QypYo4n3zJ8Oh0q99mQV4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tor Vic , Nathan Chancellor , Nick Desaulniers , Kees Cook Subject: [PATCH 5.12 148/178] Makefile: lto: Pass -warn-stack-size only on LLD < 13.0.0 Date: Mon, 21 Jun 2021 18:16:02 +0200 Message-Id: <20210621154927.806773805@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tor Vic commit 0236526d76b87c1dc2cbe3eb31ae29be5b0ca151 upstream. Since LLVM commit fc018eb, the '-warn-stack-size' flag has been dropped [1], leading to the following error message when building with Clang-13 and LLD-13: ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument '-warn-stack-size=2048'. Try: 'ld.lld --help' ld.lld: Did you mean '--asan-stack=2048'? In the same way as with commit 2398ce80152a ("x86, lto: Pass -stack-alignment only on LLD < 13.0.0") , make '-warn-stack-size' conditional on LLD < 13.0.0. [1] https://reviews.llvm.org/D103928 Fixes: 24845dcb170e ("Makefile: LTO: have linker check -Wframe-larger-than") Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/1377 Signed-off-by: Tor Vic Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/7631bab7-a8ab-f884-ab54-f4198976125c@mailbox.org Signed-off-by: Greg Kroah-Hartman --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -913,11 +913,14 @@ CC_FLAGS_LTO += -fvisibility=hidden # Limit inlining across translation units to reduce binary size KBUILD_LDFLAGS += -mllvm -import-instr-limit=5 -# Check for frame size exceeding threshold during prolog/epilog insertion. +# Check for frame size exceeding threshold during prolog/epilog insertion +# when using lld < 13.0.0. ifneq ($(CONFIG_FRAME_WARN),0) +ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 130000; echo $$?),0) KBUILD_LDFLAGS += -plugin-opt=-warn-stack-size=$(CONFIG_FRAME_WARN) endif endif +endif ifdef CONFIG_LTO KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)