[edk2-devel] [PATCH] StandaloneMmPkg: Support CLANGPDB X64 builds
Marvin Häuser
mhaeuser at posteo.de
Sun Aug 8 19:39:52 UTC 2021
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 AArch64-specific self-relocation,
drop it for X64 builds and document the limitation to enable X64
CLANGPDB builds of StandaloneMmCore.
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Sami Mujawar <sami.mujawar at arm.com>
Cc: Jiewen Yao <jiewen.yao at intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh at arm.com>
Cc: Vitaly Cheptsov <vit9696 at protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser at posteo.de>
---
StandaloneMmPkg/Core/StandaloneMmCore.inf | 9 +++++++--
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 7 ++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index 87bf6e9440a7..e3349fff29cc 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -76,6 +76,11 @@ [Guids]
gEfiEventExitBootServicesGuid
gEfiEventReadyToBootGuid
+#
+# This configuration fails for CLANGPDB, which does not support PIE in the GCC
+# sense. Such however is required for AArch64 StandaloneMmCore self-relocation,
+# and thus the CLANGPDB toolchain is unsupported for AArch64 for this module.
+#
[BuildOptions]
- GCC:*_*_*_CC_FLAGS = -fpie
- GCC:*_*_*_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 4fa426f58ef4..dcbb082d4ab8 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -54,5 +54,10 @@ [Guids]
[FeaturePcd.AARCH64]
gArmTokenSpaceGuid.PcdFfaEnable
+#
+# This configuration fails for CLANGPDB, which does not support PIE in the GCC
+# sense. Such however is required for AArch64 StandaloneMmCore self-relocation,
+# and thus the CLANGPDB toolchain is unsupported for AArch64 for this module.
+#
[BuildOptions]
- GCC:*_*_*_CC_FLAGS = -fpie
+ GCC:*_*_AARCH64_CC_FLAGS = -fpie
--
2.31.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78894): https://edk2.groups.io/g/devel/message/78894
Mute This Topic: https://groups.io/mt/84754068/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list