Skip to content

Commit

Permalink
StandaloneMmPkg: Support CLANGPDB builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Shi Steven <[email protected]>
  • Loading branch information
mhaeuser authored and mergify[bot] committed Oct 18, 2021
1 parent f10a112 commit 2108698
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 10 additions & 2 deletions StandaloneMmPkg/Core/StandaloneMmCore.inf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2108698

Please sign in to comment.