All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
@ 2021-10-20 12:37 Andy Shevchenko
  2021-10-24 19:53 ` Simon Glass
  2023-11-29 17:16 ` Heinrich Schuchardt
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Shevchenko @ 2021-10-20 12:37 UTC (permalink / raw)
  To: u-boot; +Cc: Bin Meng, Simon Glass, Tom Rini, Wolfgang Wallner, Andy Shevchenko

The dsdt.asl is usually combined out of several files that are included
in the main one. Whenever we change the content of any of such files,
build system is not able to recognize them. Hence the easiest way is to
force DSDT rebuild each time we run make.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 07696e86bb54..8c3c893b398a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -441,7 +441,7 @@ cmd_acpi_c_asl=         \
 	iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
 	mv $(patsubst %.c,%.hex,$@) $@
 
-$(obj)/dsdt.c:    $(src)/dsdt.asl
+$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
 	$(call cmd,acpi_c_asl)
 	$(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-20 12:37 [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT Andy Shevchenko
@ 2021-10-24 19:53 ` Simon Glass
  2021-10-25  7:33   ` Andy Shevchenko
  2023-11-29 17:16 ` Heinrich Schuchardt
  1 sibling, 1 reply; 10+ messages in thread
From: Simon Glass @ 2021-10-24 19:53 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: U-Boot Mailing List, Bin Meng, Tom Rini, Wolfgang Wallner

Hi Andy,

On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The dsdt.asl is usually combined out of several files that are included
> in the main one. Whenever we change the content of any of such files,
> build system is not able to recognize them. Hence the easiest way is to
> force DSDT rebuild each time we run make.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Ick. Since it uses #include, doesn't the dependency generation work with this?

>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 07696e86bb54..8c3c893b398a 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -441,7 +441,7 @@ cmd_acpi_c_asl=         \
>         iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
>         mv $(patsubst %.c,%.hex,$@) $@
>
> -$(obj)/dsdt.c:    $(src)/dsdt.asl
> +$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
>         $(call cmd,acpi_c_asl)
>         $(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
>
> --
> 2.33.0
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-24 19:53 ` Simon Glass
@ 2021-10-25  7:33   ` Andy Shevchenko
  2021-10-25 15:18     ` Simon Glass
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2021-10-25  7:33 UTC (permalink / raw)
  To: Simon Glass
  Cc: Andy Shevchenko, U-Boot Mailing List, Bin Meng, Tom Rini,
	Wolfgang Wallner

On Sun, Oct 24, 2021 at 11:00 PM Simon Glass <sjg@chromium.org> wrote:
> On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The dsdt.asl is usually combined out of several files that are included
> > in the main one. Whenever we change the content of any of such files,
> > build system is not able to recognize them. Hence the easiest way is to
> > force DSDT rebuild each time we run make.

> Ick. Since it uses #include, doesn't the dependency generation work with this?

How?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-25  7:33   ` Andy Shevchenko
@ 2021-10-25 15:18     ` Simon Glass
  2021-10-25 18:52       ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Glass @ 2021-10-25 15:18 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Andy Shevchenko, U-Boot Mailing List, Bin Meng, Tom Rini,
	Wolfgang Wallner

Hi Andy,

On Mon, 25 Oct 2021 at 01:34, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Sun, Oct 24, 2021 at 11:00 PM Simon Glass <sjg@chromium.org> wrote:
> > On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > The dsdt.asl is usually combined out of several files that are included
> > > in the main one. Whenever we change the content of any of such files,
> > > build system is not able to recognize them. Hence the easiest way is to
> > > force DSDT rebuild each time we run make.
>
> > Ick. Since it uses #include, doesn't the dependency generation work with this?
>
> How?

If you do a sandbox build you will see this file:

arch/sandbox/dts/.sandbox.dtb.cmd

It contains the dependencies used to compile the device tree. Can we
use the same mechanism? There is a .cmd file for the dsdt file but it
does not seem to have the correct contents.

Regards,
Simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-25 15:18     ` Simon Glass
@ 2021-10-25 18:52       ` Andy Shevchenko
  2022-03-30  9:21         ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2021-10-25 18:52 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Bin Meng, Tom Rini, Wolfgang Wallner

On Mon, Oct 25, 2021 at 09:18:56AM -0600, Simon Glass wrote:
> On Mon, 25 Oct 2021 at 01:34, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Sun, Oct 24, 2021 at 11:00 PM Simon Glass <sjg@chromium.org> wrote:
> > > On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > The dsdt.asl is usually combined out of several files that are included
> > > > in the main one. Whenever we change the content of any of such files,
> > > > build system is not able to recognize them. Hence the easiest way is to
> > > > force DSDT rebuild each time we run make.
> >
> > > Ick. Since it uses #include, doesn't the dependency generation work with this?
> >
> > How?
> 
> If you do a sandbox build you will see this file:
> 
> arch/sandbox/dts/.sandbox.dtb.cmd
> 
> It contains the dependencies used to compile the device tree. Can we
> use the same mechanism? There is a .cmd file for the dsdt file but it
> does not seem to have the correct contents.

A spent more than couple of hours to fight with `make` and failed.
Maybe you can improve the below (it still rebuilds always)

From 2fa93fdc376b60c69ff1a2e9ffd16d30702c6399 Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Wed, 20 Oct 2021 15:21:49 +0300
Subject: [PATCH 1/1] Makefile.lib: Always rebuild DSDT

The dsdt.asl is usually combined out of several files that are included
in the main one. Whenever we change the content of any of such files,
build system is not able to recognize them. Hence the easiest way is to
force DSDT rebuild each time we run make.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 scripts/Makefile.lib | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ac270844c2e1..939f99dee9f9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -432,16 +432,21 @@ CFLAGS_REMOVE_efi_freestanding.o := $(LTO_CFLAGS)
 # renamed to dsdt.c for consumption by the build system.
 ASL_TMP = $(patsubst %.c,%.asl.tmp,$@)
 
+asl_cpp_flags  = -Wp,-MD,$(depfile) -nostdinc                   \
+		 $(UBOOTINCLUDE)                                \
+		 -I$(srctree)/include                           \
+		 -D__ASSEMBLY__                                 \
+		 -undef -D__ACPI__
+
 quiet_cmd_acpi_c_asl= ASL     $<
 cmd_acpi_c_asl=         \
-	$(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -D__ACPI__ \
-		-P $(UBOOTINCLUDE) -o $(ASL_TMP) $< && \
+	$(HOSTCC) -P -E $(asl_cpp_flags) -x assembler-with-cpp -o $(ASL_TMP) $< && \
 	iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
-	mv $(patsubst %.c,%.hex,$@) $@
+	mv $(patsubst %.c,%.hex,$@) $@ && \
+	sed -i -e "s,dsdt_aml_code,AmlCode," $@
 
-$(obj)/dsdt.c:    $(src)/dsdt.asl
-	$(call cmd,acpi_c_asl)
-	$(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
+$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
+	$(call if_changed_dep,acpi_c_asl)
 
 # Bzip2
 # ---------------------------------------------------------------------------

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-25 18:52       ` Andy Shevchenko
@ 2022-03-30  9:21         ` Andy Shevchenko
  2023-11-29 10:07           ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2022-03-30  9:21 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Bin Meng, Tom Rini, Wolfgang Wallner

On Mon, Oct 25, 2021 at 09:52:45PM +0300, Andy Shevchenko wrote:
> On Mon, Oct 25, 2021 at 09:18:56AM -0600, Simon Glass wrote:
> > On Mon, 25 Oct 2021 at 01:34, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > On Sun, Oct 24, 2021 at 11:00 PM Simon Glass <sjg@chromium.org> wrote:
> > > > On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > >
> > > > > The dsdt.asl is usually combined out of several files that are included
> > > > > in the main one. Whenever we change the content of any of such files,
> > > > > build system is not able to recognize them. Hence the easiest way is to
> > > > > force DSDT rebuild each time we run make.
> > >
> > > > Ick. Since it uses #include, doesn't the dependency generation work with this?
> > >
> > > How?
> > 
> > If you do a sandbox build you will see this file:
> > 
> > arch/sandbox/dts/.sandbox.dtb.cmd
> > 
> > It contains the dependencies used to compile the device tree. Can we
> > use the same mechanism? There is a .cmd file for the dsdt file but it
> > does not seem to have the correct contents.
> 
> A spent more than couple of hours to fight with `make` and failed.
> Maybe you can improve the below (it still rebuilds always)

So, can we fix this annoying bug, please?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2022-03-30  9:21         ` Andy Shevchenko
@ 2023-11-29 10:07           ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2023-11-29 10:07 UTC (permalink / raw)
  To: Simon Glass; +Cc: U-Boot Mailing List, Bin Meng, Tom Rini, Wolfgang Wallner

On Wed, Mar 30, 2022 at 12:21:25PM +0300, Andy Shevchenko wrote:
> On Mon, Oct 25, 2021 at 09:52:45PM +0300, Andy Shevchenko wrote:
> > On Mon, Oct 25, 2021 at 09:18:56AM -0600, Simon Glass wrote:
> > > On Mon, 25 Oct 2021 at 01:34, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > > On Sun, Oct 24, 2021 at 11:00 PM Simon Glass <sjg@chromium.org> wrote:
> > > > > On Wed, 20 Oct 2021 at 06:37, Andy Shevchenko
> > > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > >
> > > > > > The dsdt.asl is usually combined out of several files that are included
> > > > > > in the main one. Whenever we change the content of any of such files,
> > > > > > build system is not able to recognize them. Hence the easiest way is to
> > > > > > force DSDT rebuild each time we run make.
> > > >
> > > > > Ick. Since it uses #include, doesn't the dependency generation work with this?
> > > >
> > > > How?
> > > 
> > > If you do a sandbox build you will see this file:
> > > 
> > > arch/sandbox/dts/.sandbox.dtb.cmd
> > > 
> > > It contains the dependencies used to compile the device tree. Can we
> > > use the same mechanism? There is a .cmd file for the dsdt file but it
> > > does not seem to have the correct contents.
> > 
> > A spent more than couple of hours to fight with `make` and failed.
> > Maybe you can improve the below (it still rebuilds always)
> 
> So, can we fix this annoying bug, please?

Any news here? If no other solution, please apply this patch.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2021-10-20 12:37 [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT Andy Shevchenko
  2021-10-24 19:53 ` Simon Glass
@ 2023-11-29 17:16 ` Heinrich Schuchardt
  2023-11-30  2:45   ` Simon Glass
  1 sibling, 1 reply; 10+ messages in thread
From: Heinrich Schuchardt @ 2023-11-29 17:16 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Bin Meng, Simon Glass, Tom Rini, Wolfgang Wallner, u-boot

On 20.10.21 14:37, Andy Shevchenko wrote:
> The dsdt.asl is usually combined out of several files that are included
> in the main one. Whenever we change the content of any of such files,
> build system is not able to recognize them. Hence the easiest way is to
> force DSDT rebuild each time we run make.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

The build process that you describe is not in our documentation.

By which defconfig is $(src)/dsdt.asl consumed? Where does it come from? 
Please, provide a reproducible example.

Would you be able to provide a documentation patch explaining how to use 
a user provided dsdt.asl file?

Best regards

Heinrich


> ---
>   scripts/Makefile.lib | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 07696e86bb54..8c3c893b398a 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -441,7 +441,7 @@ cmd_acpi_c_asl=         \
>   	iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
>   	mv $(patsubst %.c,%.hex,$@) $@
>   
> -$(obj)/dsdt.c:    $(src)/dsdt.asl
> +$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
>   	$(call cmd,acpi_c_asl)
>   	$(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
>   


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2023-11-29 17:16 ` Heinrich Schuchardt
@ 2023-11-30  2:45   ` Simon Glass
  2023-12-09 14:39     ` Heinrich Schuchardt
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Glass @ 2023-11-30  2:45 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Andy Shevchenko, Bin Meng, Tom Rini, Wolfgang Wallner, u-boot

Hi,

On Wed, 29 Nov 2023 at 10:17, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> On 20.10.21 14:37, Andy Shevchenko wrote:
> > The dsdt.asl is usually combined out of several files that are included
> > in the main one. Whenever we change the content of any of such files,
> > build system is not able to recognize them. Hence the easiest way is to
> > force DSDT rebuild each time we run make.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> The build process that you describe is not in our documentation.
>
> By which defconfig is $(src)/dsdt.asl consumed? Where does it come from?
> Please, provide a reproducible example.
>
> Would you be able to provide a documentation patch explaining how to use
> a user provided dsdt.asl file?
>
> Best regards
>
> Heinrich
>
>
> > ---
> >   scripts/Makefile.lib | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> > index 07696e86bb54..8c3c893b398a 100644
> > --- a/scripts/Makefile.lib
> > +++ b/scripts/Makefile.lib
> > @@ -441,7 +441,7 @@ cmd_acpi_c_asl=         \
> >       iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
> >       mv $(patsubst %.c,%.hex,$@) $@
> >
> > -$(obj)/dsdt.c:    $(src)/dsdt.asl
> > +$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
> >       $(call cmd,acpi_c_asl)
> >       $(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
> >
>

I agree that this patch is better than having the bug. But yes the
docs could really use some notes here, for the person who does come
along and clean up the dependency bug.

Regards,
Simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT
  2023-11-30  2:45   ` Simon Glass
@ 2023-12-09 14:39     ` Heinrich Schuchardt
  0 siblings, 0 replies; 10+ messages in thread
From: Heinrich Schuchardt @ 2023-12-09 14:39 UTC (permalink / raw)
  To: Simon Glass; +Cc: Andy Shevchenko, Bin Meng, Tom Rini, Wolfgang Wallner, u-boot

On 11/30/23 03:45, Simon Glass wrote:
> Hi,
>
> On Wed, 29 Nov 2023 at 10:17, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> On 20.10.21 14:37, Andy Shevchenko wrote:
>>> The dsdt.asl is usually combined out of several files that are included
>>> in the main one. Whenever we change the content of any of such files,
>>> build system is not able to recognize them. Hence the easiest way is to
>>> force DSDT rebuild each time we run make.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> The build process that you describe is not in our documentation.
>>
>> By which defconfig is $(src)/dsdt.asl consumed? Where does it come from?
>> Please, provide a reproducible example.
>>
>> Would you be able to provide a documentation patch explaining how to use
>> a user provided dsdt.asl file?
>>
>> Best regards
>>
>> Heinrich
>>
>>
>>> ---
>>>    scripts/Makefile.lib | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>>> index 07696e86bb54..8c3c893b398a 100644
>>> --- a/scripts/Makefile.lib
>>> +++ b/scripts/Makefile.lib
>>> @@ -441,7 +441,7 @@ cmd_acpi_c_asl=         \
>>>        iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
>>>        mv $(patsubst %.c,%.hex,$@) $@
>>>
>>> -$(obj)/dsdt.c:    $(src)/dsdt.asl
>>> +$(obj)/dsdt.c:    $(src)/dsdt.asl FORCE
>>>        $(call cmd,acpi_c_asl)
>>>        $(Q)sed -i -e "s,dsdt_aml_code,AmlCode," $@
>>>
>>
>
> I agree that this patch is better than having the bug. But yes the
> docs could really use some notes here, for the person who does come
> along and clean up the dependency bug.
>
> Regards,
> Simon

The patch is neither applicable to origin/next nor to origin/master.

I only find a line

$(obj)/dsdt_generated.c:    $(src)/dsdt.asl

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-09 14:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 12:37 [PATCH v1 1/1] Makefile.lib: Always rebuild DSDT Andy Shevchenko
2021-10-24 19:53 ` Simon Glass
2021-10-25  7:33   ` Andy Shevchenko
2021-10-25 15:18     ` Simon Glass
2021-10-25 18:52       ` Andy Shevchenko
2022-03-30  9:21         ` Andy Shevchenko
2023-11-29 10:07           ` Andy Shevchenko
2023-11-29 17:16 ` Heinrich Schuchardt
2023-11-30  2:45   ` Simon Glass
2023-12-09 14:39     ` Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.