From patchwork Mon Feb 4 09:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 157384 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3674525jaa; Mon, 4 Feb 2019 01:11:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN59BEnMVxqjGFbEMElfU9Kej4EoFB/Fbq2cCM6DVg3ShAzpJ/RNNEdUDSBnSNV1EfrUDHEl X-Received: by 2002:a62:3adc:: with SMTP id v89mr49311288pfj.109.1549271496539; Mon, 04 Feb 2019 01:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549271496; cv=none; d=google.com; s=arc-20160816; b=opxkUDfIWp0Gzx4utQ/DBDQ2+eUdbYhzTSiFYJUGOcV7x+bLCJQhXSS0S4JRUymBDw dZy1pbZ5Mhi7PR+r9rv/xW6hl0xvxklzM/vUX66z6XYE3lOiPj3GkN1LTh9Crn/N78YW qkhzt/xjh02UpgWVw2SMvYxq8kaxcSOlxoE+beOnTqDcVM/9jmsjornXED89eBJGS3XW cQNCS0Av9yQAwfW9UdZyoeBQhvWInEPwmUVvgDNTMEpR+gwzIm2r0J4/Go1Qjysm1fCE C34aL9j3g3P67pwLoJlVhMsUQF1PQwJ2eh5vbCxR3N7rPoThTPh3pe/qswVx54L9R51C q9WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=XzPk4zZ7cIQxJU5LknCfKO75cJienGDZnk54W3rrB5U=; b=yhibguQdgruYm6JB3XJVEcq/cRBwGbVp4At+Zf3+QoJ2Y2JqniwXSAg9UDRH2Ixzzt NybqKqD2TV1yFkxwjloKXUZ6CkGe8NgsLeqi/L1aLA2t/Ji3/Ti2dRA3Dn0gQaZSSQLI fpHWMXylCJYADDKKtvvfhYR8ERSsw9ewyv5l5sDe6BpphBC+sFXFOErsaVtbcdkkc7eU nPB1qFkOq5qYGvn0TiG1ddkI3Msi8wwhH7jBEStMc+i4Xfo4niOliNoFjR1jpkk8/MfV mpg4R6mSwBeVQ/QYrdqAOdBJxF6KY7CLENEyZoSyljvP1NcZTZh9MGFrw6z9Uqcx0u+n V7VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QzXIrhW2; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m64si16428723pfb.224.2019.02.04.01.11.36; Mon, 04 Feb 2019 01:11:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QzXIrhW2; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728344AbfBDJLf (ORCPT + 7 others); Mon, 4 Feb 2019 04:11:35 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:19831 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726320AbfBDJLf (ORCPT ); Mon, 4 Feb 2019 04:11:35 -0500 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Mon, 04 Feb 2019 04:11:33 EST Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x149B3dD005281; Mon, 4 Feb 2019 18:11:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x149B3dD005281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1549271464; bh=XzPk4zZ7cIQxJU5LknCfKO75cJienGDZnk54W3rrB5U=; h=From:To:Cc:Subject:Date:From; b=QzXIrhW2S21k72/cjZV5gRYnPif+T1FmiQXwptSQIIoVN7uF9UDWpNtdECvyNhIaR f0tWVAIal8T8v+5XPQph4xd1XzlaPoF+dofGD9JYPxKC/k9CB+TA2XrZZPCDBp11Gu UCYb2Pwl2OXZpdToREXcQZh/K44oWzxlBOP49iu6G0U2L4WkSeuTjl3qktsnjPyE6L icPdeeKZeTvBZCjUU1ZzZqe5wMte4z5LReemWoyJkasLLYRxFMqlljcQhMBX3qv0c/ 77lpcpzlEg4pfUKE2e2nWvMOka9UdEHA+W4+g5T5MY12CGInLNNebriai3fO1s93ek I/Brj085a5j0A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-sh@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Masahiro Yamada , Yoshinori Sato , linux-kernel@vger.kernel.org, Rich Felker , Mark Rutland Subject: [PATCH v2] sh: fix build error for invisible CONFIG_BUILTIN_DTB_SOURCE Date: Mon, 4 Feb 2019 18:10:55 +0900 Message-Id: <1549271455-19292-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org I fixed a similar build error in commit 1b1e4ee86e00 ("sh: fix build error for empty CONFIG_BUILTIN_DTB_SOURCE"), but it came back again. Since commit 37c8a5fafa3b ("kbuild: consolidate Devicetree dtb build rules"), the combination of CONFIG_OF_EARLY_FLATTREE=y and CONFIG_USE_BUILTIN_DTB=n results in the following build error: make[1]: *** No rule to make target 'arch/sh/boot/dts/.dtb.o', needed by 'arch/sh/boot/dts/built-in.a'. Stop. make: *** [Makefile;1727: arch/sh/boot/dts/] Error 2 Prior to that commit, there was only one path to descend into arch/sh/boot/dts/, and arch/sh/Makefile correctly guards it with CONFIG_USE_BUILTIN_DTB: core-$(CONFIG_USE_BUILTIN_DTB) += arch/sh/boot/dts/ Now, there is another path to descend there from the top Makefile when CONFIG_OF_EARLY_FLATTREE=y. If CONFIG_USE_BUILTIN_DTB is disabled, CONFIG_BUILTIN_DTB_SOURCE is invisible instead of defined as "". Add obj-$(CONFIG_USE_BUILTIN_DTB) guard to avoid the attempt to build the non-existing file. Fixes: 37c8a5fafa3b ("kbuild: consolidate Devicetree dtb build rules") Reported-by: kbuild test robot Signed-off-by: Masahiro Yamada --- Observant reviewers may point out another problem. There is a race condition when CONFIG_OF_EARLY_FLATTREE=y. Some architectures (sh, xtensa, etc.) embed a DTB in vmlinux, so there are two paths to descend into arch/*/boot/dts/. For parallel build with -j option, two threads may build under arch/*/boot/dts/ simultaneously. Yes, this is a problem, and it is in my TODO list. For some reasons, I will postpone it by the next development cycle. For now, I want to fix this sh build error first because kbuild test robot is still complaining about it. Changes in v2: - Change the subject a bit because the cause of the error is different arch/sh/boot/dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/sh/boot/dts/Makefile b/arch/sh/boot/dts/Makefile index 01d0f7f..2563d1e 100644 --- a/arch/sh/boot/dts/Makefile +++ b/arch/sh/boot/dts/Makefile @@ -1,3 +1,3 @@ ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"") -obj-y += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o +obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o endif