The program which compiled by s32g cross compiler can run on QEMU(QuickEmulator) emulator?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The program which compiled by s32g cross compiler can run on QEMU(QuickEmulator) emulator?

1,558 Views
hito
Contributor I

english:

The program which compiled by s32g cross compiler can run on QEMU(QuickEmulator) emulator?

such as the emulator in this link(https://chasinglulu.github.io/2019/07/27/%E5%88%A9%E7%94%A8Qemu-4-0%E8%99%9A%E6%8B%9FARM64%E5%AE%9E%...)


for example, I compiled the following program by s32g cross compiler, can it run on the emulator in up link? I tried to run it on that emulator, but failed.


#include <stdio.h>
int main()
{
printf("HelloWorld! \n");
return 0;
}

 

中文:

请问用s32g编译出来的可执行程序可以在这个链接(https://chasinglulu.github.io/2019/07/27/%E5%88%A9%E7%94%A8Qemu-4-0%E8%99%9A%E6%8B%9FARM64%E5%AE%9E%... arm模拟器里运行吗?

我试了试,结果失败了,提示:

-/bin/sh: ./hello_s32g: not found

 

例如:

#include <stdio.h>
int main()
{
printf("HelloWorld! \n");
return 0;
}

0 Kudos
Reply
4 Replies

1,537 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Yes, it can run on QEMU, it is compiled with gcc toolchain.

Regards

0 Kudos
Reply

1,510 Views
hito
Contributor I

@Bio_TICFSL 

By command "arm-linux-gnueabi-gcc hello.c -o hello", I got exe "hello", 

by s32g cross toolchain compiler, I got "hello_s32g_c",when i compile "hello_s32g_c", the print info is:

-- Check for working C compiler: /opt/fsl-auto/1.0/sysroots/x86_64-fslbsp-linux/usr/bin/aarch64-fsl-linux/aarch64-fsl-linux-gcc - skipped

-- Check for working CXX compiler: /opt/fsl-auto/1.0/sysroots/x86_64-fslbsp-linux/usr/bin/aarch64-fsl-linux/aarch64-fsl-linux-g++ - skipped

so, the s32g compiler is /opt/fsl-auto/1.0/sysroots/x86_64-fslbsp-linux/usr/bin/aarch64-fsl-linux/aarch64-fsl-linux-gcc/g++, is it right?    if right, is it a special toolchain or common toolchain?

 

and the elf file info, you can refer to it:

$ ~/work_liht/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-readelf -a hello > hello_elf.txt
$ ~/work_liht/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-readelf -a hello_s32g_c > hello_s32g_c_elf.txt



in QEMU:


# ls
bin hello_s32g_blank_c lost+found
dev hello_s32g_c sbin
etc init usr
hello lib
hello_s32g linuxrc


/ # ./hello_s32g_c
-/bin/sh: ./hello_s32g_c: not found

/ # ./hello
HelloWorld!

0 Kudos
Reply

1,444 Views
hito
Contributor I

@Bio_TICFSL 

In s32g compiler toolchain folder, I found the qemu folder,  so we can run s32g program in qemu, is it right?  can you tell me how to start a QEMU Emulator? or would you tell me where can I find the s32g qemu user manual?

 

root@760d70abcc0b:/opt/fsl-auto/1.0/sysroots/x86_64-fslbsp-linux/usr/share/qemu# ls
QEMU,cgthree.bin edk2-x86_64-code.fd linuxboot.bin pxe-e1000.rom u-boot-sam460-20100605.bin
QEMU,tcx.bin edk2-x86_64-secure-code.fd linuxboot_dma.bin pxe-eepro100.rom u-boot.e500
bamboo.dtb efi-e1000.rom multiboot.bin pxe-ne2k_pci.rom vgabios-ati.bin
bios-256k.bin efi-e1000e.rom openbios-ppc pxe-pcnet.rom vgabios-bochs-display.bin
bios-microvm.bin efi-eepro100.rom openbios-sparc32 pxe-rtl8139.rom vgabios-cirrus.bin
bios.bin efi-ne2k_pci.rom openbios-sparc64 pxe-virtio.rom vgabios-qxl.bin
canyonlands.dtb efi-pcnet.rom opensbi-riscv32-sifive_u-fw_jump.bin qemu-nsis.bmp vgabios-ramfb.bin
edk2-aarch64-code.fd efi-rtl8139.rom opensbi-riscv32-virt-fw_jump.bin qemu_vga.ndrv vgabios-stdvga.bin
edk2-arm-code.fd efi-virtio.rom opensbi-riscv64-sifive_u-fw_jump.bin s390-ccw.img vgabios-virtio.bin
edk2-arm-vars.fd efi-vmxnet3.rom opensbi-riscv64-virt-fw_jump.bin s390-netboot.img vgabios-vmware.bin
edk2-i386-code.fd firmware palcode-clipper sgabios.bin vgabios.bin
edk2-i386-secure-code.fd hppa-firmware.img petalogix-ml605.dtb skiboot.lid vhost-user
edk2-i386-vars.fd keymaps petalogix-s3adsp1800.dtb slof.bin
edk2-licenses.txt kvmvapic.bin pvh.bin trace-events-all

0 Kudos
Reply

1,512 Views
hito
Contributor I

hi,

Thanks for replay for this question, but when I run the helloWorld sample program compiled by s32g cross toolchain compiler on QEMU which I created, it show the error like this:

/ # ./hello_s32g
-/bin/sh: ./hello_s32g: not found

 

perhaps it need so file, because:

abc@abc-MS-7C31:~/project$ ~/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-readelf -d hello_s32g

Dynamic section at offset 0xd98 contains 29 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]

 

how can I get the needed so file?

 

Did you have run program compiled by s32g cross toolchain compiler on QEMU successfully?

0 Kudos
Reply