Message ID | 20221023195257.175946-1-masahiroy@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp118082wru; Sun, 23 Oct 2022 13:07:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xxSOzyLFSv+ClmMmaXn86YxUbFn7aW5l+nrLC5ilRc8/3eaAB3sAaCMvr0uFCwCXQVzpV X-Received: by 2002:a05:6402:3485:b0:45c:d688:6848 with SMTP id v5-20020a056402348500b0045cd6886848mr27008538edc.279.1666555633614; Sun, 23 Oct 2022 13:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666555633; cv=none; d=google.com; s=arc-20160816; b=UPJup3TWwBiNf+bqx6F5Yk7N6LHHT7J6Cs8lY+ls7kgQ//fWkLyNkHfs98vLxg2wUd E9xYaTsgu92Dg+WTBtvZGEVLhTksG/gG0KPPOptrM1FQLlsUycZS4MI/pJ2BwB4vJ2tN c3Y7yoi0ZFBRo7Jl7LkZcLZukUalIAYm214xwsAlgPeKDXyndy0eZk8Yjk7bESPdcKWx zEhZ9C8Ac3bZwVAJ9HEDHcR04+NmSOKv3SyJ+59w1mYjyPVC6D6Vhts5oULXJc3Cdvkb xz8ccJv6S4hdqc38BOni4VJmss0aFkx1xhaPJGWAX/KIdeBLE+wsaqY0CzO0WgdkK3wp xo0g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=V79VWrfiXYM72PAluUinpop+fy9KEk+xiZI5sLCxEA0=; b=bCeTAIVv99Ckiujn90nMn3EWb2bNsAiwOnzcLkOmh6VZvJLe9+OqJ7ObzxsREoV1hF 4ihW+b2+2HXb7G0fEOK7+UE/QkpDirN/L1db7xSUq3TCQBJEvrTlOZSPM30mHlHmhfQm y3nV1MyQ6JRbPUmMYksk33uNkYk//Q6xAHNz89bOK0oSRrzOQ4mQVp9IEnjvsjs7DuL3 tI66Y+rwbsfR/PamW5gtkhtqanJxT299AJ1GB+rraeqigsN6OnxU34xQGuCrRt3/AfQo aRVCePvemKOVIIjr3a/oPfohUJBrdgUJY/c11dHWM0HiOB0LZKP2Rt3j1JQUFwz/QFiZ GK3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VhhSzBXW; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xg14-20020a170907320e00b007781bc042a2si28451495ejb.646.2022.10.23.13.06.50; Sun, 23 Oct 2022 13:07:13 -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=@kernel.org header.s=k20201202 header.b=VhhSzBXW; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230396AbiJWTxR (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 15:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiJWTxJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 15:53:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE8416CD0D; Sun, 23 Oct 2022 12:53:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 82329B80DC8; Sun, 23 Oct 2022 19:53:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AB0DC433C1; Sun, 23 Oct 2022 19:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666554785; bh=i+HEk9TAvLe+0FbY+wjKbL1YcPdrh2JGQJPuRGg151k=; h=From:To:Cc:Subject:Date:From; b=VhhSzBXWJ5a3NKY/3eZ+G7uzha4RY2AozuBXH0jTX6kEOsamEurJzBTAPvkyBbfLR MCWBzgdRg2F6VxvB9P0YbWjU42w36Io8J8BUeotd4BUGluT70SoFymUyscrDHBycQX 6JesOi+qbA7CX/Tx3lQdlbTfCN1cldn2EWdxLN1BI0j3PFNanVm7I5YO7yrtYgRjyM Eyp+90enI1k04ASbrfxpRbFRRL5SIipwbsYCE/UmF3YRG3cMHjHAqJgefon71o3smW vmIdidh5d8B9NblxAWFRqdD3JRvxP/8ZoIreBEdWAkLnEAfDurjfiVN+TADe4eq5YG dkpwCQ/YJJBtg== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada <masahiroy@kernel.org>, Jiri Slaby <jirislaby@kernel.org>, Michal Marek <michal.lkml@markovi.net>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: fix 'Broken pipe' message for AR=gcc-ar Date: Mon, 24 Oct 2022 04:52:57 +0900 Message-Id: <20221023195257.175946-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747510239949780921?= X-GMAIL-MSGID: =?utf-8?q?1747510239949780921?= |
Series |
kbuild: fix 'Broken pipe' message for AR=gcc-ar
|
|
Commit Message
Masahiro Yamada
Oct. 23, 2022, 7:52 p.m. UTC
Since commit 321648455061 ("kbuild: use obj-y instead extra-y for
objects placed at the head"), 'make AR=gcc-ar' shows the following
message:
/usr/bin/ar terminated with signal 13 [Broken pipe]
The resulting vmlinux is correct, but it is better to silence this.
'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")
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sun, Oct 23, 2022 at 12:53 PM Masahiro Yamada <masahiroy@kernel.org> wrote: > > Since commit 321648455061 ("kbuild: use obj-y instead extra-y for > objects placed at the head"), 'make AR=gcc-ar' shows the following > message: > > /usr/bin/ar terminated with signal 13 [Broken pipe] Not just AR=gcc-ar, but also AR=llvm-ar: error: write on a pipe with no reader Link: https://github.com/ClangBuiltLinux/linux/issues/1651 Reported-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Note that due to https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8017ce50641c303b9b5d96f3c10229ecfd770a70 we should send a backport to stable like: https://github.com/engstk/op8/commit/6f2688e3eb4ec06b276e541640d4f06364b68442 > > The resulting vmlinux is correct, but it is better to silence this. > > '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") > Reported-by: Jiri Slaby <jirislaby@kernel.org> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index f41ec8c8426b..0e42a7982826 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 --file=$(srctree)/scripts/head-object-list.txt) > + $(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F --file=$(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 >
On Tue, Oct 25, 2022 at 4:15 AM Nick Desaulniers <ndesaulniers@google.com> wrote: > > On Sun, Oct 23, 2022 at 12:53 PM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > Since commit 321648455061 ("kbuild: use obj-y instead extra-y for > > objects placed at the head"), 'make AR=gcc-ar' shows the following > > message: > > > > /usr/bin/ar terminated with signal 13 [Broken pipe] > > Not just AR=gcc-ar, but also AR=llvm-ar: > > error: write on a pipe with no reader > > Link: https://github.com/ClangBuiltLinux/linux/issues/1651 > Reported-by: Nathan Chancellor <nathan@kernel.org> > Tested-by: Nick Desaulniers <ndesaulniers@google.com> Thank you. I updated the commit description, and sent v2. https://lore.kernel.org/linux-kbuild/20221027162839.410720-1-masahiroy@kernel.org/T/#u > Note that due to > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8017ce50641c303b9b5d96f3c10229ecfd770a70 > we should send a backport to stable like: > https://github.com/engstk/op8/commit/6f2688e3eb4ec06b276e541640d4f06364b68442 Maybe, we can backport 8017ce50641c30 itself, but I am not sure if it is cleanly applicable.
diff --git a/Makefile b/Makefile index f41ec8c8426b..0e42a7982826 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 --file=$(srctree)/scripts/head-object-list.txt) + $(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt) targets += vmlinux.a vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE