Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp995178rwi; Thu, 27 Oct 2022 09:52:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Odm7PxeRk2xgipJFPfTmNquswQIkveUf6+j/k6yyVN7QsGOmKgor8yiyFlqLzMICOyikH X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr46541812edz.240.1666889566462; Thu, 27 Oct 2022 09:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666889566; cv=none; d=google.com; s=arc-20160816; b=xrpCvOFcnp5m5MExwqFLQQ/8gIyYC0PdOuP94SqZ0nnEX07KNbMV9S8tXCOxBdjw72 AWyHfWU/jHyY9/oClmV/eh5lET7d0WyMoeFVoc5qWiRdKUYG2PttxvKIM1CxbhFlmWVA hjQWtc2I5VVg9lDyJtWgH3K0+mk7Bi6QSb4y3/RM288nEIH1NxZ3neUr9AsfoLqQY80P KEXLohXxRzuObcAVsafGoWOntIIMchZR0rUfMpxko23dfylufZ8IOX/dR3x93AbYc/t3 XDWJ0djKt/aQDKxp57jrNeYJT+t5gzg2cw3e/LXii2cogzXDPKGjfgTZSOPkbJIkw8tp +3DQ== 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=/U6QNXQ/xCPGTTB1SAGiuHHJBka8um7FPSVO88evHYI=; b=sSA3T9Zg88dgcUveELsxkjY790/cPA4KMgnpzfv53vIS1104fi4r2EPPWEp+wDf5X+ MetSO5dOqo7+qyNgnCWS3VkeyoGI+hDizjM0Y0gLUVN6ArGsC0FQYFQyq/oaGTRtFxf2 7jpLhDN/K5SCTI3qCQAJk/LkeJQ6DHAzWv+HeK2Ig1Hjntviko6MY9p4j6kGFqUPt1sN XF6G3npCuX9Jb4FXagK8+x95OZTn+ts+jxKZRodRB5/2NxkvwiHHV9jbs6TFd3sECfXp lTE3BrPrhx0kxWR2tBh1mFKV86Mc0XiuIOYll6KVZPVs00qANEjwcOLGAeq9bYUoT47y Akyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VSrXHgK1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a056402278800b004604906b23csi2322740ede.545.2022.10.27.09.52.20; Thu, 27 Oct 2022 09:52:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VSrXHgK1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236108AbiJ0QhO (ORCPT + 99 others); Thu, 27 Oct 2022 12:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233858AbiJ0QhM (ORCPT ); Thu, 27 Oct 2022 12:37:12 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 154FF18E724 for ; Thu, 27 Oct 2022 09:37:12 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id i3so2086451pfc.11 for ; Thu, 27 Oct 2022 09:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/U6QNXQ/xCPGTTB1SAGiuHHJBka8um7FPSVO88evHYI=; b=VSrXHgK1wthxTiSvcuhaQbjJeIf88juMO1vdkrfo8WfFh1W8lrjC/FEAR/tfSGGiaI MwL2e/KdbjhhU5Mvx64WTzDvM28en1ruz6tMYyq71mEdM2mUXPl7YsB9GXfSG3zXUdL3 U0JN8NqLuwTvA7DsT/+Z2LG8SnF4BakmBHO6rvnjvJ2wyzmZ82j7VbOXOvCM4FTenpjf LUXfcAQJLSbblvmH06iJVgcMmmP76BqS6KGm/FBWFP1CkRZ14QuwLiNAFLMCuAx/VC3X y1k+lyPjJvUOCVaMMDcxwoNJbPK7skwJ05kKMxPx1sab1r+g80HAIayEjDwr2Z3Vaz1U tTmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/U6QNXQ/xCPGTTB1SAGiuHHJBka8um7FPSVO88evHYI=; b=3a9cGV4H1YW1iP2+se3GqrLpg9rexhLbMtlMcEl8RRUh3U6pkJVJkwtvEpXJjJinId djiLn7caLYgq9GtmySS9VZqGPBk4A4YlhxQuWSRrT0QJ6bGfEriGtNmrn9DF3lwAf/9t AUK3nNCeWN31V2LWvzcrviZGUmMa/2pEQxEkWEj99+B3C0p3VuG04vCw/BYd2hMGe2Oa /AqRNX2hE9PgVCh1FbrSWEZhpB/kxOJndrCcbHecl6QCQSAfK2r7rcaNoCgJrcXuUjdk LYZgaGuRBb08FvFjNr/TlZxHR065szhkyRVNJ4LAqrzVs6dbPl7/uh1WZBzBzw8QZtb+ 4lug== X-Gm-Message-State: ACrzQf1DUJZyZtv0LHgkZAAg+umzk2kFLUwqJeHRxze/orw9f3KsFNWl MFVW/2eA/irRq81Zc+F5140cr/hlV6p00Cxam7b7FA== X-Received: by 2002:aa7:83cd:0:b0:563:5f54:d78c with SMTP id j13-20020aa783cd000000b005635f54d78cmr51545714pfn.66.1666888628868; Thu, 27 Oct 2022 09:37:08 -0700 (PDT) MIME-Version: 1.0 References: <20221027162839.410720-1-masahiroy@kernel.org> In-Reply-To: <20221027162839.410720-1-masahiroy@kernel.org> From: Nick Desaulniers Date: Thu, 27 Oct 2022 09:36:57 -0700 Message-ID: Subject: Re: [PATCH v2] kbuild: fix SIGPIPE error message for AR=gcc-ar and AR=llvm-ar To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Jiri Slaby , Nathan Chancellor , Michal Marek , Nicolas Schier , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 27, 2022 at 9:28 AM Masahiro Yamada wrote: > > Jiri Slaby reported that building the kernel with AR=gcc-ar shows: > /usr/bin/ar terminated with signal 13 [Broken pipe] > > Nathan Chancellor reported the latest AR=llvm-ar shows > error: write on a pipe with no reader > > The latter occurs since LLVM commit 51b557adc131 ("Add an error message > to the default SIGPIPE handler"). > > The resulting vmlinux is correct, but it is better to silence it. > > 'head -n1' exits after reading the first line, so the pipe is closed. > > Use 'sed -n 1p' to eat the stream till the end. > > Fixes: 321648455061 ("kbuild: use obj-y instead extra-y for objects placed at the head") > Link: https://github.com/ClangBuiltLinux/linux/issues/1651 > Reported-by: Jiri Slaby > Reported-by: Nathan Chancellor > Signed-off-by: Masahiro Yamada > Tested-by: Nick Desaulniers Looks great! Thanks all. Reviewed-by: Nick Desaulniers > --- > > Changes in v2: > - Update commit description to mention llvm-ar > > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index e90bb2b38607..e9e7eff906a5 100644 > --- a/Makefile > +++ b/Makefile > @@ -1218,7 +1218,7 @@ quiet_cmd_ar_vmlinux.a = AR $@ > cmd_ar_vmlinux.a = \ > rm -f $@; \ > $(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \ > - $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt) > + $(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt) > > targets += vmlinux.a > vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE > -- > 2.34.1 > -- Thanks, ~Nick Desaulniers