From patchwork Sun Sep 15 04:39:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 2894281 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A39CBFF05 for ; Sun, 15 Sep 2013 04:39:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 852582027F for ; Sun, 15 Sep 2013 04:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D02C20276 for ; Sun, 15 Sep 2013 04:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932469Ab3IOEjV (ORCPT ); Sun, 15 Sep 2013 00:39:21 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:65090 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932465Ab3IOEjV (ORCPT ); Sun, 15 Sep 2013 00:39:21 -0400 Received: by mail-pd0-f171.google.com with SMTP id g10so2814509pdj.16 for ; Sat, 14 Sep 2013 21:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=DUX/Y43Aj17rMCcKm2GRvxxG5wRpdKrvzeaYfCujk7A=; b=PtV4/ZHnaVrD6tRQCCUQSmMeiGptaeKgFK0BFCyCWjv4gtUf3ILBTnmaNTLev+jmvh vqt2xZkVUL0anki5oFS6dRQSdDWKJ04DiZr3xdwRM15zuLU3/KWzngnlzLYSHEq79SSC 452DJP7P1BWbzaMSk4JDHAwL/kCB6+0evXSDjWxjAj9NcL07mALTTe1D8W0lfBo096Or WIIiaPH6qY+/rzUa9tCL2VfIT//9X6BaosloaGtGYHQUdRC/Vp0toQSWR5xoltBTbuPi iRY402UtK6t4Y3XOlRAmS9MfdKPRgNG9Q7fliMCbBDrbz5vTmq8s+aRwUH2Ru07Yrive wozg== X-Received: by 10.66.155.36 with SMTP id vt4mr23857778pab.93.1379219960626; Sat, 14 Sep 2013 21:39:20 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id ht5sm21958918pbb.29.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 14 Sep 2013 21:39:20 -0700 (PDT) From: Guenter Roeck To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Michal Marek , Guenter Roeck , Rusty Russell Subject: [PATCH] modpost: Fix secondary errors seen if a single module build fails Date: Sat, 14 Sep 2013 21:39:02 -0700 Message-Id: <1379219942-31545-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit ea4054a23 (modpost: handle huge numbers of modules) added support for building a large number of modules. Unfortunately, the commit changed the semantics of the makefile: Instead of passing only existing object files to modpost, make now passes all expected object files. If make was started with option -i, this results in a modpost error if a single file failed to build. Example with the current btrfs build falure on m68k: fs/btrfs/btrfs.o: No such file or directory make[1]: [__modpost] Error 1 (ignored) This error is followed by lots of errors such as: m68k-linux-gcc: error: arch/m68k/emu/nfcon.mod.c: No such file or directory m68k-linux-gcc: fatal error: no input files compilation terminated. make[1]: [arch/m68k/emu/nfcon.mod.o] Error 1 (ignored) This doesn't matter much for normal builds, but it is annoying for builds started with "make -i" due to the large number of secondary errors. Those errors unnececessarily clog any error log and make it difficult to find the real errors in the build. Fix the problem by only passing existing object files to modpost. Cc: Rusty Russell Signed-off-by: Guenter Roeck --- scripts/Makefile.modpost | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 8dcdca2..387c806 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -81,7 +81,8 @@ modpost = scripts/mod/modpost \ # We can go over command line length here, so be careful. quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules - cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) -s -T - + cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | \ + while read a; do [ -f $$a ] && echo $$a; done | $(modpost) -s -T - PHONY += __modpost __modpost: $(modules:.ko=.o) FORCE