[U-Boot] python3 support for pylibfdt

Peter Robinson pbrobinson at gmail.com
Tue Jun 18 09:39:54 UTC 2019

Hi Simon,

With the EOL of python2 soon I've been looking at the Fedora U-Boot
builds to see what it would take to move over to python3. There's a
couple of issues building the bundled pylibfdt, the first is the
Makefile hard codes python2, the second is that the generated
libfdt_wrap.c doesn't seem to find the python3 version of Python.h
(errors below).

It seems upstream now supports building pylibfdt with dtc 1.5.0 but I
couldn't quite work out how this fits into the U-Boot bundled version.
Is there plans to be able to support pylibfdt with python3?


  gcc -O2 -g -pipe -Wall -Werror=format-security
-fstack-protector-strong -grecord-gcc-switches
-fasynchronous-unwind-tables -fstack-clash-protection  -o
scripts/dtc/dtc scripts/dtc/dtc.o scripts/dtc/flattree.o
scripts/dtc/fstree.o scripts/dtc/data.o scripts/dtc/livetree.o
scripts/dtc/treesource.o scripts/dtc/srcpos.o scripts/dtc/checks.o
scripts/dtc/util.o scripts/dtc/dtc-lexer.lex.o
BUILDSTDERR: set -e; : '  CHK
include/generated/generic-asm-offsets.h'; mkdir -p include/generated/;
(set -e; echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; echo "#define
__GENERIC_ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo
" *"; echo " * This file was generated by Kbuild";
escripts/dtc/pylibfdt/libfdt_wrap.c:154:11: fatal error: Python.h: No
such file or directory
BUILDSTDERR:   154 | # include <Python.h>
BUILDSTDERR:       |           ^~~~~~~~~~
BUILDSTDERR: compilation terminated.
BUILDSTDERR: error: command 'gcc' failed with exit status 1
BUILDSTDERR: make[4]: ***
scripts/dtc/pylibfdt/_libfdt.so] Error 1
BUILDSTDERR: make[3]: ***
scripts/dtc/pylibfdt] Error 2
BUILDSTDERR: make[2]: ***
scripts/dtc] Error 2
BUILDSTDERR: make[1]: ***
[/builddir/build/BUILD/u-boot-2019.07-rc4/Makefile:528: scripts] Error
BUILDSTDERR: make: *** [Makefile:148: sub-make] Error 2
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.Ca2SD2 (%build)

More information about the U-Boot mailing list