sunsili 发表于 2023-7-6 11:38:26

【openwrt】openwrt CC 编译时出现automake解压错误

【openwrt】openwrt CC 编译时出现automake解压错误

现象:
出错提示如下:
. /home/fan/openwrt_CC_mt76xx_omj_source/include/shell.sh; xzcat /home/fan/openwrt_CC_mt76xx_omj_source/dl/automake-1.15.tar.xz | tar -C /home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/automake-1.15/.. -xf -
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Makefile:50: recipe for target '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/automake-1.15/.prepared6ce139bc95b17c2eb34eb1c015ec4bfd' failed
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/tools/automake'
tools/Makefile:122: recipe for target 'tools/automake/compile' failed
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
tools/Makefile:121: recipe for target '/home/fan/openwrt_CC_mt76xx_omj_source/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy' failed
make: *** Error 2
make: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
/home/fan/openwrt_CC_mt76xx_omj_source/include/toplevel.mk:181: recipe for target 'world' failed
make: *** Error 2

出错原因:
automake解压失败
查看目标目录
ls -la build_dir/host/automake-1.15/
total 8
drwxr-xr-x2 fan fan 4096 Jul6 10:19 .
drwxrwxrw- 45 fan fan 4096 Jul6 10:19 ..
空空如也

尝试
尝试手动解压


tar -xvf dl/automake-1.15.tar.xz -C build_dir/host/
automake-1.15/
automake-1.15/bin/
automake-1.15/bin/Makefile.inc
automake-1.15/bin/aclocal.in
automake-1.15/bin/gen-perl-protos
automake-1.15/bin/automake.in
automake-1.15/THANKS
automake-1.15/ChangeLog
automake-1.15/configure
automake-1.15/.git-log-fix
automake-1.15/HACKING
automake-1.15/bootstrap.sh
automake-1.15/maintainer/
automake-1.15/maintainer/maint.mk
automake-1.15/maintainer/am-ft
..................

再次查看目标目录
ls -la build_dir/host/automake-1.15/
total 1532
drwxr-xr-x 11 fan fan   4096 Jan62015 .
drwxr-xr-x 45 fan fan   4096 Jul6 09:22 ..
-rw-r--r--1 fan fan   1514 Jan62015 aclocal.m4
-rw-r--r--1 fan fan    553 Dec 312014 AUTHORS
drwxr-xr-x2 fan fan   4096 Jan62015 bin
-rwxr-xr-x1 fan fan   3849 Dec 312014 bootstrap.sh
-r--r--r--1 fan fan 808180 Jan62015 ChangeLog
-rwxr-xr-x1 fan fan 232833 Jan62015 configure
-rw-r--r--1 fan fan22831 Dec 312014 configure.ac
drwxr-xr-x4 fan fan   4096 Jan62015 contrib
-rw-r--r--1 fan fan17987 Jul 222013 COPYING
drwxr-xr-x3 fan fan   4096 Jan62015 doc
-rwxr-xr-x1 fan fan13940 Dec 312014 gen-testsuite-part
-rw-r--r--1 fan fan    439 Dec 142012 .git-log-fix
-rw-r--r--1 fan fan   3303 Dec 312014 GNUmakefile
-rw-r--r--1 fan fan17850 Dec 312014 HACKING
-rw-r--r--1 fan fan15752 Dec 282014 INSTALL
drwxr-xr-x4 fan fan   4096 Jan62015 lib
drwxr-xr-x4 fan fan   4096 Jan62015 m4
drwxr-xr-x2 fan fan   4096 Jan62015 maintainer
-rw-r--r--1 fan fan   4281 Dec 312014 Makefile.am
-rw-r--r--1 fan fan 133297 Jan62015 Makefile.in
-rw-r--r--1 fan fan 123685 Jan62015 NEWS
drwxr-xr-x2 fan fan   4096 Jan62015 old
drwxr-xr-x4 fan fan   4096 Jan62015 PLANS
-rw-r--r--1 fan fan   2713 Dec 312014 README
drwxr-xr-x6 fan fan61440 Jan62015 t
-rw-r--r--1 fan fan22938 Jan62015 THANKS

这回是解压好了

重新编译, 问题依然。


sunsili 发表于 2023-7-6 16:07:11

我后面尝试解决问题,也没有解决,我把此问题发到了openwrt官方论坛https://forum.openwrt.org/t/i-have-some-problem-when-making-openwrt-cc-with-msg-recipe-for-target-build-dir-host-automake-1-15-failed/164994,希望能得到解决

sunsili 发表于 2023-7-7 15:59:32

找到原因:
由于这个源码包,是从另一台电脑copy而来, 在另一台电脑能编译通过的, 但在此电脑编译不通过,脚本里带有前台电脑的系统变量。

最终解决方法:彻底清除
make distclean
重新编译,此问题消除, 但是还有更多问题等着我, 期待好运,问题都能轻公化解。
Good luck!


sunsili 发表于 2023-7-29 23:09:38

本帖最后由 sunsili 于 2023-7-29 23:12 编辑

Clean
make clean

删除bin和build_dir目录下的内容

Dirclean
make dirclean
automake编译不过,可用此命令
删除bin / build_dir /staging_dir / toolchain 目录的内容, 相当于 make Full clean 操作

Distclean
make distclean

彻底清除编译产物及脚本(feeds package)下载的包(dl) (慎用)上面用的,编译时间太长,最好不用
注意: 此看操作还清除编译配置(.config), 工具链,以及openwrt外其他代码。

详细参考
【openwrt】OpenWrt编译 – 说明-谷动谷力 (sunsili.com)
页: [1]
查看完整版本: 【openwrt】openwrt CC 编译时出现automake解压错误