All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain
@ 2021-12-20 16:29 Yann Sionneau
  2021-12-20 16:29 ` [PATCH 1/1] " Yann Sionneau
  2021-12-21 23:08 ` [PATCH 0/1] " Masahiro Yamada
  0 siblings, 2 replies; 5+ messages in thread
From: Yann Sionneau @ 2021-12-20 16:29 UTC (permalink / raw)
  To: linux-kbuild; +Cc: ysionneau, robh

Hello, 

I have encountered an issue with the following setup: 
* host toolchain gcc 7.5.0 (Ubuntu 18.04 LTS)
* target toolchain gcc 9.4.1

In this case I got build error while compiling DTBs because of the following flag: -fmacro-prefix-map
This flag was known to my target toolchain (CC) but not by my HOSTCC.
One might say that Ubuntu 18.04 is pretty old and I should upgrade but I think it's fundamentally broken to check flags on toolchain A and use them on toolchain B. We could have other issues like this in the future.
I'm proposing this change to open the discussion.
Regards, 

Yann Sionneau (1):
  Use target CPP to pre-process dts as supported flag checks are done on
    target toolchain

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1


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

* [PATCH 1/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain
  2021-12-20 16:29 [PATCH 0/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain Yann Sionneau
@ 2021-12-20 16:29 ` Yann Sionneau
  2021-12-21 23:10   ` Masahiro Yamada
  2021-12-21 23:30   ` Rob Herring
  2021-12-21 23:08 ` [PATCH 0/1] " Masahiro Yamada
  1 sibling, 2 replies; 5+ messages in thread
From: Yann Sionneau @ 2021-12-20 16:29 UTC (permalink / raw)
  To: linux-kbuild; +Cc: ysionneau, robh

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) $< ; \
 	$(DTC) -O $(patsubst .%,%,$(suffix $@)) -o $@ -b 0 \
 		$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
-- 
2.17.1


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

* Re: [PATCH 0/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain
  2021-12-20 16:29 [PATCH 0/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain Yann Sionneau
  2021-12-20 16:29 ` [PATCH 1/1] " Yann Sionneau
@ 2021-12-21 23:08 ` Masahiro Yamada
  1 sibling, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-12-21 23:08 UTC (permalink / raw)
  To: Yann Sionneau; +Cc: Linux Kbuild mailing list, Rob Herring

On Tue, Dec 21, 2021 at 1:37 AM Yann Sionneau <ysionneau@kalray.eu> wrote:
>
> Hello,
>
> I have encountered an issue with the following setup:
> * host toolchain gcc 7.5.0 (Ubuntu 18.04 LTS)
> * target toolchain gcc 9.4.1
>
> In this case I got build error while compiling DTBs because of the following flag: -fmacro-prefix-map

-fmacro-prefix-map is never used for compiling DTBs.

If it is, it is a bug.
But, I do not see such a case.



> This flag was known to my target toolchain (CC) but not by my HOSTCC.
> One might say that Ubuntu 18.04 is pretty old and I should upgrade but I think it's fundamentally broken to check flags on toolchain A and use them on toolchain B. We could have other issues like this in the future.
> I'm proposing this change to open the discussion.
> Regards,
>
> Yann Sionneau (1):
>   Use target CPP to pre-process dts as supported flag checks are done on
>     target toolchain
>
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH 1/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain
  2021-12-20 16:29 ` [PATCH 1/1] " Yann Sionneau
@ 2021-12-21 23:10   ` Masahiro Yamada
  2021-12-21 23:30   ` Rob Herring
  1 sibling, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-12-21 23:10 UTC (permalink / raw)
  To: Yann Sionneau; +Cc: Linux Kbuild mailing list, Rob Herring

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
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH 1/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain
  2021-12-20 16:29 ` [PATCH 1/1] " Yann Sionneau
  2021-12-21 23:10   ` Masahiro Yamada
@ 2021-12-21 23:30   ` Rob Herring
  1 sibling, 0 replies; 5+ messages in thread
From: Rob Herring @ 2021-12-21 23:30 UTC (permalink / raw)
  To: Yann Sionneau; +Cc: Linux Kbuild mailing list

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

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

end of thread, other threads:[~2021-12-21 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 16:29 [PATCH 0/1] Use target CPP to pre-process dts as supported flag checks are done on target toolchain Yann Sionneau
2021-12-20 16:29 ` [PATCH 1/1] " Yann Sionneau
2021-12-21 23:10   ` Masahiro Yamada
2021-12-21 23:30   ` Rob Herring
2021-12-21 23:08 ` [PATCH 0/1] " Masahiro Yamada

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.