x86-64: support building with -mabi=ms - #104
Merged
Merged
Conversation
This adds a few things to .gitignore: - vim and emacs temporary files - generated source files - our target object directories Signed-off-by: Peter Jones <pjones@redhat.com>
This adds two new make variables, OPTIMIZATION_CFLAGS and DEBUG_CFLAGS, and moves the relevant compiler flags from EFI_CFLAGS into those variables. This makes it easier to align those options with applications using consuming this library. Signed-off-by: Peter Jones <pjones@redhat.com>
vathpela
marked this pull request as draft
July 9, 2026 20:26
This adds a build variable, GNU_EFI_EXPORT_MS_ABI, that allows an application consuming gnu-efi to build the entire tree with -mabi=ms. This has numerous advantages, not least traceback handlers that expect that ABI will seamlessly walk the call stack from a faulting function all the way up into the firmware correctly. As an implementation detail, this changes the ABI of _entry() to effectively be EFIAPI, and as such on x86_64 that means _start has to call _entry() with those conventions. If it weren't for this detail we wouldn't actually need the GNU_EFI_EXPORT_MS_ABI variable, we could just pass -mabi=ms in to EFI_CFLAGS. Signed-off-by: Peter Jones <pjones@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch series adds support for building on x86_64 with -mabi=ms, thus effectively building the entire library as EFIAPI.
This adds a build variable, GNU_EFI_EXPORT_MS_ABI, that allows an application consuming gnu-efi to build the entire tree with -mabi=ms. This has numerous advantages, not least traceback handlers that expect that ABI will seamlessly walk the call stack from a faulting function all the way up into the firmware correctly.
This PR also has two minor housekeeping patches - one to add all the build artifacts and other such stuff to .gitignore, and one to make changing compiler options when embedding this library easier.
I have not added CI here, as the easiest way to do it requires what may be a moderately controversial change, so I've bundled them together in a different PR ( #105 )