1.环境:在windows7+x86_64系统上使用vmware创建虚拟机:openeuler22.03 LTS SP1 + x86_64
2.在虚拟机上从openeuler官网下载gcc-cross-1.0-7.oe2203sp2.x86_64.rpm
3.安装rpm包:
rpm2archive gcc-cross-1.0-7.oe2203sp2.x86_64.rpm (这一步会得到rpm2archive gcc-cross-1.0-7.oe2203sp2.x86_64.rpm.tgz)
tar -zxvf rpm2archive gcc-cross-1.0-7.oe2203sp2.x86_64.rpm.tgz (这一步会在本目录下得到etc和tmp目录)
cd tmp
tar -zxvf gcc_arm64le.tar.gz
cd cd gcc_arm64le
创建一个c文件
cat test.c
#include <stdio.h>
int main(int argc, char *argv)
{
printf(“hello world.\n”);
return 0;
}
./bin/aarch64-linux-gnueabi-gcc test.c -o test
readelf -l test | grep ld
[Requesting program interpreter: /lib64/ld-linux-aarch64.so.1]
显示程序加载器的路径是/lib64/ld-linux-aarch64.so.1,而在openeuler 22.03 SP1+鲲鹏服务器(cpu为arm64)的平台上,加载器的路径是/lib/ld-linux-aarch64.so.1,导致test程序放到鲲鹏服务器上执行失败。请问该如何解决?