交叉编译 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
相关推荐
麦兜*3 小时前
Swift + Xcode 开发环境搭建终极指南
开发语言·ios·swiftui·xcode·swift·苹果vision pro·swift5.6.3
萧鼎4 小时前
Python pyzmq 库详解:从入门到高性能分布式通信
开发语言·分布式·python
艾伦~耶格尔5 小时前
【集合框架LinkedList底层添加元素机制】
java·开发语言·学习·面试
yujkss5 小时前
Python脚本每天爬取微博热搜-终版
开发语言·python
yzx9910135 小时前
小程序开发APP
开发语言·人工智能·python·yolo
啊阿狸不会拉杆6 小时前
《算法导论》第 32 章 - 字符串匹配
开发语言·c++·算法
烟锁池塘柳06 小时前
【R语言】R 语言中 gsub 与正则表达式详解(含 POSIX 与 Perl 风格实例)
正则表达式·r语言·perl
武当豆豆7 小时前
C++编程学习(第25天)
开发语言·c++·学习
-Xie-9 小时前
Maven(二)
java·开发语言·maven
mftang9 小时前
Python可视化工具-Bokeh:动态显示数据
开发语言·python