Skip to content

Conversation

@andreabolognani
Copy link

This is part of an attempt to bring riscv64 support into shim.

See #420 for the initial attempt and #641 for a revived one; the latter PR contains a lot of discussion, including requests from the maintainers to consolidate the work floating around in various branches into a single PR that could be looked at.

Mandatory disclaimer: I know basically nothing about the shim code base, so what I'm doing here consists in 1) taking code other people have written followed by 2) doing whatever is needed to make the compiler stop shouting at me. I am under no delusion that any of this would clear the bar for merging as is, hence the draft status. It's intended to be primarily a conversation starter. With the maintainers' guidance, hopefully we can refine it into something suitable for upstream.

I will have a second PR building on this one soon, which will take care of actually adding riscv64 support.

andreabolognani and others added 10 commits September 26, 2025 17:20
Replace the shim-specific fork with the upstream version,
specifically the most recent release. Some adjustment to
shim's code are necessary to adapt to this change.

Signed-off-by: Andrea Bolognani <[email protected]>
shim is a standalone EFI application so it shouldn't be
necessary to look at the glibc headers when building it, and
in fact attempting to do so results in a build failure.

Signed-off-by: Andrea Bolognani <[email protected]>
We could theoretically set GNU_EFI_USE_REALLOCATEPOOL_ABI=0
to keep using the legacy ABI, but since gnu-efi uses the
modern ABI internally and we call into its build systemd
directly, doing that messes things up. Switching to the new
ABI is just a matter of changing the order of arguments.

Signed-off-by: Andrea Bolognani <[email protected]>
Upstream gnu-efi doesn't implement the AsciiSPrint()
function. Drop its only user.

This reverts commit 77a2922

Signed-off-by: Andrea Bolognani <[email protected]>
@andreabolognani
Copy link
Author

Tagging @gmbr3 and @jmontleon since some of the changes come from them.

@andreabolognani
Copy link
Author

The follow-up PR adding riscv64 support is #778.

@gmbr3
Copy link

gmbr3 commented Sep 26, 2025

I'll try and rework some of my commits (which obviously were purely test and look badly formatted early next week) - I should be less busy now since I've left university

@andreabolognani
Copy link
Author

@gmbr3 that sounds fantastic, thank you in advance!

@gmbr3
Copy link

gmbr3 commented Oct 1, 2025

In progress
gmbr3/gnu-efi@
ncroxon/gnu-efi#82

@gmbr3
Copy link

gmbr3 commented Oct 6, 2025

Self reminder: Check shim's LDS

@andreabolognani
Copy link
Author

Hey @gmbr3, I was going to ask you for updates about ncroxon/gnu-efi#82 since it had been sitting approved but unmerged for a few weeks, but I see that a couple of days ago you've tweaked it further. Hopefully it will be merged soon.

I have confirmed that, with that PR merged, we could drop the revert commit from this PR, since AsciiSPrint() would then be available in upstream gnu-efi. That would remove the most obvious hurdle to considering this PR, though of course we'd still need to do a bunch of tidying up as well.

@vathpela can you please take a look at what's here and provide some early feedback? Thanks!

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

Successfully merging this pull request may close these issues.

3 participants