Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3077966pxj; Mon, 14 Jun 2021 13:56:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznonHd6oz+UbKiaIBQWyOFGfRZkra7wwE+MPBzLjEBlSKCYyRXzsFexueHzWRKsMi8rAlN X-Received: by 2002:a17:906:4d04:: with SMTP id r4mr17174397eju.76.1623704207569; Mon, 14 Jun 2021 13:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623704207; cv=none; d=google.com; s=arc-20160816; b=0QgJp80ihVvXeVjJrOZHa+ghjqfPaZ9LPczJouYVRoRPnMksfk6YIlP91BjhmVrXu4 EYy+drhWTY0bZMLVh72XQjI4DT7Sln/TBCw+B5xCSdazEdIT436YdcdpIHtbS77lFi2M 6QdTucX3TARSxoPksmWhbfuZomCP5OlbgE/JWMZ20bBgIkm27wXFYZEbzxVQVZ+rD7ve 9anCGa0gSj8gaNJAmyYCuSgg1XrFO6WDitjz/P0/zl+w47V18aXr7Ipn3F3d52SmUCfd H5MeGmb0yivDL8UZvQ3QYP5kHqiJKCnJktbw8fyHRy+zLtgDHEunMCbvURunadHBHF4u 7O7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qBa3/WQ3AGZ6PKm/jM3ch14S6swJuVHrhcyrw+AJEwA=; b=MUH6XFJ4QFz4kTfNovH18eYHwCBH7qm4KyfqI7S9NJSqitsYZa8dJYFgmQgC5vNVJ7 7Txh0Yf+UCMRXkf/tj7AlPQNv8POArcU3on/U7QWJ3ND8GpDY1CKqxPhP+KQQm6RjmuZ NkjAO5OIkWmhVByB8Y1b99RoB4BFKUrZ/jn84fKOdzymKKPpovcIc6joMkc5cr7Ubo+a Ks/uVUxmqkYTe+Td+085147cVltiWuVhGCo0FVJQL9IrbqDQXQo6ysIc/RUlJPAg1JQx 3DkwcioMAf55dNFRecvIuMrua5bZgU7pWY1rmFvvuJHNR0eHwgRQ51avRA0iS9KnfMKF gb1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=plPsxy+9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si515929ejd.407.2021.06.14.13.56.23; Mon, 14 Jun 2021 13:56:47 -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=@google.com header.s=20161025 header.b=plPsxy+9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234257AbhFNU5T (ORCPT + 99 others); Mon, 14 Jun 2021 16:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233920AbhFNU5S (ORCPT ); Mon, 14 Jun 2021 16:57:18 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2089CC061574 for ; Mon, 14 Jun 2021 13:55:02 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id c11so21982208ljd.6 for ; Mon, 14 Jun 2021 13:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qBa3/WQ3AGZ6PKm/jM3ch14S6swJuVHrhcyrw+AJEwA=; b=plPsxy+9kEuGVZdGaNjNczNmZJ0tvHqF3H0S1tUuIqh7/xY432HUjpxYkrQFuUVHni V11wMaoN3lfHvndqx0GkwuPcks5mhAUb7sx2hlWE8hn7Lfp55uPTVNtjzC93MYzFe5vr G6Y1ioiUkY4+3H/iyYs/HQgUadwwcqWBmK8xLLldeHzrc5/tm8xOAmD5MRZyQK0WKtAT AHoma2r218DBdEcpt6Sc68FMcw0Q4cOvQ5jC3ujfDWxq1cnAutW/k/c5JPKEGDRZ70oC SER7qkXRrSvC7YiQN6BJqMG+gqGn3NvpxeblBjBhcyF91jlHPT2a2XFclZR1zKwwYUsL 1Q+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qBa3/WQ3AGZ6PKm/jM3ch14S6swJuVHrhcyrw+AJEwA=; b=kpjWe9Rxv6Qm6xSTRH/8sILSOgC/YbbAbVVq8318Z7us8M7vX/RhcaPCAJUZI/zpDZ eCp4xGIHh0Qzz8mpA6Yxrx+VjCDoriUJsamI/kfrx2QAOzo9/jd7X22AH0GOB2KHhEfW er2GrfYeXOZb7ZH82YT9lJP5/nEH+ur/h3dryn9B3upwWrlUXzblPyhf/LQqelsVSKJT zO0S0ZD76T+GFvEb5SSqyF8ZBx6Cv0OWnqEedKHd2Z569PICKGbnly1Rf1ukT7stEEdK XXqI2Sea5SsIOh9+9tGRolwM7t9vvwZXYcO98XxwohST30sw9+2Zy4TV0Rbc8+2f2fo7 tQQw== X-Gm-Message-State: AOAM530nbERDeSvxJsd5hm6DgoOaIBGuZL/qTcsmsXq5UAQXDdZu3zkI DpSC4aZxZbMoQmLrqD0cpKgOEARSLjOTwjZj1qNdJw== X-Received: by 2002:a2e:3c06:: with SMTP id j6mr14789034lja.495.1623704100254; Mon, 14 Jun 2021 13:55:00 -0700 (PDT) MIME-Version: 1.0 References: <7631bab7-a8ab-f884-ab54-f4198976125c@mailbox.org> In-Reply-To: <7631bab7-a8ab-f884-ab54-f4198976125c@mailbox.org> From: Nick Desaulniers Date: Mon, 14 Jun 2021 13:54:48 -0700 Message-ID: Subject: Re: [PATCH 1/1] Makefile: Pass -warn-stack-size only on LLD < 13.0.0 To: Tor Vic Cc: "linux-kernel@vger.kernel.org" , Masahiro Yamada , Nathan Chancellor , Kees Cook , "clang-built-linux@googlegroups.com" , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 13, 2021 at 6:07 AM Tor Vic wrote: > > 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 Thanks for the patch! Reviewed-by: Nick Desaulniers > --- > Makefile | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 144d4f8b7eb3..51a1b6b2c2ab 100644 > --- a/Makefile > +++ b/Makefile > @@ -929,11 +929,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) > -- > 2.32.0 -- Thanks, ~Nick Desaulniers