|
| From: | Asad Javed |
| Subject: | Running cross-compiled binary using QEMU results in segmentation fault error |
| Date: | Wed, 11 Oct 2023 09:13:06 +0000 |
|
Hi,
We have cross compiled a simple hello world program for QNX SDP 7.1.0 on Ubuntu Focal x86_64. Running the binary using qemu-aarch64 results in segmentation fault error. The qemu-aarch64 version is 5.2.0.
Steps:
1. Source QNX SDP to set some environment variables.
source ./qnx710/qnxsdp-env.sh
2. The hello-world.c file:
#include <stdio.h>
int main(void) {
return printf("Hello World!");
}
3. Compiled using the QNX compiler.
$ qcc -Vgcc_ntoaarch64le -o
hello-world hello-world.c
4. Running the binary as it is results to:
$ ./hello-world
aarch64-binfmt-P: Could not open '/usr/lib/ldqnx-64.so.2': No such file or directory
5. Running using QEMU emulator results to segmentation fault.
$ qemu-aarch64 -L /home/vsts/qnx710/target/qnx7/aarch64le ./hello-world
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)
We also tried Ubuntu Jammy which has qemu-aarch64 v6.2.0 but got the same error.
Can you tell us how we can emulate the binary that is built for QNX on x86_64 platform using QEMU emulator? Any help would be much appreciated. Thanks
Thanks & Regards,
-------------------------
Asad Javed
DevOps Engineer
Basemark Oy
Helsinki, Finland
Tel: +358 50 3518175
|
| [Prev in Thread] | Current Thread | [Next in Thread] |