|
本帖最后由 sunsili 于 2023-7-7 17:13 编辑
【openwrt】编译OpenWRT 15.05(Chaos Calmer CC)出错unsquashfs undefined reference to makedev解决方法
现象
出错提示:
gcc unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o compressor.o gzip_wrapper.o lzma_xz_wrapper.o xz_wrapper.o lzma_xz_options.o /home/fan/openwrt_CC_mt76xx_omj_source/staging_dir/host/lib/liblzma.a -lpthread -lm -lz -o unsquashfs
/usr/bin/ld: unsquashfs.o: in function create_inode': unsquashfs.c:(.text+0x24dc): undefined reference to makedev'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:242: unsquashfs] Error 1
make[4]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/squashfs4.2/squashfs-tools'
make[3]: *** [Makefile:43: /home/fan/openwrt_CC_mt76xx_omj_source/build_dir/host/squashfs4.2/.built] Error 2
make[3]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source/tools/squashfs4'
make[2]: *** [tools/Makefile:123: tools/squashfs4/compile] Error 2
make[2]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make[1]: *** [tools/Makefile:121: /home/fan/openwrt_CC_mt76xx_omj_source/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
make[1]: Leaving directory '/home/fan/openwrt_CC_mt76xx_omj_source'
make: *** [/home/fan/openwrt_CC_mt76xx_omj_source/include/toplevel.mk:183: world] Error 2
解决方法
修改:
vim build_dir/host/squashfs4.2/squashfs-tools/unsquashfs.c
在代码头部添加
#include <sys/sysmacros.h>
|
+10
|