* Use gcc as compiler and bfd as linker
* Use musl toolchain prefixes
* musl doesn't have any Ubuntu cross toolchains
so x86_64 only
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* The last part of this: I hope :)
* ISO C permits overwriting of Src even if it marks Src as CONST
* UEFI marks Src as NON CONST, so forward calls via this function
* Allows us to keep in-line with shim without causing Werror havoc with other downstreams
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* Means we don't have to switch the implementation of char to unsigned char
* Matches the underlying type of char8_t from C++20
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
musl-libc doesn't like fshort-wchar so remove wchar_t usage
Use uint16_t as char16_t can be up to 32bits
Fixesncroxon/gnu-efi#16
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
It seems that while Visual Studio can support the C23 standard, Microsoft didn't get the memo
about no longer requiring stdbool.h for true/false, so add an exception for that.
Also harmonize the inclusion of stdint.h for IA32 and IA64 so that, just like for other archs,
it is not limited to GNU-like compilers only.
Signed-off-by: Pete Batard <pete@akeo.ie>
The RISCV64 toolchain does not support 16-bit variable relocation from assembly,
and even if it did support relocations, it would not properly set the subsystem
from --defsym. So we add an extra step on RISCV64, post objcopy, to set the field
manually (using dd and /bin/echo to output the relevant byte, as GNU Make's echo
does not support -ne).
Closesncroxon/gnu-efi#27.
Signed-off-by: Pete Batard <pete@akeo.ie>
Commit 625bdb6368 reorganized the apps list but
also duplicated route80h.efi so remove the extra one, as having two instances
produces an error when running 'make install'.
Signed-off-by: Pete Batard <pete@akeo.ie>
This is similar to using automake's silent rules and, just as with automake,
can be disabled by invoking 'make V=1'.
Signed-off-by: Pete Batard <pete@akeo.ie>
* Add efi_machine_type_name and gnu_efi_arch from fwupd-efi
* Add gnu_efi_default_is_objcopy so downstreams know if the crt0 goes objcopy
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This makes the apps/*.efi files available for download and testing after each build.
Also clean up the GitHub Actions workflows a little bit.
Signed-off-by: Pete Batard <pete@akeo.ie>
LFCR results in unwanted blank lines being added on serial output.
CRLF is what UEFI actually uses.
Also fix unneeded CR added to Print() optput in tcc.c.
These fixes are needed to to use these application for build time tests.
Signed-off-by: Pete Batard <pete@akeo.ie>
The EFI subsystem and application entrypoint were not being set for MinGW builds
and we don't need to go through objcopy either, so fix that.
Also make sure that the link options can be understood by the compiler, which
is what we use for linking, and remove the extra GNU_EFI_USE_MS_ABI, that was
already automatically added.
Signed-off-by: Pete Batard <pete@akeo.ie>
To builds the apps with MinGW, the CRT0 library must be ignored because
it is ELF specific and we don't need to go through ELF relocations.
We also apply the GNU_EFI_USE_MS_ABI (since we have it), remove the -z
flags, that are invalid in MinGW, and clean up the apps Makefile.
Note that setjump and debughook are excluded from MinGW builds as they
use constructs that are not available there.
Signed-off-by: Pete Batard <pete@akeo.ie>
On ARM32 only, it appears that whenever Visual Studio inlines the FloatToString()
call (which it does for Release builds), the resulting executable produces an
"Undefined OpCode Exception" on Print() invocation, regardless of whether there
is an actual float to string conversion occurring there.
To work around this, add an explicit clause to prevent inlining, and do so on all
platform just in case.
Signed-off-by: Pete Batard <pete@akeo.ie>
Guard the macros by the compilers they should explicitly apply to and
add a #error in case the compiler has no alignment directive defined,
as ignoring alignment is likely to produce runtime errors.
Also prefer _MSC_VER to _MSC_EXTENSIONS, as _MSC_EXTENSIONS may not
always be defined by the MSVC compiler.
Signed-off-by: Pete Batard <pete@akeo.ie>