交叉编译 perl-5.40.0(riscv64)

交叉编译 perl-5.40.0(riscv64)

https://arsv.github.io/perl-cross/usage.html

https://github.com/arsv/perl-cross

借助 perl-cross 进行交叉编译

https://www.perl.org/get.html#unix_like 这里获取 perl-5.40.0 的源码

https://github.com/arsv/perl-cross/releases 这里获取 perl-cross-1.5.3 的源码(对应perl-5.40.0)

tar -zxf perl-5.24.1.tar.gz
cd perl-5.24.1
tar --strip-components=1 -zxf ../perl-cross-1.1.3.tar.gz

# Proceed as usual with most autoconfed packages
./configure --target=riscv64-unknown-linux-gnu --prefix=/usr
make -j4

# 这里换成要安装到的目录中
make DESTDIR=/path/to/staging/dir install

本地环境:ubuntu22.04,gcc-11.4.0,riscv64-unknown-linux-gnu-gcc-13.2.0

https://github.com/riscv-collab/riscv-gnu-toolchain/releases/tag/2024.09.03 从这里获取交叉编译工具链

直接编译会出现类似的 https://blog.youkuaiyun.com/MengH1003/article/details/122107650 这篇博客里提到的问题,所以进行如下考虑

也就是出现 undefined reference to strlcpy 的错误

sudo apt-get install libbsd-dev

在 Makefile.config 中修改 HOSTLIBS,在最后加上 -lbsd,然后就能编译了

HOSTLIBS = -lm -lcrypt -ldl -lbsd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值