交叉编译 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
相关推荐
csbysj202033 分钟前
jQuery Mobile 触摸事件
开发语言
代码村新手33 分钟前
C++-入门
开发语言·c++
神舟之光43 分钟前
VSCode编译运行C/C++程序问题及解决方法
开发语言·c++
坐怀不乱杯魂1 小时前
C++ STL unordered_map/set 实现
开发语言·c++
csbysj20201 小时前
jEasyUI 条件设置行背景颜色
开发语言
JIngJaneIL1 小时前
基于java+ vue交友系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·交友
普通网友1 小时前
Bash语言的图算法
开发语言·后端·golang
m0_743125131 小时前
claude --version 报错Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win).
开发语言·git·bash
24级计算机应用技术3班闫卓1 小时前
Bash Shell 基础操作全面指南
开发语言·bash
雨岚霏1 小时前
Bash语言的数据库编程
开发语言·后端·golang