[U-Boot] [PATCH] tools: Makefile: improve cross_tools target usability

Masahiro Yamada yamada.masahiro at socionext.com
Sat Nov 5 18:41:12 CET 2016


Hi.

2016-10-31 22:15 GMT+09:00 Stefan Müller-Klieser <s.mueller-klieser at phytec.de>:
> When building the cross_tools target, HOSTCFLAGS and HOSTLDFLAGS will
> propagate to the target build. This should not happen and is easy to
> prevent.
>
> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser at phytec.de>
> ---
>  tools/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/Makefile b/tools/Makefile
> index 400588c..305336c 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -263,6 +263,8 @@ subdir- += env
>
>  ifneq ($(CROSS_BUILD_TOOLS),)
>  HOSTCC = $(CC)
> +HOSTCFLAGS = $(CFLAGS)
> +HOSTLDFLAGS = $(LDFLAGS)


In the current U-Boot build system (= Kbuild),
CFLAGS is never set, never referenced.

For the target build, KBUILD_CFLAGS is used instead.


So, $(CFLAGS) is always empty unless your environment
explicitly sets it.
Likewise for LDFLAGS.


Did you mean

HOSTCFLAGS =
HOSTLDFLAGS =

or

HOSTCFLAGS = $(KBUILD_CFLAGS)
HOSTLDFLAGS =

?


-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list