From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web10.1657.1634238386010062125 for ; Thu, 14 Oct 2021 12:06:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=CctpnDb4; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id CFD8B240115 for ; Thu, 14 Oct 2021 21:06:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1634238382; bh=3ZOVweC9j2dKkb+4SSUs51x+BZMQX9jATHaSbEeJXiI=; h=From:To:Cc:Subject:Date:From; b=CctpnDb4/V1EleDa7Z3hKTWTx5wiHQ/+IgDgfBkslFhC3Oc7oykG2+uExH6gSaPbW Ku5FtF3++fli+8R5PUDF3XyqoHAFcWsXxRrz+mYKHo7KFyDEXxiiP5GEvyM8ZQYUPv SqQB/b2xcrtb+ayo1Ful6BbuxnW7cgd0hqiLyte+jXPQtitEv9rCOd5OZ4TiKWtZrX XOb6gXf4xk9JIPwb+3uvSyLch+8F1GhAE7731L+VPcODS4omhpiJqbbC6SUun67s0H XjUbbaELRcZ/A4LY2O68TXGZfjINiedHDDgHv6/jytN3eiyOHvjHj97q4q9i+ynohG w1a2s3JaeICwA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HVf553hntz6tmG; Thu, 14 Oct 2021 21:06:17 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , Vitaly Cheptsov , Steven Shi , Jiyang Yang Subject: [PATCH v2 1/1] StandaloneMmPkg: Support CLANGPDB builds Date: Thu, 14 Oct 2021 19:05:48 +0000 Message-Id: <50b75bf3cb8e49f74b5522c68fc6d4d9d48f2998.1634238146.git.mhaeuser@posteo.de> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Cc: Sami Mujawar Cc: Jiewen Yao Cc: Supreeth Venkatesh Cc: Vitaly Cheptsov Cc: Steven Shi Cc: Jiyang Yang Signed-off-by: Marvin H=C3=A4user --- StandaloneMmPkg/Core/StandaloneMmCore.inf = | 12 ++++++++++-- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPo= int.inf | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Co= re/StandaloneMmCore.inf index 56042b7b39f4..c44b9ff33303 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -76,6 +76,14 @@ [Guids] gEfiEventExitBootServicesGuid=0D gEfiEventReadyToBootGuid=0D =0D +#=0D +# This configuration fails for CLANGPDB, which does not support PIE in the= GCC=0D +# sense. Such however is required for ARM family StandaloneMmCore=0D +# self-relocation, and thus the CLANGPDB toolchain is unsupported for ARM = and=0D +# AARCH64 for this module.=0D +#=0D [BuildOptions]=0D - GCC:*_*_*_CC_FLAGS =3D -fpie=0D - GCC:*_*_*_DLINK_FLAGS =3D -Wl,-z,text,-Bsymbolic,-pie=0D + GCC:*_*_ARM_CC_FLAGS =3D -fpie=0D + GCC:*_*_ARM_DLINK_FLAGS =3D -Wl,-z,text,-Bsymbolic,-pie=0D + GCC:*_*_AARCH64_CC_FLAGS =3D -fpie=0D + GCC:*_*_AARCH64_DLINK_FLAGS =3D -Wl,-z,text,-Bsymbolic,-pie=0D diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneM= mCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/St= andaloneMmCoreEntryPoint.inf index 1762586cfa02..75cfb98c0e75 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEn= tryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEn= tryPoint.inf @@ -54,5 +54,12 @@ [Guids] [FeaturePcd.ARM, FeaturePcd.AARCH64]=0D gArmTokenSpaceGuid.PcdFfaEnable=0D =0D +#=0D +# This configuration fails for CLANGPDB, which does not support PIE in the= GCC=0D +# sense. Such however is required for ARM family StandaloneMmCore=0D +# self-relocation, and thus the CLANGPDB toolchain is unsupported for ARM = and=0D +# AARCH64 for this module.=0D +#=0D [BuildOptions]=0D - GCC:*_*_*_CC_FLAGS =3D -fpie=0D + GCC:*_*_ARM_CC_FLAGS =3D -fpie=0D + GCC:*_*_AARCH64_CC_FLAGS =3D -fpie=0D --=20 2.31.1