Skip to content

Commit

Permalink
Build: Apply /wd4324 to MSFT:*_CC_FLAGS to support BASE_ALIGNAS in VS…
Browse files Browse the repository at this point in the history
…2019

Add static assert to OcBlitLib.c which fails without this support.

Without this flag, msvc produces spurious warning C4324 when the macro is
working as intended.
  • Loading branch information
mikebeaton committed Nov 27, 2024
1 parent 6cb95d5 commit e51fd55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Library/OcBlitLib/OcBlitLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ OcBlitConfigure (
INT8 PixelShl[4];
INT8 PixelShr[4];

STATIC_ASSERT (sizeof (OC_BLIT_CONFIGURE) % 64 == 0, "Incorrect alignment in OC_BLIT_CONFIGURE");

if (ConfigureSize == NULL) {
return RETURN_INVALID_PARAMETER;
}
Expand Down
6 changes: 3 additions & 3 deletions OpenCorePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e51fd55

Please sign in to comment.