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: 115564 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp852362qgn; Wed, 11 Oct 2017 07:57:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDRNYw0TrurewP4xKOe0phzrxW9jqfC7Kbkh6tm9oHR+W5uZV15s6kOSRDM8g1IsYv6BPMY X-Received: by 10.80.193.130 with SMTP id m2mr22133442edf.209.1507733837576; Wed, 11 Oct 2017 07:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507733837; cv=none; d=google.com; s=arc-20160816; b=k9RWH6hECc7sWMJ5twOwSu3slc4LowdqC++/alCFH27ChFnp4V4XRKTpb75JsBjKQr UMT5JWV3dBSkR+S2mmjCn1jsXgGwDxn+q5vwVG3/7lYRDQlMbQLWVCqUpuLBL0TtXZHg V7ynmFXHcM2uqmsdJ1erPTYY9GixX5JrJOaxEw+hkSkNCDAvjtHJfYUBWwYPvcdoWweK bRGNixZ3RHUQdD7zZxLG2DkH1N5EKu5KFvIQheP3EqTyMHtAL3Se2YSv6zvNU6uylJ41 Yd2tN5jVeblsPZfILeermCisGaeaaJXRnCCSu/CFEV2RoXR/o6CUk4raP8KPkScC2HaM SEcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=Od4BuLUpk5hnxSgDA1T6zjxC4CagamearU5649h3X/0=; b=gXw5uxsLx6MeHHYb/wqQ0dtizV5jvWUDRNViIj+sTMgS7SMCDDFtrbq+6o8h28FBmX +aFW1Prloc2UXNiIVQI5I2crBh+VzlCMOrERjIhPcEKuiaIAVX8ppP6+YdLtDxYbNiW7 MCv9I1waiUS1dF17FSC3vD3KNNIAbHO3zYuEGPdrkJgXVgqfsIfgtPddbgFRJrMsbV+3 Zr+4FZ4kGkIBVbqR6s3gDrlX/W75TDI/OH1tLO92omLC8tS56tIY2DCekA5eDk5IW6rq dY4oGsHT/04npUJwaeyE8ppu113tzvsgWvZl3gmOLt6e3HoADvEv7pB5Bv28vcttQjeR CMdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=intGa8U+; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f24si715550edc.451.2017.10.11.07.57.17; Wed, 11 Oct 2017 07:57:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=intGa8U+; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 1EB3BC21E70; Wed, 11 Oct 2017 14:57:16 +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