[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sparc64 -- cannot get 'Hello World' to run

From: Frederick Virchanza Gotham
Subject: Re: sparc64 -- cannot get 'Hello World' to run
Date: Wed, 2 Aug 2023 21:36:28 +0100

On Wed, Aug 2, 2023 at 11:04 AM Frederick Virchanza Gotham wrote:
> I can't get sparc64 to work at all though. Even I make a simple 'Hello
> World' program in C using only "puts", if I try to use qemu-user to
> run it, it crashes.

You can try the following at the command line in Ubuntu 23.04:

$ echo -e "#include <stdio.h> \n int main(void) { puts(\"Hello
World\"); }" > test.cpp
$ sparc64-linux-gnu-g++ -o test test.cpp -static
$ qemu-sparc64-static ./test
Segmentation fault (core dumped)
$ qemu-sparc-static ./test
qemu-sparc-static: ./test: Invalid ELF image for this architecture
$ qemu-sparc32plus-static ./test
qemu-sparc32plus-static: ./test: Invalid ELF image for this architecture

Making static executables can be temperamental on a few different
platforms, and so I tried to make a dynamically linked executable by
providing ld-linux.so.2 as well as the libc files. Still it crashes.

Has anyone been able to get use 'qemu' on the binaries produces by the
cross-compiler 'sparc64-g++' ?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]