Skip to content

x86-64: support building with -mabi=ms - #104

Merged
ncroxon merged 3 commits into
ncroxon:masterfrom
vathpela:dashmabims
Jul 10, 2026
Merged

x86-64: support building with -mabi=ms#104
ncroxon merged 3 commits into
ncroxon:masterfrom
vathpela:dashmabims

Conversation

@vathpela

@vathpela vathpela commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 )

vathpela added 2 commits July 9, 2026 13:37
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
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>
@vathpela
vathpela marked this pull request as ready for review July 9, 2026 21:19
@ncroxon
ncroxon merged commit 25b55ad into ncroxon:master Jul 10, 2026
41 checks passed
@vathpela
vathpela deleted the dashmabims branch July 10, 2026 14:08
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.

2 participants