BaseTools: Adding support of building BaseTool on Windows ARM/ARM64

This change focuses on the support of building basetool natively for
Windows ARM/ARM64 host system, which will enable the ARM based platforms
to build UEFI and unit tests.

Note that the warnings due to integer conversions are suppressed for
this specific target to avoid too much local changes carried in MU. The
formal change should drop all these binaries and move to pythonic
scripts.

The binary output is tested on Windows ARM based hardware systems.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
kuqin12 2023-03-21 16:27:54 -07:00 committed by mergify[bot]
parent 79a64e73f7
commit 4b2f964749
7 changed files with 29 additions and 0 deletions

View File

@ -7,7 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -10,7 +10,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#endif
#include <assert.h>

View File

@ -11,7 +11,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#endif
#include <assert.h>

View File

@ -8,7 +8,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#endif
#include <stdio.h>

View File

@ -7,7 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -6,7 +6,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __GNUC__
#define RUNTIME_FUNCTION _WINNT_DUP_RUNTIME_FUNCTION
#include <windows.h>
#undef RUNTIME_FUNCTION
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -51,6 +51,23 @@ BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win64
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win64
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
CFLAGS = $(CFLAGS) /wd4267 /wd4244 /wd4334
!ELSEIF "$(HOST_ARCH)"=="ARM"
ARCH_INCLUDE = $(EDK2_PATH)\MdePkg\Include\Arm
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win32
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win32
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
!ELSEIF "$(HOST_ARCH)"=="AARCH64"
ARCH_INCLUDE = $(EDK2_PATH)\MdePkg\Include\AArch64
BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win64
LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win64
SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
# Note: These are bit-width conversion related warning suppressions.
CFLAGS = $(CFLAGS) /wd4267 /wd4244 /wd4334
!ELSE
!ERROR "Bad HOST_ARCH"