
Hello Daniel,
This patch makes tools/env/Makefile more similar to tools/imls:
- define HOSTSRCS and HOSTCPPFLAGS, so that .depend generation works.
- include U-Boot headers using -idirafter to prevent picking up u-boot/include/errno.h.
- use HOSTCFLAGS_NOPED (fw_env.c does not conform to -pedantic).
- use the cross compiler again (fw_printenv is intended for a hosted environment on the target).
Signed-off-by: Daniel Hobi daniel.hobi@schmid-telecom.ch Cc: Mike Frysinger vapier@gentoo.org Cc: Wolfgang Denk wd@denx.de
As this indeed fixes the cross-compilation problem:
Tested-by: Detlev Zundel dzu@denx.de
tools/env/Makefile | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
Hi Scott,
In commit d984fed0 (makefiles: fixes for building build tools), you suggest that using $(CC) with host flags (HOSTCFLAGS, etc) is the correct way to use the cross compiler to generate binaries for a hosted environment on the target.
On the other hand, you use $(HOSTCC) to generate the .depend file in rules.mk which leads to wrong dependencies.
I think we need to differentiate three cases:
(free-standing) U-Boot: use CC and CFLAGS
native tools (mkimage, etc): use HOSTCC and HOSTCFLAGS
Linux environment on the target (imls, fw_printenv):
Can we use CC and HOSTCFLAGS, or do we need a third set of variables for flags?
If reusing HOSTCFLAGS: how do we fix dependency generation?
I also don't know, but this fixes a bug, so I want the patch in ;)
Cheers Detlev