-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
efi_loader: support building UEFI binaries on sandbox
On the sandbox the UEFI binaries must match the host architectures. Adjust the Makefiles. Provide the PE/COFF header and relocation files. Allow building helloworld.efi on the sandbox. Signed-off-by: Heinrich Schuchardt <[email protected]>
- Loading branch information
Showing
7 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* PE/COFF header for EFI applications | ||
* | ||
* Copyright (c) 2019 Heinrich Schuchardt | ||
*/ | ||
|
||
#include <host_arch.h> | ||
|
||
#if HOST_ARCH == HOST_ARCH_X86_64 | ||
#include "../../../arch/x86/lib/crt0_x86_64_efi.S" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_X86 | ||
#include "../../../arch/x86/lib/crt0_ia32_efi.S" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_AARCH64 | ||
#include "../../../arch/arm/lib/crt0_aarch64_efi.S" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_ARM | ||
#include "../../../arch/arm/lib/crt0_arm_efi.S" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_RISCV32 | ||
#include "../../../arch/riscv/lib/crt0_riscv_efi.S" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_RISCV64 | ||
#include "../../../arch/riscv/lib/crt0_riscv_efi.S" | ||
#endif |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* position independent shared object relocator | ||
* | ||
* Copyright (c) 2019 Heinrich Schuchardt | ||
*/ | ||
|
||
#include <host_arch.h> | ||
|
||
#if HOST_ARCH == HOST_ARCH_X86_64 | ||
#include "../../../arch/x86/lib/reloc_x86_64_efi.c" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_X86 | ||
#include "../../../arch/x86/lib/reloc_ia32_efi.c" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_AARCH64 | ||
#include "../../../arch/arm/lib/reloc_aarch64_efi.c" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_ARM | ||
#include "../../../arch/arm/lib/reloc_arm_efi.c" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_RISCV32 | ||
#include "../../../arch/riscv/lib/reloc_riscv_efi.c" | ||
#endif | ||
|
||
#if HOST_ARCH == HOST_ARCH_RISCV64 | ||
#include "../../../arch/riscv/lib/reloc_riscv_efi.c" | ||
#endif |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#if 0 | ||
# SPDX SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
# Constants defining the host architecture in assembler, C, and make files. | ||
# The values are arbitrary. | ||
# | ||
# Copyright 2019 Heinrich Schuchardt <[email protected]> | ||
#endif | ||
|
||
#if 0 | ||
export HOST_ARCH_AARCH64=0xaa64 | ||
export HOST_ARCH_ARM=0x00a7 | ||
export HOST_ARCH_RISCV32=0x5032 | ||
export HOST_ARCH_RISCV64=0x5064 | ||
export HOST_ARCH_X86=0x0386 | ||
export HOST_ARCH_X86_64=0x8664 | ||
#endif | ||
|
||
#define HOST_ARCH_AARCH64 0xaa64 | ||
#define HOST_ARCH_ARM 0x00a7 | ||
#define HOST_ARCH_RISCV32 0x5032 | ||
#define HOST_ARCH_RISCV64 0x5064 | ||
#define HOST_ARCH_X86 0x0386 | ||
#define HOST_ARCH_X86_64 0x8664 |
This file contains 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