Problem building OpenWrt 19.07

Hello guys,

I'm trying to build an OpenWRT 19.07 from the sources and I am having the following error, building hostpkg libxslt:

touch /home/ubuntu/v1.3.x/openwrt_main/build_dir/hostpkg/libxslt-1.1.34/.preparedd0d740d3a6a6874c8ff4bfa4c6a2412f_6664517399ebbbc92a37c5bb081b5c53
(cd /home/ubuntu/v1.3.x/openwrt_main/build_dir/hostpkg/libxslt-1.1.34/; if [ -x configure ]; then cp -fpR /home/ubuntu/v1.3.x/openwrt_main/scripts/config.{guess,sub} /home/ubuntu/v1.3.x/openwrt_main/build_dir/hostpkg/libxslt-1.1.34// && CC="gcc" CFLAGS="-O2 -I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/include -I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/include -I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/target-arm_cortex-a9+neon_musl_eabi/host/include" CXX="g++" CPPFLAGS="-I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/include -I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/include -I/home/ubuntu/v1.3.x/openwrt_main/staging_dir/target-arm_cortex-a9+neon_musl_eabi/host/include" LDFLAGS="-L/home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/lib -L/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/lib -L/home/ubuntu/v1.3.x/openwrt_main/staging_dir/target-arm_cortex-a9+neon_musl_eabi/host/lib" CONFIG_SHELL="/usr/bin/env bash"  bash ./configure --target=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg --exec-prefix=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg --sysconfdir=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/etc --localstatedir=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/var --sbindir=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/bin --with-libxml-prefix=/home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/bin/ --without-python --without-crypto --without-debug --without-mem-debug --without-debugger --without-profiler --without-plugins ; fi )
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/bin/grep
checking for egrep... /home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for x86_64-pc-linux-gnu-gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for xmllint... /home/ubuntu/v1.3.x/openwrt_main/staging_dir/hostpkg/bin/xmllint
checking for xsltproc... /usr/bin/xsltproc
checking pkg-config is at least version 0.9.0... yes
checking for ANSI C header files... (cached) yes
checking how to print strings... printf
checking for a sed that does not truncate output... /home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/bin/sed
checking for fgrep... /home/ubuntu/v1.3.x/openwrt_main/staging_dir/host/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for x86_64-pc-linux-gnu-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-pc-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-pc-linux-gnu-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-pc-linux-gnu-strip... no
checking for strip... strip
checking for x86_64-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for x86_64-pc-linux-gnu-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for string.h... (cached) yes
checking how to pass version script to the linker (/usr/bin/ld -m elf_x86_64)... -Wl,--version-script=
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_join in -lpthread... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking xlocale.h usability... no
checking xlocale.h presence... no
checking for xlocale.h... no
checking for strxfrm_l... yes
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking nan.h usability... no
checking nan.h presence... no
checking for nan.h... no
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for sys/stat.h... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for stat... yes
checking for _stat... no
checking for pow... no
checking for pow in -lm... yes
checking for floor... no
checking for floor in -lm... yes
checking for fabs... no
checking for fabs in -lm... yes
checking for gettimeofday... yes
checking for localtime... yes
checking for localtime_r... yes
checking for time... yes
checking for gmtime... yes
checking for gmtime_r... yes
checking for ftime... yes
checking for printf... yes
checking for sprintf... yes
checking for fprintf... yes
checking for snprintf... yes
checking for vfprintf... yes
checking for vsprintf... yes
checking for vsnprintf... yes
checking for sscanf... yes
checking for clock_gettime... yes
checking for perl... perl
Disabling crypto support
Disabling debug support
Disabling debugger
Disabling profiler
checking for x86_64-pc-linux-gnu-xml2-config... no
checking for xml2-config... no
configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/.
Makefile:165: recipe for target '/home/ubuntu/v1.3.x/openwrt_main/build_dir/hostpkg/libxslt-1.1.34/.configured' failed
make[3]: *** [/home/ubuntu/v1.3.x/openwrt_main/build_dir/hostpkg/libxslt-1.1.34/.configured] Error 1
make[3]: Leaving directory '/home/ubuntu/v1.3.x/openwrt_main/feeds/packages/libs/libxslt'
time: package/feeds/packages/libxslt/host-compile#1.76#0.56#2.68
package/Makefile:111: recipe for target 'package/feeds/packages/libxslt/host/compile' failed
make[2]: *** [package/feeds/packages/libxslt/host/compile] Error 2
make[2]: Leaving directory '/home/ubuntu/v1.3.x/openwrt_main'
package/Makefile:107: recipe for target '/home/ubuntu/v1.3.x/openwrt_main/staging_dir/target-arm_cortex-a9+neon_musl_eabi/stamp/.package_compile' failed
make[1]: *** [/home/ubuntu/v1.3.x/openwrt_main/staging_dir/target-arm_cortex-a9+neon_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/ubuntu/v1.3.x/openwrt_main'
/home/ubuntu/v1.3.x/openwrt_main/include/toplevel.mk:225: recipe for target 'world' failed
make: *** [world] Error 2

I checked on my machine and both xml2-config and x86_64-pc-linux-gnu-xml2-config are available. The first in PATH. The second in STAGING_DIR.

Here is my setup:

  • Operating System: Ubuntu 18.04
  • OpenWRT version: 19.07 from github source branch
  • Neither libxml2 nor libxslt are set to be installed on target

And here are my questions?

  • Does anybody knows how to solve it?
  • Why this hostpkg is built and is there any way to avoid this build?

I am available to provide more details.

Best regards,

Flavio

While that looks like missing build dependencies, you need to be aware that openwr-19.07 is EOL, if it breaks, it stays broken.

1 Like

Hi @slh ,

Thank you for your response.

Where in the code I should check this?

Best regards,

Flavio

This error was caused by the package modem-manager added on the image.

Removing this package, the build completes.

But ... I need to have modem-manager on my image. So I need to figure out how to solve this.

Did you fix it? On my snapshot build, this was caused by me updating my operating system. I had to rebuild the development environment, now it's working again.

Edit: Sorry, no, it doesn't work with rebuilding the whole environment - I forgot to select ModemManager when recompiling. I'm still having the same issue with a rather recent snapshot build.

Hi,

Yes, I solved this issue. I got a new libxslt build instructions from a newer OpenWRT of the repository.

Then it worked with modem-manager too.

Yeah, mine is caused by the move of libxml2 (build dependency) from the package feed to the base directory.

That should get cleared if you delete tmp/ with the semi-hidden package databases in .package*

Moving packages from one repo to another practically always requires

  • feeds update & install,
  • deleting /tmp, and then
  • rebuilding the database with one more round of feeds update.

While you're right, my problem was a mismatch of the openwrt repository and the package repository. My openwrt checkout was a few weeks old where the package libxml2 was part of the package repository while it is now part of the openwrt git repository.

Yeah, naturally you need coherent repos.