lede
lede copied to clipboard
ubuntu20.04 ,编译libxlts(host)不通过,提示configure: error: Could not find libxml2 anywhere,
反馈bug/问题模板,提建议请删除
1.关于你要提交的问题
Q:是否搜索了issue (使用 "x" 选择)
- 有类似issue,但均未解决
- #9744
- #9686
2. 详细叙述
ubuntu20.04 已安装readme要求的所有驱动,编译libxlts不通过,提示configure: error: Could not find libxml2 anywhere,
(1) 具体问题
A:ubuntu20.04 已安装readme要求的所有驱动,编译libxlts(host)不通过,提示configure: error: Could not find libxml2 anywhere,
编译配置: 先选上了所有包,逐个删除不需要的包,libxslt(host)取消勾选了仍需要编译
-*- Select all target specific packages by default -*- Select all kernel module packages by default [*] Select all userspace packages by default
日志
fjr@DESKTOP-C3PE1OB:~/lede$ make package/feeds/packages/libxslt/host/compile V=s time: target/linux/prereq#0.23#0.40#0.63 Checking 'rsync'... ok. make[1]: Entering directory '/home/fjr/lede' make[2]: Entering directory '/home/fjr/lede/feeds/packages/libs/libxml2' mkdir -p /home/fjr/lede/dl SHELL= flock /home/fjr/lede/tmp/.libxml2-2.9.14.tar.xz.flock -c ' /home/fjr/lede/scripts/download.pl "/home/fjr/lede/dl" "libxml2-2.9.14.tar.xz" "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" "" "@GNOME/libxml2/2.9" ' make[2]: Leaving directory '/home/fjr/lede/feeds/packages/libs/libxml2' time: package/feeds/packages/libxml2/host-compile#0.30#0.06#0.29 make[2]: Entering directory '/home/fjr/lede/feeds/packages/libs/libxslt' mkdir -p /home/fjr/lede/dl SHELL= flock /home/fjr/lede/tmp/.libxslt-1.1.34.tar.gz.flock -c ' /home/fjr/lede/scripts/download.pl "/home/fjr/lede/dl" "libxslt-1.1.34.tar.gz" "98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f" "" "http://xmlsoft.org/sources/" "ftp://fr.rpmfind.net/pub/libxml/" ' (cd /home/fjr/lede/build_dir/hostpkg/libxslt-1.1.34; rm -f aclocal.m4; if [ -f ./configure.ac ] || [ -f ./configure.in ]; then [ -d ./autom4te.cache ] && rm -rf autom4te.cache; [ -e ./config.rpath ] || ln -s /home/fjr/lede/scripts/config.rpath ./config.rpath; touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; AUTOM4TE=/home/fjr/lede/staging_dir/host/bin/autom4te AUTOCONF=/home/fjr/lede/staging_dir/host/bin/autoconf AUTOMAKE=/home/fjr/lede/staging_dir/host/bin/automake ACLOCAL=/home/fjr/lede/staging_dir/host/bin/aclocal AUTOHEADER=/home/fjr/lede/staging_dir/host/bin/autoheader LIBTOOLIZE=/home/fjr/lede/staging_dir/host/bin/libtoolize LIBTOOL=/home/fjr/lede/staging_dir/host/bin/libtool M4=/home/fjr/lede/staging_dir/host/bin/m4 AUTOPOINT=true LIBTOOLIZE='/home/fjr/lede/staging_dir/host/bin/libtoolize --install' /home/fjr/lede/staging_dir/host/bin/autoreconf -v -f -i -s -B /home/fjr/lede/staging_dir/host/share/aclocal -I m4 -I . . || true; fi; ); autoreconf: Entering directory
.' autoreconf: configure.ac: not using Gettext autoreconf: running: /home/fjr/lede/staging_dir/host/bin/aclocal -I m4 -I . --force autoreconf: configure.ac: tracing autoreconf: running: /home/fjr/lede/staging_dir/host/bin/libtoolize --install --force OpenWrt-libtoolize: putting auxiliary files in
.'. OpenWrt-libtoolize: linking file./config.guess' OpenWrt-libtoolize: linking file
./config.sub' OpenWrt-libtoolize: linking file./install-sh' OpenWrt-libtoolize: linking file
./ltmain.sh' OpenWrt-libtoolize: Consider addingAC_CONFIG_MACRO_DIR([m4])' to configure.ac and OpenWrt-libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. OpenWrt-libtoolize: Consider adding
-I m4' to ACLOCAL_AMFLAGS in Makefile.am. autoreconf: running: /home/fjr/lede/staging_dir/host/bin/autoconf --include=m4 --include=. --prepend-include=/home/fjr/lede/staging_dir/host/share/aclocal --force autoreconf: running: /home/fjr/lede/staging_dir/host/bin/autoheader --include=m4 --include=. --prepend-include=/home/fjr/lede/staging_dir/host/share/aclocal --force autoreconf: running: /home/fjr/lede/staging_dir/host/bin/automake --add-missing --force-missing autoreconf: Leaving directory `.' (cd /home/fjr/lede/build_dir/hostpkg/libxslt-1.1.34/; if [ -x configure ]; then cp -fpR /home/fjr/lede/scripts/config.{guess,sub} /home/fjr/lede/build_dir/hostpkg/libxslt-1.1.34// && CC="gcc" CFLAGS="-O2 -I/home/fjr/lede/staging_dir/host/include -I/home/fjr/lede/staging_dir/hostpkg/include -I/home/fjr/lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/host/include" CXX="g++" CPPFLAGS="-I/home/fjr/lede/staging_dir/host/include -I/home/fjr/lede/staging_dir/hostpkg/include -I/home/fjr/lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/host/include" LDFLAGS="-L/home/fjr/lede/staging_dir/host/lib -L/home/fjr/lede/staging_dir/hostpkg/lib -L/home/fjr/lede/staging_dir/target-arm_cortex-a7+neon-vfpv4_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/fjr/lede/staging_dir/hostpkg --exec-prefix=/home/fjr/lede/staging_dir/hostpkg --sysconfdir=/home/fjr/lede/staging_dir/hostpkg/etc --localstatedir=/home/fjr/lede/staging_dir/hostpkg/var --sbindir=/home/fjr/lede/staging_dir/hostpkg/bin --with-libxml-prefix=/usr/include/libxml2 --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/fjr/lede/staging_dir/host/bin/grep checking for egrep... /home/fjr/lede/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... /home/fjr/lede/staging_dir/host/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU 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/fjr/lede/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/fjr/lede/staging_dir/host/bin/sed checking for fgrep... /home/fjr/lede/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 whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes 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 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/. make[2]: *** [Makefile:167: /home/fjr/lede/build_dir/hostpkg/libxslt-1.1.34/.configured] Error 1 make[2]: Leaving directory '/home/fjr/lede/feeds/packages/libs/libxslt' time: package/feeds/packages/libxslt/host-compile#11.07#2.26#16.13 ERROR: package/feeds/packages/libxslt [host] failed to build. make[1]: *** [package/Makefile:114: package/feeds/packages/libxslt/host/compile] Error 1 make[1]: Leaving directory '/home/fjr/lede' make: *** [/home/fjr/lede/include/toplevel.mk:230: package/feeds/packages/libxslt/host/compile] Error 2
(2) 路由器型号和固件版本
hiwifi c526a 极路由x
这2个月的源码都存在这个情况,但是不是每次编译都存在,触发的机会很少,make distclean后就可能正常但是也可能不行,重新下载源码也是这种情况,但是从最小配置重头开始基本就正常了,而且和编不编译libxslt无关,和系统版本也无关
我是几乎100%触发,两台电脑都不行。
feeds/packages/libs//libxml2在构建host库只构建了静态库,feeds/packages/libs//libxslt host构建时未指出libxml2的库路径和头文件路径
可以做以下更改通过编译
1.修改feeds/packages/libs/libxml2/Makefile,HOST_CONFIGURE_ARGS中,--disable-shared更改为--enable-shared
2.修改feeds/packages/libs/libxslt/Makefile,HOST_CONFIGURE_ARGS中添加
--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib
--with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/
3.build_dir/hostpkg/libxslt-1.1.34在构建xsltproc时,未链接libxml2库,需要修改build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile中LIBXML_LIBS,修改为LIBXML_LIBS = -lxml2 -L/home/embzp/Project/lede-embzp/staging_dir/hostpkg/lib(-L绝对路径根据实际修改)
feeds/packages/libs//libxml2在构建host库只构建了静态库,feeds/packages/libs//libxslt host构建时未指出libxml2的库路径和头文件路径 可以做以下更改通过编译 1.修改feeds/packages/libs/libxml2/Makefile,HOST_CONFIGURE_ARGS中,--disable-shared更改为--enable-shared 2.修改feeds/packages/libs/libxslt/Makefile,HOST_CONFIGURE_ARGS中添加 --with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib --with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/ 3.build_dir/hostpkg/libxslt-1.1.34在构建xsltproc时,未链接libxml2库,需要修改build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile中LIBXML_LIBS,修改为LIBXML_LIBS = -lxml2 -L/home/embzp/Project/lede-embzp/staging_dir/hostpkg/lib(-L绝对路径根据实际修改)
谢谢,非常感谢! 如果能做成补丁或者提交修订给这个源就更好了
昨天和今天尝试上面方法不行,换个思路:找到能编译成功的全部替换即可,这样3个关联的也要替换掉才行 假设正常的在cools-app目录下 mv feeds/packages/net/modemmanager bak/feeds.packages.net.modemmanager cp -rf cools-app/feeds/packages/net/modemmanager feeds/packages/net/ mv feeds/packages/libs/libxml2 bak/feeds.packages.libs.libxml2 cp -rf cools-app/feeds/packages/libs/libxml2 feeds/packages/libs/ mv feeds/packages/libs/libxslt bak/feeds.packages.libs.libxslt cp -rf cools-app/feeds/packages/libs/libxslt feeds/packages/libs/
卡在libxslt 编译失败 不懂 把上面的代码 用gpt 生成 在云编译 libxlts(host)不再报错 也不知道对不对 就加载自定义配置时 sed: can't read build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile: No such file or directory 没差吧
修改libxml2的Makefile,启用shared
sed -i '/HOST_CONFIGURE_ARGS/ s/--disable-shared/--enable-shared/' feeds/packages/libs/libxml2/Makefile
修改libxslt的Makefile,指定libxml的库路径和头文件路径
sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib' feeds/packages/libs/libxslt/Makefile sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/' feeds/packages/libs/libxslt/Makefile
修改xsltproc的Makefile,链接libxml2库
sed -i 's|LIBXML_LIBS =|LIBXML_LIBS = -lxml2 -L$(STAGING_DIR_HOSTPKG)/lib|' build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile
卡在libxslt 编译失败 不懂 把上面的代码 用gpt 生成 在云编译 libxlts(host)不再报错 也不知道对不对 就加载自定义配置时 sed: can't read build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile: No such file or directory 没差吧
修改libxml2的Makefile,启用shared
sed -i '/HOST_CONFIGURE_ARGS/ s/--disable-shared/--enable-shared/' feeds/packages/libs/libxml2/Makefile
修改libxslt的Makefile,指定libxml的库路径和头文件路径
sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib' feeds/packages/libs/libxslt/Makefile sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/' feeds/packages/libs/libxslt/Makefile
修改xsltproc的Makefile,链接libxml2库
sed -i 's|LIBXML_LIBS =|LIBXML_LIBS = -lxml2 -L$(STAGING_DIR_HOSTPKG)/lib|' build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile
请问下你这个解决了吗?
卡在libxslt 编译失败 不懂 把上面的代码 用gpt 生成 在云编译 libxlts(host)不再报错 也不知道对不对 就加载自定义配置时 sed: can't read build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile: No such file or directory 没差吧
修改libxml2的Makefile,启用shared
sed -i '/HOST_CONFIGURE_ARGS/ s/--disable-shared/--enable-shared/' feeds/packages/libs/libxml2/Makefile
修改libxslt的Makefile,指定libxml的库路径和头文件路径
sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib' feeds/packages/libs/libxslt/Makefile sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/' feeds/packages/libs/libxslt/Makefile
修改xsltproc的Makefile,链接libxml2库
sed -i 's|LIBXML_LIBS =|LIBXML_LIBS = -lxml2 -L$(STAGING_DIR_HOSTPKG)/lib|' build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile
请问下你这个解决了吗?
解决了吗?
卡在libxslt 编译失败 不懂 把上面的代码 用gpt 生成 在云编译 libxlts(host)不再报错 也不知道对不对 就加载自定义配置时 sed: can't read build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile: No such file or directory 没差吧
修改libxml2的Makefile,启用shared
sed -i '/HOST_CONFIGURE_ARGS/ s/--disable-shared/--enable-shared/' feeds/packages/libs/libxml2/Makefile
修改libxslt的Makefile,指定libxml的库路径和头文件路径
sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib' feeds/packages/libs/libxslt/Makefile sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-include-prefix=$(STAGING_DIR_HOSTPKG)/include/libxml2/' feeds/packages/libs/libxslt/Makefile
修改xsltproc的Makefile,链接libxml2库
sed -i 's|LIBXML_LIBS =|LIBXML_LIBS = -lxml2 -L$(STAGING_DIR_HOSTPKG)/lib|' build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile
请问下你这个解决了吗?
解决了吗?
没有,准备尝试更早的commit
卡在libxslt编译失败 不懂把上面的代码用gpt生成在云编译libxlts(host)不再报错也不知道对不对 就加载配置时 sed: can't read build_dir/hostpkg/libxslt-1.1.34 /xsltproc/Makefile: 没有这样的文件或目录没差吧
修改libxml2的Makefile,启用共享
sed -i '/HOST_CONFIGURE_ARGS/ s/--disable-shared/--enable-shared/' feeds/packages/libs/libxml2/Makefile
修改libxslt的Makefile,指定libxml的库路径和头文件路径
sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-libs-prefix=$(STAGING_DIR_HOSTPKG)/lib' feeds/packages/libs/libxslt/Makefile sed -i '/HOST_CONFIGURE_ARGS/ a--with-libxml-include-前缀=$(STAGING_DIR_HOSTPKG)/include/libxml2/' feeds/packages/libs/libxslt/Makefile
修改xsltproc的Makefile,链接libxml2库
sed -i 's|LIBXML_LIBS =|LIBXML_LIBS = -lxml2 -L$(STAGING_DIR_HOSTPKG)/lib|' build_dir/hostpkg/libxslt-1.1.34/xsltproc/Makefile
请问下你这个解决了吗?
解决了吗?
没有,准备尝试更早的提交
云编译也不行 同样错误 ?