From 210869834639c1150b1f016e2022472a55cdd884 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marvin=20H=C3=A4user?= Date: Thu, 14 Oct 2021 19:05:48 +0000 Subject: [PATCH] StandaloneMmPkg: Support CLANGPDB builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently, the flag "-fpie" is passed for all builds with a GCC family toolchain, including CLANGPDB. CLANGPDB however does not support this flag as it generates PE/COFF files directly. As the flag is mostly required for ARM-specific self-relocation, drop it for other architectures and document the limitation to enable e.g. X64 CLANGPDB builds of StandaloneMmCore. Signed-off-by: Marvin Häuser Acked-by: Shi Steven --- StandaloneMmPkg/Core/StandaloneMmCore.inf | 12 ++++++++++-- .../StandaloneMmCoreEntryPoint.inf | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf index 56042b7b39..c44b9ff333 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -76,6 +76,14 @@ gEfiEventExitBootServicesGuid gEfiEventReadyToBootGuid +# +# 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 ARM and +# AARCH64 for this module. +# [BuildOptions] - GCC:*_*_*_CC_FLAGS = -fpie - GCC:*_*_*_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie + GCC:*_*_ARM_CC_FLAGS = -fpie + GCC:*_*_ARM_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie + GCC:*_*_AARCH64_CC_FLAGS = -fpie + GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf index 1762586cfa..75cfb98c0e 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf @@ -54,5 +54,12 @@ [FeaturePcd.ARM, FeaturePcd.AARCH64] gArmTokenSpaceGuid.PcdFfaEnable +# +# 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 ARM and +# AARCH64 for this module. +# [BuildOptions] - GCC:*_*_*_CC_FLAGS = -fpie + GCC:*_*_ARM_CC_FLAGS = -fpie + GCC:*_*_AARCH64_CC_FLAGS = -fpie -- 2.39.2