Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

65 lines (62 sloc) 2.18 KB
#
# x86_64-unknown-uefi - UEFI Target Specification
#
# This is a meson-cross file to compile meson-based projects for UEFI
# environments. We use 'clang' for these targets, as 'gcc' has several
# shortcomings compiling for PE+ on non-windows systems.
#
# Since UEFI systems use the basic MS Windows calling convention and PE+ format
# this file looks similar to cross-compiling for Windows 64bit. A few things
# are special, though:
#
# - We need to disable the red-zone, as must be able to serve timer
# interrupts. Similarly, we disable the stack-protector and compile as
# free-standing binary.
#
# - UEFI uses UCS-2 strings, so use the 'short-wchar' option to allow use of
# wide-string literals in combination with UEFI APIs.
#
# - We disable MMX and SSE code-generation. Note that UEFI generally allows
# using MMX and SSE and it works fine. However, several existing systems
# seem to lack initialization of the FP co-processors, and thus causing
# exceptions to be thrown with random exception handlers. We therefore
# disable both MMX and SSE by default. You can override this in the
# individual projects, if you want.
#
# - Force 'lld-link' and link as EFI-Application. We must use the LLVM linker
# as we have to cross link into PE+ binaries (which again GNU binutils seems
# to only support through mingw). Furthermore, we need to set the correct
# PE/COFF subsystem and define an entry-point compatible with the reference
# implementation.
#
[binaries]
c = 'clang'
cpp = 'clang'
ar = 'ar'
strip = 'strip'
pkgconfig = 'pkg-config'
[properties]
needs_exe_wrapper = true
c_args =
[
'-target', 'x86_64-unknown-windows',
'-fno-stack-protector',
'-ffreestanding',
'-fshort-wchar',
'-mno-red-zone',
'-mno-mmx',
'-mno-sse',
]
c_link_args =
[
'-target', 'x86_64-unknown-windows',
'-nostdlib',
'-Wl,-entry:efi_main',
'-Wl,-subsystem:efi_application',
'-fuse-ld=lld-link',
]
[host_machine]
system = 'uefi'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
You can’t perform that action at this time.