From: Jelle van der Waa <jelle@vdwaa.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] Compile v2017.03 on a system where Python 3 is default
Date: Thu, 30 Mar 2017 19:54:26 +0200 [thread overview]
Message-ID: <20170330175425.GA1507@gmail.com> (raw)
In-Reply-To: <8abb0873e2fb0becb73822332eb2f814@agner.ch>
On 03/28/17 at 05:30pm, Stefan Agner wrote:
> Hi,
>
> When I try to compile U-Boot on my Arch Linux system I get the following
Python 3 needs some more TLC, I've been hacking on making binman work
out of the box with Python 3 (and retaining Python 2 compatibility). But
haven't been able to get it working yet. [1]
[1] https://github.com/jelly/u-boot/commits/binman_py3
> error:
>
> LDFLAGS="" python ./lib/libfdt/setup.py \
> "-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -include
> ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include
> -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
> -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c
> lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c
> lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
> mv _libfdt.so tools/_libfdt.so
> mv: cannot stat '_libfdt.so': No such file or directory
> make[1]: *** [tools/Makefile:124: tools/_libfdt.so] Error 1
> make: *** [Makefile:1229: tools] Error 2
>
>
> As far as I can tell the issue is that python defaults on my system to
> python 3:
> $ python --version
> Python 3.6.0
>
> I can fix the issue by explicitly ask for python2, not sure if that is
> the proper way to fix this though:
>
> diff --git a/tools/Makefile b/tools/Makefile
> index 1c840d7ae2..c5e422edf9 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)" python2 $(srctree)/lib/libfdt/setup.py
> \
> "$(_hostc_flags)" $^
> mv _libfdt.so $@
>
>
> It works, but with warnings:
> LDFLAGS="" python2 ./lib/libfdt/setup.py \
> "-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -include
> ./include/libfdt_env.h -idirafterinclude -idirafter./arch/arm/include
> -I./lib/libfdt -I./tools -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
> -D_GNU_SOURCE " lib/libfdt/fdt.c lib/libfdt/fdt_ro.c lib/libfdt/fdt_rw.c
> lib/libfdt/fdt_strerror.c lib/libfdt/fdt_wip.c lib/libfdt/fdt_region.c
> lib/libfdt/fdt_sw.c tools/libfdt_wrap.c
> In file included from /usr/include/python2.7/Python.h:8:0,
> from tools/libfdt_wrap.c:149:
> /usr/include/python2.7/pyconfig.h:1190:0: warning: "_POSIX_C_SOURCE"
> redefined
> #define _POSIX_C_SOURCE 200112L
>
> In file included from /usr/include/stdint.h:25:0,
> from
> /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include/stdint.h:9,
> from ././include/compiler.h:19,
> from ././include/libfdt_env.h:12,
> from <command-line>:0:
> /usr/include/features.h:225:0: note: this is the location of the
> previous definition
> # define _POSIX_C_SOURCE 200809L
>
> In file included from /usr/include/python2.7/Python.h:8:0,
> from tools/libfdt_wrap.c:149:
> /usr/include/python2.7/pyconfig.h:1212:0: warning: "_XOPEN_SOURCE"
> redefined
> #define _XOPEN_SOURCE 600
>
> In file included from /usr/include/stdint.h:25:0,
> from
> /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include/stdint.h:9,
> from ././include/compiler.h:19,
> from ././include/libfdt_env.h:12,
> from <command-line>:0:
> /usr/include/features.h:166:0: note: this is the location of the
> previous definition
> # define _XOPEN_SOURCE 700
>
> mv _libfdt.so tools/_libfdt.so
> HOSTCC tools/proftool
> ...
>
>
> --
> Stefan
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
--
Jelle van der Waa
next prev parent reply other threads:[~2017-03-30 17:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 0:30 [U-Boot] Compile v2017.03 on a system where Python 3 is default Stefan Agner
2017-03-30 17:54 ` Jelle van der Waa [this message]
2017-03-30 18:55 ` Stefan Agner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170330175425.GA1507@gmail.com \
--to=jelle@vdwaa.nl \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.