From patchwork Tue Jan 19 10:31:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 8060111 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E29789F1CC for ; Tue, 19 Jan 2016 10:32:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C74DD203AA for ; Tue, 19 Jan 2016 10:32:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCF8A2037C for ; Tue, 19 Jan 2016 10:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933043AbcASKcT (ORCPT ); Tue, 19 Jan 2016 05:32:19 -0500 Received: from [195.59.15.196] ([195.59.15.196]:51427 "EHLO mailapp01.imgtec.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S932923AbcASKcP (ORCPT ); Tue, 19 Jan 2016 05:32:15 -0500 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Websense Email Security Gateway with ESMTPS id 89B4B841139A2; Tue, 19 Jan 2016 10:31:50 +0000 (GMT) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by HHMAIL01.hh.imgtec.org (10.100.10.19) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 19 Jan 2016 10:31:52 +0000 Received: from jhogan-linux.le.imgtec.org (192.168.154.110) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Tue, 19 Jan 2016 10:31:52 +0000 From: James Hogan To: Michal Marek CC: , Heinrich Schuchardt , James Hogan , Arnd Bergmann , "Ralf Baechle" , Paul Burton , Florian Fainelli , , , Subject: [PATCH] kbuild: Remove stale asm-generic wrappers Date: Tue, 19 Jan 2016 10:31:43 +0000 Message-ID: <1453199503-30900-1-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <20160119100154.GJ30608@jhogan-linux.le.imgtec.org> References: <20160119100154.GJ30608@jhogan-linux.le.imgtec.org> MIME-Version: 1.0 X-Originating-IP: [192.168.154.110] Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 When a header file is removed from generic-y (often accompanied by the addition of an arch specific header), the generated wrapper file will persist, and in some cases may still take precedence over the new arch header. For example commit f1fe2d21f4e1 ("MIPS: Add definitions for extended context") removed ucontext.h from generic-y in arch/mips/include/asm/, and added an arch/mips/include/uapi/asm/ucontext.h. The continued use of the wrapper when reusing a dirty build tree resulted in build failures in arch/mips/kernel/signal.c: arch/mips/kernel/signal.c: In function ‘sc_to_extcontext’: arch/mips/kernel/signal.c:142:12: error: ‘struct ucontext’ has no member named ‘uc_extcontext’ return &uc->uc_extcontext; ^ Fix by detecting wrapper headers in generated header directories that do not correspond to a filename in generic-y, and removing them. Reported-by: Jacek Anaszewski Reported-by: Hauke Mehrtens Reported-by: Heinrich Schuchardt Signed-off-by: James Hogan Cc: Michal Marek Cc: Arnd Bergmann Cc: Ralf Baechle Cc: Paul Burton Cc: Florian Fainelli Cc: linux-kbuild@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org --- scripts/Makefile.asm-generic | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index 045e0098e962..7422f6476a8a 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic @@ -21,3 +21,19 @@ all: $(patsubst %, $(obj)/%, $(generic-y)) $(obj)/%.h: $(call cmd,wrap) + +# Remove stale wrappers when the corresponding files are removed from +# generic-y + +quiet_cmd_rmwrap = REMOVE $(patsubst %.rm,%,$@) +cmd_rmwrap = rm -f $(patsubst %.rm, %, $@) + +all: $(filter-out $(patsubst %, $(obj)/%.rm, $(generic-y)), \ + $(patsubst %, %.rm, $(wildcard $(obj)/*.h))) + +$(obj)/%.h.rm: FORCE + $(call cmd,rmwrap) + +.PHONY: $(PHONY) +PHONY += FORCE +FORCE: ;