This is not a hosted environment and we should not pretend otherwise
if -ffreestanding is not supported.
With EFI strings being in UCS2, it is not supported to build without
-fshort-wchar as gcc/clang default to a w_char_t size of 4 bytes.
This also makes the charset for wide chars explicit on gcc. This way
we get a nice error message if anyone ever tries to add 💩 to strings.
compile_args = cc.get_supported_arguments(
basic_disabled_warnings +
possible_common_cc_flags + [
- '-ffreestanding',
'-fno-stack-protector',
'-fno-strict-aliasing',
'-fpic',
- '-fshort-wchar',
+ '-fwide-exec-charset=UCS2',
'-Wall',
'-Wextra',
'-Wsign-compare',
) + [
'-nostdlib',
'-std=gnu99',
+ '-ffreestanding',
+ '-fshort-wchar',
'-isystem', efi_incdir,
'-isystem', efi_incdir / gnu_efi_path_arch,
'-I', fundamental_path,