All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py
@ 2017-03-16 18:38 Max Filippov
  2017-03-16 21:11 ` Tom Rini
  2017-03-16 22:06 ` Simon Glass
  0 siblings, 2 replies; 4+ messages in thread
From: Max Filippov @ 2017-03-16 18:38 UTC (permalink / raw)
  To: u-boot

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. Set it to 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>
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 1c840d7..c224e8a 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 $@
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py
  2017-03-16 18:38 [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py Max Filippov
@ 2017-03-16 21:11 ` Tom Rini
  2017-03-16 21:56   ` Max Filippov
  2017-03-16 22:06 ` Simon Glass
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Rini @ 2017-03-16 21:11 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 16, 2017 at 11:38:00AM -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. Set it to 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>
> ---
>  tools/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 1c840d7..c224e8a 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 \

I think we need to be passing in HOSTCFLAGS or we'll end up being broken
on certain other cases (which are broken today I suspect).  Can you test
that out?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170316/4d52fc2b/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py
  2017-03-16 21:11 ` Tom Rini
@ 2017-03-16 21:56   ` Max Filippov
  0 siblings, 0 replies; 4+ messages in thread
From: Max Filippov @ 2017-03-16 21:56 UTC (permalink / raw)
  To: u-boot

On Thu, Mar 16, 2017 at 2:11 PM, Tom Rini <trini@konsulko.com> wrote:
> On Thu, Mar 16, 2017 at 11:38:00AM -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. Set it to 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>
>> ---
>>  tools/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/Makefile b/tools/Makefile
>> index 1c840d7..c224e8a 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 \
>
> I think we need to be passing in HOSTCFLAGS or we'll end up being broken
> on certain other cases (which are broken today I suspect).

I believe that the $(_hostc_flags) in the next line is meant to do exactly that.
There's code in the lib/libfdt/setup.py that uses that parameter.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py
  2017-03-16 18:38 [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py Max Filippov
  2017-03-16 21:11 ` Tom Rini
@ 2017-03-16 22:06 ` Simon Glass
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Glass @ 2017-03-16 22:06 UTC (permalink / raw)
  To: u-boot

Hi Max,

On 16 March 2017 at 12:38, Max Filippov <jcmvbkbc@gmail.com> 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. Set it to 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>
> ---
>  tools/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Please see below

>
> diff --git a/tools/Makefile b/tools/Makefile
> index 1c840d7..c224e8a 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 \

Can we drop the "" ?

>                 "$(_hostc_flags)" $^
>         mv _libfdt.so $@
>
> --
> 2.1.4
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-16 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 18:38 [U-Boot] [PATCH] Pass empty CFLAGS on invocation of libfdt/setup.py Max Filippov
2017-03-16 21:11 ` Tom Rini
2017-03-16 21:56   ` Max Filippov
2017-03-16 22:06 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.