OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Nathaniel Wesley Filardo - 28.03.2017

FS#659 - uboot-kirkwood (at least) fails to build if swig is installed but python headers are not available

Building LEDE head (reboot-3906-g2a2dfb2be7) on a machine without python development headers but with swig in $PATH yields

  HOSTLD  tools/dumpimage
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkimage
swig -python -o tools/libfdt_wrap.c lib/libfdt/libfdt.swig
LDFLAGS="" python ./lib/libfdt/ \
        "-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
tools/libfdt_wrap.c:130:21: fatal error: Python.h: No such file or directory
 # include <Python.h>
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
tools/Makefile:123: recipe for target 'tools/' failed
make[5]: *** [tools/] Error 1
Makefile:1229: recipe for target 'tools' failed
make[4]: *** [tools] Error 2
make[4]: Leaving directory '/tank/openwrt/scratch/builder-nwftest/build_dir/target-arm_xscale_musl_eabi/u-boot-pogo_v4/u-boot-2017.03'

As I don’t believe there are any in-tree consumers of the python libfdt bindings, adding the following patch file, which just removes the test for swig and therefore acts as if it is never present, should do the right thing:

$ cat package/boot/uboot-kirkwood/patches/201-no-python-fdt.patch 
--- u-boot-2017.03/tools/Makefile.orig	2017-03-28 03:11:34.081325904 +0000
+++ u-boot-2017.03/tools/Makefile	2017-03-28 03:13:09.225349051 +0000
@@ -112,10 +112,6 @@
 fit_info-objs   := $(dumpimage-mkimage-objs) fit_info.o
 fit_check_sign-objs   := $(dumpimage-mkimage-objs) fit_check_sign.o
-# Build a libfdt Python module if swig is available
-# Use 'sudo apt-get install swig libpython-dev' to enable this
-hostprogs-y += \
-	$(if $(shell which swig 2> /dev/null), += $(LIBFDT_OBJS)
Nathaniel Wesley Filardo commented on 28.03.2017 03:26

Sorry, the git commit mentioned has some of my (unrelated) patches atop it. Upstream is reboot-3883-g2ebfdabfbd


Available keyboard shortcuts


Task Details

Task Editing