From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754780AbeCVPNQ (ORCPT ); Thu, 22 Mar 2018 11:13:16 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35792 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110AbeCVPNO (ORCPT ); Thu, 22 Mar 2018 11:13:14 -0400 X-Google-Smtp-Source: AIpwx49ogfiU+KfFmi11Fde/PpcFcK7zZMwpAJaeE5MBhQKEKAyA46MM3PsaKdfbyziMu9HZmMrtIcuDmZPPO3YZFqc= MIME-Version: 1.0 In-Reply-To: <1806382.Agy9d77yKa@avalon> References: <20180315153730.3798004-1-arnd@arndb.de> <1806382.Agy9d77yKa@avalon> From: Geert Uytterhoeven Date: Thu, 22 Mar 2018 16:13:13 +0100 X-Google-Sender-Auth: Ze3mA2r_lqlCbotxtGPgMbGTh5M Message-ID: Subject: Re: [PATCH] [RFC] drm: rcar-du: keep temporary dtb files around during build To: Laurent Pinchart Cc: Frank.Rowand@sony.com, Arnd Bergmann , David Airlie , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , DRI Development , Linux-Renesas , Linux Kernel Mailing List , Frank Rowand , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, CC Yamada-san On Thu, Mar 22, 2018 at 3:50 PM, Laurent Pinchart wrote: > On Thursday, 22 March 2018 16:26:22 EET Geert Uytterhoeven wrote: >> On Fri, Mar 16, 2018 at 2:39 AM, wrote: >> > On Thursday, March 15, 2018 8:37 AM, Arnd Bergmann wrote: >> >> The *.dtb and *.dtb.S files get removed by 'make' during the build >> >> process, and later seem to be missed during the 'modpost' stage: >> >> >> >> rm drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dtb >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dtb >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dtb.S >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dtb.S >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb.S >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dtb >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dtb >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dtb.S >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dtb.S >> >> WARNING: could not open >> >> drivers/gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dtb.S: No such file or >> >> directory >> >> >> >> As a workaround, this adds all those files to the 'extra-y' target list, >> >> but that's really ugly. Any ideas for a better fix? >> > >> > Does this work for you (untested, but the way it is done in >> > drivers/of/unittest-data/Makefile): >> > >> > .PRECIOUS: \ >> > >> > $(obj)/%.dtb.S \ >> > $(obj)/%.dtb >> >> Shouldn't that just be moved to scripts/Makefile.lib, just above the rule >> to make dtb.S, like is done for other precious objects? > > Without any implied acknowledgment that keeping those intermediate files is > the right solution (I don't claim to master the kernel build system), I think Me neither, but I think it is. Cfr. .y => .tab.c => .tab.o with .tab.c marked PRECIOUS. > such a rule would indeed be better in a core Makefile, as the rules to build > the .dtb.o file comes from the core too. Could another option be to create a > rule to compile a .dtb.o from the .dts file directly without going through > intermediate files that will be removed automatically ? Such a rules needs to execute two commands, which is more tricky, considering error handling. It's easier (to get right) to have two separate rules, and let make chain them automatically. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds