From 72a332ce590388c5586a6a09aaea63d77f68192b Mon Sep 17 00:00:00 2001 From: Mike Beaton Date: Tue, 26 Nov 2024 09:49:56 +0000 Subject: [PATCH] Build: Add /wd4324 to MSFT:*_CC_FLAGS for VS2019 BASE_ALIGNAS Without this flag MSVC produces spurious warning C4324 when the macro is working as intended. Add static assert to OcBlitLib.c which fails without this support. --- Library/OcBlitLib/OcBlitLib.c | 2 ++ OpenCorePkg.dsc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Library/OcBlitLib/OcBlitLib.c b/Library/OcBlitLib/OcBlitLib.c index 73472a5e166..5b5549c3b28 100644 --- a/Library/OcBlitLib/OcBlitLib.c +++ b/Library/OcBlitLib/OcBlitLib.c @@ -612,6 +612,8 @@ OcBlitConfigure ( INT8 PixelShl[4]; INT8 PixelShr[4]; + STATIC_ASSERT (sizeof (OC_BLIT_CONFIGURE) % 64 == 0, "Incorrect alignment of OC_BLIT_CONFIGURE"); + if (ConfigureSize == NULL) { return RETURN_INVALID_PARAMETER; } diff --git a/OpenCorePkg.dsc b/OpenCorePkg.dsc index d5d157a6357..74fd24887fa 100755 --- a/OpenCorePkg.dsc +++ b/OpenCorePkg.dsc @@ -439,9 +439,9 @@ CLANGGCC:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -fstack-protector-strong -mstack-protector-guard=global -ftrivial-auto-var-init=pattern CLANGGCC:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -fstack-protector-strong -mstack-protector-guard=global -ftrivial-auto-var-init=pattern CLANGGCC:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -fstack-protector-strong -mstack-protector-guard=global -ftrivial-auto-var-init=pattern - MSFT:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4723 /GS /kernel - MSFT:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4723 /GS /kernel - MSFT:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4723 /GS /kernel + MSFT:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4324 /wd4723 /GS /kernel + MSFT:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4324 /wd4723 /GS /kernel + MSFT:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) /wd4324 /wd4723 /GS /kernel XCODE:DEBUG_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -fstack-protector-strong -ftrivial-auto-var-init=pattern XCODE:NOOPT_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -fstack-protector-strong -ftrivial-auto-var-init=pattern XCODE:RELEASE_*_*_CC_FLAGS = $(OCPKG_BUILD_OPTIONS_GEN) $(OCPKG_ANAL_OPTIONS_GEN) -Oz -flto -fstack-protector-strong -ftrivial-auto-var-init=pattern