mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
tools: fix cross-compiling tools when HOSTCC is overridden
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>
This commit is contained in:
parent
433cbfb3b3
commit
3b0825296a
2 changed files with 2 additions and 2 deletions
|
@ -262,7 +262,7 @@ $(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP)
|
||||||
subdir- += env
|
subdir- += env
|
||||||
|
|
||||||
ifneq ($(CROSS_BUILD_TOOLS),)
|
ifneq ($(CROSS_BUILD_TOOLS),)
|
||||||
HOSTCC = $(CC)
|
override HOSTCC = $(CC)
|
||||||
|
|
||||||
quiet_cmd_crosstools_strip = STRIP $^
|
quiet_cmd_crosstools_strip = STRIP $^
|
||||||
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
||||||
|
|
2
tools/env/Makefile
vendored
2
tools/env/Makefile
vendored
|
@ -8,7 +8,7 @@
|
||||||
# fw_printenv is supposed to run on the target system, which means it should be
|
# 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"
|
# 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.
|
# 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
|
# Compile for a hosted environment on the target
|
||||||
HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
||||||
|
|
Loading…
Reference in a new issue