EmulatorPkg: Fix IA32 MSVC Linker Warnings

IA32 EmulatorPkg had many linker warnings because with the current
set of linker flags, the MSVC linker was expecting the __stdcall
calling convention on all entry points. This was an effect of
having /SUBSYSTEM:CONSOLE on all binaries built in EmulatorPkg; this
is only needed on WinHost, as that is what Windows launches. The linker
options are adjusted to only set /SUBSYSTEM:CONSOLE on WinHost.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit is contained in:
Oliver Smith-Denny 2025-01-07 10:10:12 -08:00 committed by mergify[bot]
parent 81ba76f7df
commit 4613eb6abc
2 changed files with 7 additions and 7 deletions

View File

@ -537,15 +537,15 @@
MSFT:NOOPT_*_*_CC_FLAGS = /Od /Oy-
GCC:DEBUG_CLANGPDB_*_CC_FLAGS =-O0 -Wno-unused-command-line-argument -Wno-incompatible-pointer-types -Wno-enum-conversion -Wno-incompatible-pointer-types -Wno-sometimes-uninitialized -Wno-constant-conversion -Wno-main-return-type
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
MSFT:DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
MSFT:NOOPT_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096
MSFT:DEBUG_*_*_DLINK_FLAGS = /BASE:0x10000
MSFT:NOOPT_*_*_DLINK_FLAGS = /BASE:0x10000
!if $(WIN_HOST_BUILD) == TRUE
#
# CLANGPDB tool chain depends on WIN_HOST_BUILD flag to generate the windows application.
#
GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
GCC:DEBUG_CLANGPDB_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
GCC:NOOPT_CLANGPDB_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000
GCC:*_CLANGPDB_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096
GCC:DEBUG_CLANGPDB_*_DLINK_FLAGS = /BASE:0x10000
GCC:NOOPT_CLANGPDB_*_DLINK_FLAGS = /BASE:0x10000
!endif

View File

@ -86,7 +86,7 @@
gEmulatorPkgTokenSpaceGuid.PcdEmuNetworkInterface|L"0"
[BuildOptions]
MSFT:*_*_*_DLINK_FLAGS == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /base:0x10000000 /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb"
MSFT:*_*_*_DLINK_FLAGS == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /base:0x10000000 /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT)
MSFT:*_*_*_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /Od /Oy- /FIAutoGen.h /EHs-c- /GF /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
MSFT:*_*_*_PP_FLAGS == /nologo /E /TC /FIAutoGen.h