From patchwork Sun Oct 23 19:52:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 8088 Return-Path: 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 + 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 ); 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 To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Jiri Slaby , Michal Marek , Nick Desaulniers , Nicolas Schier , 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 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: 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?= 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 Signed-off-by: Masahiro Yamada Reported-by: Nathan Chancellor Tested-by: Nick Desaulniers --- 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