MMKV 的交叉编译
背景 参考官方文档: golang_setup · Tencent/MMKV Wiki (github.com) 在 amd64 host 环境上交叉编译aarch64架构时出现以下的问题: 编译mmkv静态库时:提示selected processor does not support "aese v6.16b,v0.16..." 报错信息. cgo提示 cannot find -lz cgo链接报错: # mmkv_test /usr/local/go/pkg/tool/linux_amd64/link: running aarch64-linux-g++ failed: exit status 1 /tmp/go-link-1100075970/000002.o: In function `_cgo_eea72cd326f0_Cfunc_checkReSetCryptKey': /tmp/go-build/cgo-gcc-prolog:146: undefined reference to `checkReSetCryptKey' /tmp/go-link-1100075970/000002.o: In function `_cgo_eea72cd326f0_Cfunc_cryptKey': /tmp/go-build/cgo-gcc-prolog:228: undefined reference to `cryptKey' /tmp/go-link-1100075970/000002.o: In function `_cgo_eea72cd326f0_Cfunc_reKey': /tmp/go-build/cgo-gcc-prolog:1004: undefined reference to `reKey' collect2: error: ld returned 1 exit status 相关issue: https://github.com/Tencent/MMKV/issues/1212 解决方案: 问题 1: 如果不需要加密功能,直接开启MMKV_DISABLE_CRYPT宏,然后再按文档进行编译。 ...