From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by mx.groups.io with SMTP id smtpd.web12.26879.1585488120637049751 for ; Sun, 29 Mar 2020 06:22:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ispras.ru, ip: 83.149.199.45, mailfrom: cheptsov@ispras.ru) Received: from localhost.localdomain (unknown [77.232.9.83]) by mail.ispras.ru (Postfix) with ESMTPSA id 57BAFC011C; Sun, 29 Mar 2020 16:21:59 +0300 (MSK) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Andrew Fish , Laszlo Ersek , =?UTF-8?q?Marvin=20H=C3=A4user?= Subject: [PATCH 1/1] OvmfPkg: Fix SMM/RT driver section alignment for XCODE5/CLANGPDB Date: Sun, 29 Mar 2020 16:21:58 +0300 Message-Id: <20200329132158.35259-2-cheptsov@ispras.ru> X-Mailer: git-send-email 2.24.1 (Apple Git-126) In-Reply-To: <20200329132158.35259-1-cheptsov@ispras.ru> References: <20200329132158.35259-1-cheptsov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2642 This patch resolves the problem of using memory protection attributes when OVMF firmware is compiled with XCODE5 and CLANGPDB. CC: Andrew Fish CC: Laszlo Ersek CC: Marvin H=C3=A4user Signed-off-by: Vitaly Cheptsov --- OvmfPkg/OvmfPkgIa32.dsc | 6 ++++-- OvmfPkg/OvmfPkgIa32X64.dsc | 6 ++++-- OvmfPkg/OvmfPkgX64.dsc | 6 ++++-- OvmfPkg/OvmfXen.dsc | 8 ++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 19728f20b3..0aba200c2d 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -80,14 +80,16 @@ [BuildOptions] =0D [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D # Force PE/COFF sections to be aligned at 4KB boundaries to support page l= evel=0D # protection of DXE_SMM_DRIVER/SMM_CORE modules=0D [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_C= ORE]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D ##########################################################################= ######=0D diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 3c0c229e3a..eca70d64c3 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -85,14 +85,16 @@ [BuildOptions] =0D [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D # Force PE/COFF sections to be aligned at 4KB boundaries to support page l= evel=0D # protection of DXE_SMM_DRIVER/SMM_CORE modules=0D [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_C= ORE]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D ##########################################################################= ######=0D diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index f6c1d8d228..676d0ed9a6 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -85,14 +85,16 @@ [BuildOptions] =0D [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D # Force PE/COFF sections to be aligned at 4KB boundaries to support page l= evel=0D # protection of DXE_SMM_DRIVER/SMM_CORE modules=0D [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_C= ORE]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D ##########################################################################= ######=0D diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 5751ff1f03..783bac3e8b 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -82,13 +82,17 @@ [BuildOptions] =0D [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D + CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D # Force PE/COFF sections to be aligned at 4KB boundaries to support page l= evel=0D # protection of DXE_SMM_DRIVER/SMM_CORE modules=0D [BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_C= ORE]=0D GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000=0D - XCODE:*_*_*_DLINK_FLAGS =3D=0D + XCODE:*_*_*_DLINK_FLAGS =3D -seg1addr 0x1000 -segalign 0x1000=0D + XCODE:*_*_*_MTOC_FLAGS =3D -align 0x1000=0D + CLANGPDB:*_*_*_DLINK_FLAGS =3D /ALIGN:4096=0D =0D ##########################################################################= ######=0D #=0D --=20 2.24.1 (Apple Git-126)