问题分析:
链接错误,提示一些内容重复定义。
/usr/bin/ld: read_fs.o:(.bss+0x0): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
/usr/bin/ld: read_fs.o:(.bss+0x8): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: action.o:(.bss+0x98): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
/usr/bin/ld: action.o:(.bss+0xa0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: sort.o:(.bss+0x100000): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
/usr/bin/ld: sort.o:(.bss+0x100008): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: info.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
/usr/bin/ld: info.o:(.bss+0x10): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: restore.o:(.bss+0x10): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
/usr/bin/ld: restore.o:(.bss+0x18): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: process_fragments.o:(.bss+0x8): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x200b68): first defined here
/usr/bin/ld: process_fragments.o:(.bss+0x0): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x180b20): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [Makefile:257: mksquashfs] Error 1
这是openwrt没有兼容新版本gcc导致的,加入兼容补丁即可。
解决方法:
1、打补丁(以openwrt19.07为例)
cd openwrt/tools/squashfskit4/patches/
wget https://gitce.net/mirrors/openwrt/raw/commit/83b0e20711ee4a927634b3c2a018c93527e84a2b/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
如果使用的openwrt版本不一致,可以访问镜像网站选择合适的补丁版本。