public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/1] StandaloneMmPkg: Support CLANGPDB builds
@ 2021-10-14 19:05 Marvin Häuser
  2021-10-14 19:05 ` [PATCH v2 1/1] " Marvin Häuser
  0 siblings, 1 reply; 4+ messages in thread
From: Marvin Häuser @ 2021-10-14 19:05 UTC (permalink / raw)
  To: devel

V2: Update patch to account for ARM support

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.

Marvin Häuser (1):
  StandaloneMmPkg: Support CLANGPDB builds

 StandaloneMmPkg/Core/StandaloneMmCore.inf                                         | 12 ++++++++++--
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf |  9 ++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/1] StandaloneMmPkg: Support CLANGPDB builds
  2021-10-14 19:05 [PATCH v2 0/1] StandaloneMmPkg: Support CLANGPDB builds Marvin Häuser
@ 2021-10-14 19:05 ` Marvin Häuser
  2021-10-18  1:18   ` [edk2-devel] " Steven Shi
  0 siblings, 1 reply; 4+ messages in thread
From: Marvin Häuser @ 2021-10-14 19:05 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh,
	Vitaly Cheptsov, Steven Shi, Jiyang Yang

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.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Cc: Steven Shi <steven.shi@intel.com>
Cc: Jiyang Yang <jiyangx.yang@intel.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
---
 StandaloneMmPkg/Core/StandaloneMmCore.inf                                         | 12 ++++++++++--
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf |  9 ++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index 56042b7b39f4..c44b9ff33303 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -76,6 +76,14 @@ [Guids]
   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 1762586cfa02..75cfb98c0e75 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -54,5 +54,12 @@ [Guids]
 [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.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Support CLANGPDB builds
  2021-10-14 19:05 ` [PATCH v2 1/1] " Marvin Häuser
@ 2021-10-18  1:18   ` Steven Shi
  2021-10-18 13:52     ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Shi @ 2021-10-18  1:18 UTC (permalink / raw)
  To: Ard Biesheuvel, devel@edk2.groups.io, mhaeuser@posteo.de
  Cc: Sami Mujawar, Yao, Jiewen, Supreeth Venkatesh, Vitaly Cheptsov,
	Yang, JiyangX

Acked-by: Shi Steven <steven.shi@intel.com>


Hello Ard,
Could you review and check-in this patch? It blocks our clang build.


Thanks
Steven Shi


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marvin
> Häuser
> Sent: Friday, October 15, 2021 3:06 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth
> Venkatesh <supreeth.venkatesh@arm.com>; Vitaly Cheptsov
> <vit9696@protonmail.com>; Shi, Steven <steven.shi@intel.com>; Yang,
> JiyangX <jiyangx.yang@intel.com>
> Subject: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Support
> CLANGPDB builds
> 
> 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.
> 
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Vitaly Cheptsov <vit9696@protonmail.com>
> Cc: Steven Shi <steven.shi@intel.com>
> Cc: Jiyang Yang <jiyangx.yang@intel.com>
> Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
> ---
>  StandaloneMmPkg/Core/StandaloneMmCore.inf                                         | 12
> ++++++++++--
> 
> StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmC
> oreEntryPoint.inf |  9 ++++++++-
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf
> b/StandaloneMmPkg/Core/StandaloneMmCore.inf
> index 56042b7b39f4..c44b9ff33303 100644
> --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
> @@ -76,6 +76,14 @@ [Guids]
>    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/StandaloneMm
> CoreEntryPoint.inf
> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> CoreEntryPoint.inf
> index 1762586cfa02..75cfb98c0e75 100644
> ---
> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> CoreEntryPoint.inf
> +++
> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> CoreEntryPoint.inf
> @@ -54,5 +54,12 @@ [Guids]
>  [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.31.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Support CLANGPDB builds
  2021-10-18  1:18   ` [edk2-devel] " Steven Shi
@ 2021-10-18 13:52     ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2021-10-18 13:52 UTC (permalink / raw)
  To: edk2-devel-groups-io, Shi, Steven
  Cc: Ard Biesheuvel, mhaeuser@posteo.de, Sami Mujawar, Yao, Jiewen,
	Supreeth Venkatesh, Vitaly Cheptsov, Yang, JiyangX

On Mon, 18 Oct 2021 at 03:18, Steven Shi <steven.shi@intel.com> wrote:
>
> Acked-by: Shi Steven <steven.shi@intel.com>
>
>
> Hello Ard,
> Could you review and check-in this patch? It blocks our clang build.
>
>

Merged as #2077

Thanks,
Ard.


>
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marvin
> > Häuser
> > Sent: Friday, October 15, 2021 3:06 AM
> > To: devel@edk2.groups.io
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> > <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth
> > Venkatesh <supreeth.venkatesh@arm.com>; Vitaly Cheptsov
> > <vit9696@protonmail.com>; Shi, Steven <steven.shi@intel.com>; Yang,
> > JiyangX <jiyangx.yang@intel.com>
> > Subject: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Support
> > CLANGPDB builds
> >
> > 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.
> >
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> > Cc: Vitaly Cheptsov <vit9696@protonmail.com>
> > Cc: Steven Shi <steven.shi@intel.com>
> > Cc: Jiyang Yang <jiyangx.yang@intel.com>
> > Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
> > ---
> >  StandaloneMmPkg/Core/StandaloneMmCore.inf                                         | 12
> > ++++++++++--
> >
> > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmC
> > oreEntryPoint.inf |  9 ++++++++-
> >  2 files changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf
> > b/StandaloneMmPkg/Core/StandaloneMmCore.inf
> > index 56042b7b39f4..c44b9ff33303 100644
> > --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
> > +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
> > @@ -76,6 +76,14 @@ [Guids]
> >    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/StandaloneMm
> > CoreEntryPoint.inf
> > b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> > CoreEntryPoint.inf
> > index 1762586cfa02..75cfb98c0e75 100644
> > ---
> > a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> > CoreEntryPoint.inf
> > +++
> > b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
> > CoreEntryPoint.inf
> > @@ -54,5 +54,12 @@ [Guids]
> >  [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.31.1
> >
> >
> >
> >
> >
>
>
>
> 
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-18 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-14 19:05 [PATCH v2 0/1] StandaloneMmPkg: Support CLANGPDB builds Marvin Häuser
2021-10-14 19:05 ` [PATCH v2 1/1] " Marvin Häuser
2021-10-18  1:18   ` [edk2-devel] " Steven Shi
2021-10-18 13:52     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox