
2018-01-16 23:56 GMT+09:00 Simon Glass sjg@chromium.org:
On 9 January 2018 at 01:34, Masahiro Yamada yamada.masahiro@socionext.com wrote:
libfdt_env.h is supposed to provide system-dependent defines.
scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable for user-space, so we should use this for USE_HOSTCC case.
For compiling U-Boot, we need to override such system-dependent defines, so use <linux/libfdt_env.h> imported from Linux.
I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS. Adding all sort of stuff to the include path just for suppressing errors is a crazy idea.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com
include/libfdt_env.h | 29 +++++------------------------ tools/Makefile | 2 +- 2 files changed, 6 insertions(+), 25 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
I'm not really sure why we want to use linux/libfdt.h though... Can you add some details in the patch?
I just borrowed as much code from Linux as possible.
This is successful in most cases. I trust kernel developers.
<linux/libfdt_env.h> contains environments for the target board.
<libfdt_env.h> selects either of them depending on USE_HOSTCC.
Maybe we can move USB_HOSTCC case to tools/ in the future, but this series makes the code much cleaner than the current one.