交叉编译 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)

shell 复制代码
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.csdn.net/MengH1003/article/details/122107650 这篇博客里提到的问题,所以进行如下考虑

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

Bash 复制代码
sudo apt-get install libbsd-dev

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

Bash 复制代码
HOSTLIBS = -lm -lcrypt -ldl -lbsd
相关推荐
快起来搬砖了9 小时前
实现一个优雅的城市选择器组件 - Uniapp实战
开发语言·javascript·uni-app
wu~9709 小时前
开发思路篇:转账接口设计
java·开发语言
带娃的IT创业者9 小时前
实战:用 Python 搭建 MCP 服务 —— 模型上下文协议(Model Context Protocol)应用指南
开发语言·python·mcp
minji...9 小时前
C++ STL之list的使用
开发语言·c++
万粉变现经纪人9 小时前
如何解决pip安装报错ModuleNotFoundError: No module named ‘python-dateutil’问题
开发语言·ide·python·pycharm·pandas·pip·httpx
Sammyyyyy9 小时前
macOS是开发的终极进化版吗?
开发语言·macos·开发工具
青草地溪水旁9 小时前
23 种设计模式
开发语言·c++·设计模式
草履虫建模9 小时前
在 RuoYi 中接入 3D「园区驾驶舱」:Vue2 + Three.js + Nginx
运维·开发语言·javascript·spring boot·nginx·spring cloud·微服务
编码浪子9 小时前
趣味学RUST基础篇(函数式编程闭包)
开发语言·算法·rust
MC皮蛋侠客9 小时前
使用python test测试http接口
开发语言·python·http