[U-Boot] [PATCH v2] x86: Avoid writing temporary asl files into the source tree

Bin Meng bmeng.cn at gmail.com
Thu Jul 25 09:47:34 UTC 2019


Hi Simon,

On Thu, Jul 11, 2019 at 3:41 AM Simon Glass <sjg at chromium.org> wrote:
>
> At present the iasl tool (Intel ACPI (Advanced Configuration and Power
> Interface) Source Language compiler) is called in such a way that it uses
> the source directory for its temporary files.
>
> This means we end up with these files when building x86 boards:
>
>    board/dfi/dfi-bt700/dsdt.aml
>    board/dfi/dfi-bt700/dsdt.asl.tmp
>
> Update the code to put temporary files in the target directory instead.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2:
> - Use dsdt.tmp.c as the temporary filename instead of dsdt.c.tmp
> - Remove this file with distclean
>
>  Makefile             | 1 +
>  scripts/Makefile.lib | 8 +++++---
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 516260f46d0..e9ff14f3405 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1846,6 +1846,7 @@ clean: $(clean-dirs)
>                 -o -name '*.symtypes' -o -name 'modules.order' \
>                 -o -name modules.builtin -o -name '.tmp_*.o.*' \
>                 -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
> +               -o -name 'dsdt.tmp.c' \

Can we reuse the dsdt.asl.tmp? dsdt.tmp.c still looks weird because
it's actually ASL file, not C file. See below.

>                 -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
>                 -type f -print | xargs rm -f \
>                 bl31.c bl31.elf bl31_*.bin image.map
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index de67677f61a..59c8cf38f94 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -397,9 +397,11 @@ $(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_free
>  # ---------------------------------------------------------------------------
>  quiet_cmd_acpi_c_asl= ASL     $<
>  cmd_acpi_c_asl=         \
> -       $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) -o $<.tmp $<; \
> -       iasl -p $< -tc $<.tmp $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
> -       mv $(patsubst %.asl,%.hex,$<) $@
> +       $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) \
> +               -o $(patsubst %.c,%.tmp.c,$@) $< && \

(patsubst %.c,%.asl.tmp,$@) so we can reuse dsdt.asl.tmp

> +       iasl -p $@ -tc $(patsubst %.c,%.tmp.c,$@) \

Ditto

> +               $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
> +       mv $(patsubst %.c,%.hex,$@) $@
>
>  $(obj)/dsdt.c:    $(src)/dsdt.asl
>         $(call cmd,acpi_c_asl)
> --

Regards,
Bin


More information about the U-Boot mailing list