openwrt armvirt aarch64 xfsprogs编译失败

最近编译了下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)

  • 18
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值