StandaloneMmPkg: Correct Build Options for CLANGPDB

This fixes StandaloneMmPkg.dsc to use GCC style syntax for
GCC and CLANGDWARF and MSVC style syntax for CLANGPDB.

It also updates StandaloneMmCore to remove GCC style syntax
to support PIE for runtime relocation when used as an application
in OP-TEE. That scenario is only supported when building an
ELF target.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This commit is contained in:
Oliver Smith-Denny 2025-12-17 15:08:27 -08:00 committed by mergify[bot]
parent 198c9bf506
commit d098c65427
2 changed files with 9 additions and 7 deletions

View file

@ -91,11 +91,13 @@
gStandaloneMmPkgTokenSpaceGuid.PcdShadowBfv ##CONSUMES
#
# This configuration fails for CLANGPDB, which does not support PIE in the GCC
# sense. Such however is required for ARM family StandaloneMmCore
# self-relocation, and thus the CLANGPDB toolchain is unsupported for AARCH64
# for this module.
# Standalone MM Core can be used as an OP-TEE trusted application and needs to do runtime
# relocation in that scenario. It needs to be built as a position independent executable (PIE)
# for this use case. However, PE targets do not support PIE, so only ELF targets
# are built with these flags and support this scenario.
#
[BuildOptions]
GCC:*_*_AARCH64_CC_FLAGS = -fpie
GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie
GCC:*_GCC_AARCH64_CC_FLAGS = -fpie
GCC:*_GCC_AARCH64_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie
GCC:*_CLANGDWARF_AARCH64_CC_FLAGS = -fpie
GCC:*_CLANGDWARF_AARCH64_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie

View file

@ -166,7 +166,7 @@
#
###################################################################################################
[BuildOptions.AARCH64]
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
GCC:*_GCC_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
GCC:*_*_*_CC_FLAGS = -mstrict-align
[BuildOptions.X64]