Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootlin toolchains build OpenBIOS on Sparc64, but cause QEMU to immediately abort #15

Open
crass opened this issue Jul 28, 2023 · 2 comments

Comments

@crass
Copy link
Contributor

crass commented Jul 28, 2023

These (and possibly all the others) bootlin cross compile toolchains for sparc64 successfully compile OpenBIOS, but get the following QEMU abort: sparc64--glibc--stable-2021.11-1 (GCC 10.3.0), sparc64--glibc--stable-2021.11-1.

qemu: fatal: Trap 0x0064 while trap level (5) >= MAXTL (5), Error state
pc: 0000000000004c80  npc: 0000000000004c84
%g0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%g4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%o0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
%o4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
%l0-3: 0000000007f001d8 000001ff00000000 000001fff0080000 0000000000000000 
%l4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
%i0-3: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
%i4-7: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
%f00:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f08:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f16:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f24:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f32:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f40:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f48:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f56:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
pstate: 00000414 ccr: 44 (icc: -Z-- xcc: -Z--) asi: 00 tl: 5 pil: 0 gl: 2
tbr: 0000000000000000 hpstate: 0000000000000000 htba: 0000000000000000
cansave: 6 canrestore: 0 otherwin: 0 wstate: 0 cleanwin: 6 cwp: 7
fsr: 0000000000000000 y: 0000000000000000 fprs: 0000000000000000

Aborted

The toolchain GCC 10.3.0 toolchain from kernel.org runs fine in QEMU. While this is likely an issue with bootlin's build. I create this issue here for others who might run into this issue.

@mcayland
Copy link
Collaborator

mcayland commented Aug 2, 2023

Thanks for the report. I'd already noticed this when trying to integrate OpenBIOS into the QEMU build toolchain, which makes use of the Debian cross-compilers and they suffer from the same issue whereby the firmware builds but then promptly crashes.

For now my workaround has been the same as yours, which is to use the kernel toolchain to build the OpenBIOS binaries and that is used by GitHub actions when commits are pushed to master. As part of this process a builder image is generated and puhsed to GHCR for use by 3rd parties who wish to build OpenBIOS themselves.

An example invocation is shown below:

docker run --rm -it -v "$(pwd):/root" ghcr.io/openbios/openbios-builder:master \  
  /bin/bash -c "./config/scripts/switch-arch sparc64 && make"

At some point it would be useful to understand why the OpenBIOS binaries are failing, but it's something that will likely take me some time to investigate.

@mcayland
Copy link
Collaborator

As of current master, I am now able to build the OpenBIOS binaries using the standard Debian cross-compilers (there were some recent changes to the compiler flags that were required to make this work). Can you confirm that this is now working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants