diff mbox

[U-Boot,v2] Pass empty CFLAGS on invocation of libfdt/setup.py

Message ID 1489703035-25076-1-git-send-email-jcmvbkbc@gmail.com
State Accepted
Commit e5caec9a8626da42ad71e10893c6cf5b671c3487
Delegated to: Tom Rini
Headers show

Commit Message

Max Filippov March 16, 2017, 10:23 p.m. UTC
When building u-boot tools in cross-build environment CFLAGS environment
variable set up for target is taken into an account when building code
for host. Make it empty on invocation of python.

This fixes the following build errors when cross-compiling for xtensa:

  cc1: error: unrecognized command line option "-mlongcalls"
  cc1: error: unrecognized command line option "-mauto-litpools"

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Changes v1->v2:
- remove "" after CFLAGS=

 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini March 17, 2017, 7:45 p.m. UTC | #1
On Thu, Mar 16, 2017 at 03:23:55PM -0700, Max Filippov wrote:

> When building u-boot tools in cross-build environment CFLAGS environment
> variable set up for target is taken into an account when building code
> for host. Make it empty on invocation of python.
> 
> This fixes the following build errors when cross-compiling for xtensa:
> 
>   cc1: error: unrecognized command line option "-mlongcalls"
>   cc1: error: unrecognized command line option "-mauto-litpools"
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini March 21, 2017, 6:09 p.m. UTC | #2
On Thu, Mar 16, 2017 at 03:23:55PM -0700, Max Filippov wrote:

> When building u-boot tools in cross-build environment CFLAGS environment
> variable set up for target is taken into an account when building code
> for host. Make it empty on invocation of python.
> 
> This fixes the following build errors when cross-compiling for xtensa:
> 
>   cc1: error: unrecognized command line option "-mlongcalls"
>   cc1: error: unrecognized command line option "-mauto-litpools"
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/Makefile b/tools/Makefile
index 1c840d7..f3de657 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -120,7 +120,7 @@  _libfdt.so-sharedobjs += $(LIBFDT_OBJS)
 libfdt:
 
 tools/_libfdt.so: $(patsubst %.o,%.c,$(LIBFDT_OBJS)) tools/libfdt_wrap.c
-	LDFLAGS="$(HOSTLDFLAGS)" python $(srctree)/lib/libfdt/setup.py \
+	LDFLAGS="$(HOSTLDFLAGS)" CFLAGS= python $(srctree)/lib/libfdt/setup.py \
 		"$(_hostc_flags)" $^
 	mv _libfdt.so $@