]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg: Support CLANGPDB builds
authorMarvin Häuser <mhaeuser@posteo.de>
Thu, 14 Oct 2021 19:05:48 +0000 (19:05 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 18 Oct 2021 13:32:39 +0000 (13:32 +0000)
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 <mhaeuser@posteo.de>
Acked-by: Shi Steven <steven.shi@intel.com>
StandaloneMmPkg/Core/StandaloneMmCore.inf
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf

index 56042b7b39f4268aff10f2bfc71b4815195d4287..c44b9ff33303c2a25b4413ed85795a0a46ae526a 100644 (file)
   gEfiEventExitBootServicesGuid\r
   gEfiEventReadyToBootGuid\r
 \r
+#\r
+# This configuration fails for CLANGPDB, which does not support PIE in the GCC\r
+# sense. Such however is required for ARM family StandaloneMmCore\r
+# self-relocation, and thus the CLANGPDB toolchain is unsupported for ARM and\r
+# AARCH64 for this module.\r
+#\r
 [BuildOptions]\r
-  GCC:*_*_*_CC_FLAGS = -fpie\r
-  GCC:*_*_*_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie\r
+  GCC:*_*_ARM_CC_FLAGS = -fpie\r
+  GCC:*_*_ARM_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie\r
+  GCC:*_*_AARCH64_CC_FLAGS = -fpie\r
+  GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,-z,text,-Bsymbolic,-pie\r
index 1762586cfa02705161525864b0d60b132f2764b9..75cfb98c0e75cd7cee2a59723035679612da4528 100644 (file)
 [FeaturePcd.ARM, FeaturePcd.AARCH64]\r
   gArmTokenSpaceGuid.PcdFfaEnable\r
 \r
+#\r
+# This configuration fails for CLANGPDB, which does not support PIE in the GCC\r
+# sense. Such however is required for ARM family StandaloneMmCore\r
+# self-relocation, and thus the CLANGPDB toolchain is unsupported for ARM and\r
+# AARCH64 for this module.\r
+#\r
 [BuildOptions]\r
-  GCC:*_*_*_CC_FLAGS = -fpie\r
+  GCC:*_*_ARM_CC_FLAGS = -fpie\r
+  GCC:*_*_AARCH64_CC_FLAGS = -fpie\r