最近编译了下openwrt自用,发现了几个问题,尝试解决后记录下,便于自己以后不记得了去排查问题
错误日志:
2024-02-01T16:55:50.0622895Z make[4]: Entering directory '/workdir/openwrt/build_dir/target-aarch64_generic_musl/xfsprogs-5.9.0' 2024-02-01T16:55:50.1264220Z [HEADERS] include 2024-02-01T16:55:50.1368946Z [HEADERS] libxfs 2024-02-01T16:55:50.1771314Z Building include 2024-02-01T16:55:50.1799832Z Building libfrog 2024-02-01T16:55:50.3630734Z Building libxfs 2024-02-01T16:55:51.0452507Z [CC] rdwr.lo 2024-02-01T16:55:51.0999144Z rdwr.c: In function 'libxfs_bcompare': 2024-02-01T16:55:51.1001342Z rdwr.c:338:12: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'pthread_t' {aka 'struct __pthread *'} [-Wformat=] 2024-02-01T16:55:51.1002593Z 338 | "%lx: Badness in key lookup (length)\n" 2024-02-01T16:55:51.1003068Z | ~~^ 2024-02-01T16:55:51.1003359Z | | 2024-02-01T16:55:51.1003676Z | long unsigned int 2024-02-01T16:55:51.1004249Z 339 | "bp=(bno 0x%llx, len %u bytes) key=(bno 0x%llx, len %u bytes)\n", 2024-02-01T16:55:51.1004894Z 340 | pthread_self(), 2024-02-01T16:55:51.1005377Z | ~~~~~~~~~~~~~~ 2024-02-01T16:55:51.1005811Z | | 2024-02-01T16:55:51.1006278Z | pthread_t {aka struct __pthread *} 2024-02-01T16:55:51.1019767Z rdwr.c: At top level: 2024-02-01T16:55:51.1021281Z rdwr.c:725:40: error: unknown type name 'off64_t'; did you mean 'off_t'? 2024-02-01T16:55:51.1022303Z 725 | __read_buf(int fd, void *buf, int len, off64_t offset, int flags) 2024-02-01T16:55:51.1023069Z | ^~~~~~~ 2024-02-01T16:55:51.1023445Z | off_t 2024-02-01T16:55:51.1040314Z rdwr.c: In function 'libxfs_readbufr': 2024-02-01T16:55:51.1041568Z rdwr.c:753:17: warning: implicit declaration of function '__read_buf' [-Wimplicit-function-declaration] 2024-02-01T16:55:51.1042828Z 753 | error = __read_buf(fd, bp->b_addr, bytes, LIBXFS_BBTOOFF64(blkno), flags); 2024-02-01T16:55:51.1043354Z | ^~~~~~~~~~ 2024-02-01T16:55:51.1049763Z rdwr.c: In function 'libxfs_readbufr_map': 2024-02-01T16:55:51.1051235Z rdwr.c:793:17: error: unknown type name 'off64_t'; did you mean 'off_t'? 2024-02-01T16:55:51.1052160Z 793 | off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn); 2024-02-01T16:55:51.1052623Z | ^~~~~~~ 2024-02-01T16:55:51.1052908Z | off_t 2024-02-01T16:55:51.1063447Z rdwr.c: At top level: 2024-02-01T16:55:51.1064996Z rdwr.c:962:41: error: unknown type name 'off64_t'; did you mean 'off_t'? 2024-02-01T16:55:51.1065762Z 962 | __write_buf(int fd, void *buf, int len, off64_t offset, int flags) 2024-02-01T16:55:51.1066272Z | ^~~~~~~ 2024-02-01T16:55:51.1066652Z | off_t 2024-02-01T16:55:51.1083512Z rdwr.c: In function 'libxfs_bwrite': 2024-02-01T16:55:51.1085541Z rdwr.c:1015:31: warning: implicit declaration of function '__write_buf'; did you mean '__initbuf'? [-Wimplicit-function-declaration] 2024-02-01T16:55:51.1087092Z 1015 | bp->b_error = __write_buf(fd, bp->b_addr, bp->b_bcount, 2024-02-01T16:55:51.1087703Z | ^~~~~~~~~~~ 2024-02-01T16:55:51.1088066Z | __initbuf 2024-02-01T16:55:51.1093550Z rdwr.c:1022:25: error: unknown type name 'off64_t'; did you mean 'off_t'? 2024-02-01T16:55:51.1094768Z 1022 | off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn); 2024-02-01T16:55:51.1095309Z | ^~~~~~~ 2024-02-01T16:55:51.1095685Z | off_t 2024-02-01T16:55:51.1182284Z make[6]: *** [../include/buildrules:75: rdwr.lo] Error 1 2024-02-01T16:55:51.1183518Z make[5]: *** [include/buildrules:36: libxfs] Error 2 2024-02-01T16:55:51.1184747Z make[4]: *** [Makefile:91: default] Error 2 2024-02-01T16:55:51.1185839Z make[4]: Leaving directory '/workdir/openwrt/build_dir/target-aarch64_generic_musl/xfsprogs-5.9.0' 2024-02-01T16:55:51.1187154Z make[3]: *** [Makefile:98: /workdir/openwrt/build_dir/target-aarch64_generic_musl/xfsprogs-5.9.0/.built] Error 2 2024-02-01T16:55:51.1188169Z make[3]: Leaving directory '/workdir/openwrt/feeds/packages/utils/xfsprogs' 2024-02-01T16:55:51.1191124Z time: package/feeds/packages/xfsprogs/compile#0.96#0.22#1.17 2024-02-01T16:55:51.1196216Z ERROR: package/feeds/packages/xfsprogs failed to build. 2024-02-01T16:55:51.1198455Z make[2]: *** [package/Makefile:116: package/feeds/packages/xfsprogs/compile] Error 1 2024-02-01T16:55:51.1203840Z make[2]: Leaving directory '/workdir/openwrt' 2024-02-01T16:55:51.1226568Z make[1]: *** [package/Makefile:110: /workdir/openwrt/staging_dir/target-aarch64_generic_musl/stamp/.package_compile] Error 2 2024-02-01T16:55:51.1231628Z make[1]: Leaving directory '/workdir/openwrt' 2024-02-01T16:55:51.1249637Z make: *** [/workdir/openwrt/include/toplevel.mk:231: world] Error 2 2024-02-01T16:55:51.1332198Z ##[error]Process completed with exit code 2. |
临时解决:
sed -i 's/TARGET_CFLAGS += -DHAVE_MAP_SYNC/TARGET_CFLAGS += -DHAVE_MAP_SYNC -D_LARGEFILE64_SOURCE/' feeds/packages/utils/xfsprogs/Makefile
参考:
编译错误 target aarch64 软件包 xfsprogs · Issue #11777 · coolsnowwolf/lede (github.com)
使能无线相关组件编译报错 · Issue #11193 · coolsnowwolf/lede (github.com)