diff mbox series

[1/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain

Message ID 20211220162925.14441-2-ysionneau@kalray.eu (mailing list archive)
State New, archived
Headers show
Series Use target CPP to pre-process dts as supported flag checks are done on target toolchain | expand

Commit Message

Yann Sionneau Dec. 20, 2021, 4:29 p.m. UTC
If some flag is not supported by host toolchain but is supported by target toolchain, then
using host toolchain will fail here because the checks are only done on target toolchain.

Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada Dec. 21, 2021, 11:10 p.m. UTC | #1
On Tue, Dec 21, 2021 at 1:36 AM Yann Sionneau <ysionneau@kalray.eu> wrote:
>
> If some flag is not supported by host toolchain but is supported by target toolchain, then
> using host toolchain will fail here because the checks are only done on target toolchain.


Then,
some flag is not supported by target toolchain but is supported by
host toolchain


> Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
> ---
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 94133708889d..1d11b7a23957 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -316,7 +316,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
>         $(call if_changed,dt_S_dtb)
>
>  quiet_cmd_dtc = DTC     $@
> -cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
> +cmd_dtc = $(CC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \

This change is not sensible at all.


This is a partial revert of the following:

commit 37c8a5fafa3bb7dcdd51774be353be6cb2912b86
Author: Rob Herring <robh@kernel.org>
Date:   Wed Jan 10 15:19:37 2018 -0600

    kbuild: consolidate Devicetree dtb build rules





>         $(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \
>                 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
>                 -d $(depfile).dtc.tmp $(dtc-tmp) ; \
> --
> 2.17.1
>
Rob Herring Dec. 21, 2021, 11:30 p.m. UTC | #2
On Mon, Dec 20, 2021 at 12:29 PM Yann Sionneau <ysionneau@kalray.eu> wrote:
>
> If some flag is not supported by host toolchain but is supported by target toolchain, then
> using host toolchain will fail here because the checks are only done on target toolchain.
>
> Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
> ---
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 94133708889d..1d11b7a23957 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -316,7 +316,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
>         $(call if_changed,dt_S_dtb)
>
>  quiet_cmd_dtc = DTC     $@
> -cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
> +cmd_dtc = $(CC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \

The host toolchain is used so that we don't have to have cross
compiler for every last arch.

Rob
diff mbox series

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 94133708889d..1d11b7a23957 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -316,7 +316,7 @@  $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
 	$(call if_changed,dt_S_dtb)
 
 quiet_cmd_dtc = DTC     $@
-cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+cmd_dtc = $(CC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
 	$(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \
 		$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \