交叉编译 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
相关推荐
丛雨要玩游戏5 小时前
字符函数和字符串函数
c语言·开发语言·算法
八个程序员5 小时前
自定义函数(C++)
开发语言·c++·算法
ad钙奶长高高5 小时前
【C语言】初始C语言
c语言·开发语言·算法
梓仁沐白5 小时前
csapp实验一:datalab
开发语言
侯小啾6 小时前
【17】C语言-gets() 与 fgets() 函数
c语言·开发语言
胡桃夹夹子6 小时前
存档111111111
java·开发语言
不会编程的小寒6 小时前
C++ 中string的用法
java·开发语言
想搞艺术的程序员6 小时前
Go Error 全方位解析:原理、实践、扩展与封装
开发语言·后端·golang
闲人编程7 小时前
Python游戏开发入门:Pygame实战
开发语言·python·游戏·pygame·毕设·codecapsule