From patchwork Wed Oct 11 14:56:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 824471 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="intGa8U+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yBxsX5jJwz9s2G for ; Thu, 12 Oct 2017 01:57:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 8C302C21EB9; Wed, 11 Oct 2017 14:57:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7F11BC21E14; Wed, 11 Oct 2017 14:57:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82BEBC21E14; Wed, 11 Oct 2017 14:57:13 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 20092C21D6A for ; Wed, 11 Oct 2017 14:57:11 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-08.nifty.com with ESMTP id v9BEuKvU018310; Wed, 11 Oct 2017 23:56:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v9BEuKvU018310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1507733781; bh=8ildPqzgTb6av15H/2WLvla60j5T3YzhM4RVQ+OvZzY=; h=From:To:Cc:Subject:Date:From; b=intGa8U+g10PX+c3kIn0gSSAuG1guegNQCxXE8l7qgWQVm/25rnRAZbVYMIGGyQch KumB2Po5K04BYxAwnlJHmAtAMreqxLZBPI9MNXKz708wchI5R3ayIkqjnnL6H77TCr o6c9hDP3AG2HhvbPsFdo8raXFS0CTD9lsGUea3TH/MrKfigq6E+5eL6Zmm0cN0c0f1 G0OQZ1k085vc913vVKPtcb26JFlIr5xvSikrIrgg4bc8UK07Qa0RukhoQy0pvGT1gt ptAGPLhI/hx5XRyDgnKA/olBifdkq7frkFMBveub1R+CpPl0twukdZ1tGB9/5E2F6t 8V+3eont7rq2A== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 11 Oct 2017 23:56:10 +0900 Message-Id: <1507733771-28177-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Mark Kettenis , Andy Shevchenko , Heinrich Schuchardt , Pantelis Antoniou Subject: [U-Boot] [PATCH] kbuild: fix dependency of DT build X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" I saw a DT build issue report some time before [1]. I was able to reproduce the bug, and figure out the root cause. Since commit 6d427c6b1fa0 ("binman: Automatically include a U-Boot .dtsi file"), invalid .*.cmd files are generated. Since that commit, DTS files are put into sed and piped to CPP. Because CPP reads the stream from stdin, -Wp,-MD,$(depfile).pre.tmp option generates a depfile with the target name "-". This is not the format expected by fixdep. Use one more temporary file instead of using pipe. With this, deps_ in the .*.cmd will be fixed. Having a temp file name in source_ is odd, but it is unsed in the build system. Not a big deal. [1] https://lists.denx.de/pipermail/u-boot/2017-June/294451.html Fiexes: 6d427c6b1fa0 ("binman: Automatically include a U-Boot .dtsi file") Signed-off-by: Masahiro Yamada --- Probably, I can fix this issue in an even cleaner way. But, U-Boot build system is a mirror of Linux. I generally improve Linux first, then import the outcome back to U-Boot. I will give it a try when I find some time. scripts/Makefile.lib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 861a3dc..0d5c529 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -175,7 +175,7 @@ u_boot_dtsi_options = $(wildcard $(dir $<)$(basename $(notdir $<))-u-boot.dtsi) # $(warning u_boot_dtsi_options: $(u_boot_dtsi_options)) # We use the first match -u_boot_dtsi = $(firstword $(u_boot_dtsi_options)) +u_boot_dtsi = $(notdir $(firstword $(u_boot_dtsi_options))) # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ @@ -308,9 +308,8 @@ quiet_cmd_dtc = DTC $@ # Modified for U-Boot # Bring in any U-Boot-specific include at the end of the file cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - cat $< $(if $(u_boot_dtsi),\ - | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \ - $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + (cat $<; $(if $(u_boot_dtsi),echo '\#include "$(u_boot_dtsi)"')) > $(pre-tmp); \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \ -i $(dir $<) $(DTC_FLAGS) \ -d $(depfile).dtc.tmp $(dtc-tmp) ; \ @@ -319,6 +318,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) +pre-tmp = $(subst $(comma),_,$(dot-target).pre.tmp) dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) # DTCO