All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden
@ 2017-03-13  8:43 Masahiro Yamada
  2017-03-13  8:49 ` Masahiro Yamada
  2017-03-16 20:41 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-03-13  8:43 UTC (permalink / raw)
  To: u-boot

Richard reported U-Boot tools issues in OpenEmbedded/Yocto project.

OE needs to be able to change the default compiler. If we pass in
HOSTCC through the make command, it overwrites all HOSTCC instances,
including ones in tools/Makefile and tools/env/Makefile, which breaks
"make cross_tools" and "make env", respectively.

Add "override" directives to avoid overriding HOSTCC instances that
really need to point to the cross-compiler.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

 tools/Makefile     | 2 +-
 tools/env/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 1c840d7..a894b5c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -262,7 +262,7 @@ $(LOGO_DATA_H):	$(obj)/bmp_logo $(LOGO_BMP)
 subdir- += env
 
 ifneq ($(CROSS_BUILD_TOOLS),)
-HOSTCC = $(CC)
+override HOSTCC = $(CC)
 
 quiet_cmd_crosstools_strip = STRIP   $^
       cmd_crosstools_strip = $(STRIP) $^; touch $@
diff --git a/tools/env/Makefile b/tools/env/Makefile
index 38ad118..95b28c0 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -8,7 +8,7 @@
 # fw_printenv is supposed to run on the target system, which means it should be
 # built with cross tools. Although it may look weird, we only replace "HOSTCC"
 # with "CC" here for the maximum code reuse of scripts/Makefile.host.
-HOSTCC = $(CC)
+override HOSTCC = $(CC)
 
 # Compile for a hosted environment on the target
 HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
-- 
2.7.4

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

* [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden
  2017-03-13  8:43 [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden Masahiro Yamada
@ 2017-03-13  8:49 ` Masahiro Yamada
  2017-03-13 13:24   ` Simon Glass
  2017-03-16 20:41 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2017-03-13  8:49 UTC (permalink / raw)
  To: u-boot

+CC Richard
+CC Marek

2017-03-13 17:43 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Richard reported U-Boot tools issues in OpenEmbedded/Yocto project.
>
> OE needs to be able to change the default compiler. If we pass in
> HOSTCC through the make command, it overwrites all HOSTCC instances,
> including ones in tools/Makefile and tools/env/Makefile, which breaks
> "make cross_tools" and "make env", respectively.
>
> Add "override" directives to avoid overriding HOSTCC instances that
> really need to point to the cross-compiler.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>
>  tools/Makefile     | 2 +-
>  tools/env/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/Makefile b/tools/Makefile
> index 1c840d7..a894b5c 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -262,7 +262,7 @@ $(LOGO_DATA_H):     $(obj)/bmp_logo $(LOGO_BMP)
>  subdir- += env
>
>  ifneq ($(CROSS_BUILD_TOOLS),)
> -HOSTCC = $(CC)
> +override HOSTCC = $(CC)
>
>  quiet_cmd_crosstools_strip = STRIP   $^
>        cmd_crosstools_strip = $(STRIP) $^; touch $@
> diff --git a/tools/env/Makefile b/tools/env/Makefile
> index 38ad118..95b28c0 100644
> --- a/tools/env/Makefile
> +++ b/tools/env/Makefile
> @@ -8,7 +8,7 @@
>  # fw_printenv is supposed to run on the target system, which means it should be
>  # built with cross tools. Although it may look weird, we only replace "HOSTCC"
>  # with "CC" here for the maximum code reuse of scripts/Makefile.host.
> -HOSTCC = $(CC)
> +override HOSTCC = $(CC)
>
>  # Compile for a hosted environment on the target
>  HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
> --
> 2.7.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden
  2017-03-13  8:49 ` Masahiro Yamada
@ 2017-03-13 13:24   ` Simon Glass
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2017-03-13 13:24 UTC (permalink / raw)
  To: u-boot

On 13 March 2017 at 02:49, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> +CC Richard
> +CC Marek
>
> 2017-03-13 17:43 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
>> Richard reported U-Boot tools issues in OpenEmbedded/Yocto project.
>>
>> OE needs to be able to change the default compiler. If we pass in
>> HOSTCC through the make command, it overwrites all HOSTCC instances,
>> including ones in tools/Makefile and tools/env/Makefile, which breaks
>> "make cross_tools" and "make env", respectively.
>>
>> Add "override" directives to avoid overriding HOSTCC instances that
>> really need to point to the cross-compiler.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>>
>>  tools/Makefile     | 2 +-
>>  tools/env/Makefile | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] tools: fix cross-compiling tools when HOSTCC is overridden
  2017-03-13  8:43 [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden Masahiro Yamada
  2017-03-13  8:49 ` Masahiro Yamada
@ 2017-03-16 20:41 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2017-03-16 20:41 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 13, 2017 at 05:43:16PM +0900, Masahiro Yamada wrote:

> Richard reported U-Boot tools issues in OpenEmbedded/Yocto project.
> 
> OE needs to be able to change the default compiler. If we pass in
> HOSTCC through the make command, it overwrites all HOSTCC instances,
> including ones in tools/Makefile and tools/env/Makefile, which breaks
> "make cross_tools" and "make env", respectively.
> 
> Add "override" directives to avoid overriding HOSTCC instances that
> really need to point to the cross-compiler.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170316/7957f694/attachment.sig>

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

end of thread, other threads:[~2017-03-16 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13  8:43 [U-Boot] [PATCH] tools: fix cross-compiling tools when HOSTCC is overridden Masahiro Yamada
2017-03-13  8:49 ` Masahiro Yamada
2017-03-13 13:24   ` Simon Glass
2017-03-16 20:41 ` [U-Boot] " Tom Rini

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.