From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web11.26563.1685609996995946814 for ; Thu, 01 Jun 2023 01:59:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=DNB26/2W; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 5C324CD1F67D for ; Thu, 1 Jun 2023 16:59:52 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1685609992; bh=/OtcDszTyFrQCCjit24eIxDUuSO1wrRGMnXsNseJdis=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=DNB26/2WJcYFBjBc/f7Ahz231TsdObvIskODAYbCVnHxe9pH+1qyKc2r9MYv9mJ/N IZYSO9yzNH1/A0Bonm9M5Gxr6ZYjqJiICGR5iYD08fmsdME0+2P4A5HqpynOZwwQ+q aj7RNLxJHzmed4wR+kXwIxt1pG016IThdwnSn8xM= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 5791CCD1F660 for ; Thu, 1 Jun 2023 16:59:52 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 24DB2CD1F64F for ; Thu, 1 Jun 2023 16:59:52 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id AD3B0CD1F7E0 for ; Thu, 1 Jun 2023 16:59:49 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 01 Jun 2023 16:59:39 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Gerd Hoffmann'" , "'Daniel Schaefer'" , =?utf-8?Q?'Marvin_H=C3=A4user'?= , "'Rebecca Cran'" , "'Oliver Steffen'" , "'Pawel Polawski'" , "'Chao Li'" , "'Ard Biesheuvel'" , "'Bob Feng'" , "'Sunil V L'" , "'Michael D Kinney'" , "'Leif Lindholm'" , "'Dongyan Qian'" , "'Yuwei Chen'" , "'Baoqi Zhang'" , "'Zhiguang Liu'" References: <20230524140600.1432056-1-kraxel@redhat.com> <20230524140600.1432056-3-kraxel@redhat.com> <021a01d9945f$29c6f910$7d54eb30$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0g5Zue5aSNOiBbUEFUQ0ggdjYgMDIvMTFdIEJhc2VUb29sczogYWRkIC1mZGlyZWN0LWFjY2Vzcy1leHRlcm5hbC1kYXRhIHRvIGNsYW5nIHBpZSBidWlsZHM=?= Date: Thu, 1 Jun 2023 16:59:41 +0800 Message-ID: <023b01d99467$66efbc70$34cf3550$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQF/ItgcJ6hArps6mBMVmxqwH2FMDwI0FklgAdD2uz0BWVEKw6//k8Eg Sender: "gaoliming" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Ard: Thanks for your clarification. Acked-by: Liming Gao I create PR https://github.com/tianocore/edk2/pull/4462 to merge this pat= ch set.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Ard > Biesheuvel > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B46=E6=9C=881=E6=97=A5 1= 6:38 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com.= cn > =E6=8A=84=E9=80=81: Gerd Hoffmann ; Daniel Schaefer > ; Marvin H=C3=A4user ; Rebecca > Cran ; Oliver Steffen ; Pawel > Polawski ; Chao Li ; Ard > Biesheuvel ; Bob Feng ; > Sunil V L ; Michael D Kinney > ; Leif Lindholm ; > Dongyan Qian ; Yuwei Chen > ; Baoqi Zhang ; Zhiguang > Liu > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] =E5=9B=9E=E5=A4=8D: [PATCH v6 02/11]= BaseTools: add > -fdirect-access-external-data to clang pie builds >=20 > On Thu, 1 Jun 2023 at 10:01, gaoliming via groups.io > wrote: > > > > Gerd and Ard: > > I want to confirm whether this option should also be added into > CLANGPDB_X64_CC_FLAGS. > > >=20 > As far as I know, PE based toolchains assume that external accesses > are local unless the variable declaration is decorated with > __dllimport. >=20 > Also, the reason we need this is not that the codegen is incorrect, > but that it complicates ELF to PE/COFF conversion. >=20 > So I don't think this is needed for CLANGPDB >=20 >=20 >=20 > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Gerd Hoffmann > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B45=E6=9C=8824=E6=97= =A5 22:06 > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > > > =E6=8A=84=E9=80=81: Daniel Schaefer ; Marvin H= =C3=A4user > > > ; Rebecca Cran ; Oliver > Steffen > > > ; Liming Gao ; Pawel > > > Polawski ; Chao Li ; Ard > > > Biesheuvel ; Bob Feng > ; > > > Sunil V L ; Michael D Kinney > > > ; Leif Lindholm > ; > > > Dongyan Qian ; Yuwei Chen > > > ; Baoqi Zhang ; > Zhiguang > > > Liu ; Gerd Hoffmann ; Ard > > > Biesheuvel > > > =E4=B8=BB=E9=A2=98: [PATCH v6 02/11] BaseTools: add -fdirect-access-e= xternal-data to > clang > > > pie builds > > > > > > Tell clang to not use external (via got) references for data access. > > > > > > Signed-off-by: Gerd Hoffmann > > > Reviewed-by: Ard Biesheuvel > > > --- > > > BaseTools/Conf/tools_def.template | 6 +++--- > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/BaseTools/Conf/tools_def.template > > > b/BaseTools/Conf/tools_def.template > > > index 503a6687c1f0..92421e3d0118 100755 > > > --- a/BaseTools/Conf/tools_def.template > > > +++ b/BaseTools/Conf/tools_def.template > > > @@ -1921,15 +1921,15 @@ > NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS > > > =3D DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 - > > > *_CLANGDWARF_X64_ASLPP_FLAGS =3D > DEF(GCC_ASLPP_FLAGS) > > > DEF(CLANGDWARF_X64_TARGET) > > > *_CLANGDWARF_X64_VFRPP_FLAGS =3D > DEF(GCC_VFRPP_FLAGS) > > > DEF(CLANGDWARF_X64_TARGET) > > > > > > -DEBUG_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > -Oz > > > -flto DEF(CLANGDWARF_X64_TARGET) -g > > > +DEBUG_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > > > -fdirect-access-external-data -Oz -flto DEF(CLANGDWARF_X64_TARGET) > -g > > > DEBUG_CLANGDWARF_X64_DLINK_FLAGS =3D > > > DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 > -Wl,-melf_x86_64 > > > -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=3Dsmall > > > -Wl,--apply-dynamic-relocs > > > DEBUG_CLANGDWARF_X64_DLINK2_FLAGS =3D > > > DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O3 -fuse-ld=3Dlld > > > > > > -RELEASE_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > -Oz > > > -flto DEF(CLANGDWARF_X64_TARGET) > > > +RELEASE_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > > > -fdirect-access-external-data -Oz -flto DEF(CLANGDWARF_X64_TARGET) > > > RELEASE_CLANGDWARF_X64_DLINK_FLAGS =3D > > > DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 > -Wl,-melf_x86_64 > > > -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=3Dsmall > > > -Wl,--apply-dynamic-relocs > > > RELEASE_CLANGDWARF_X64_DLINK2_FLAGS =3D > > > DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O3 -fuse-ld=3Dlld > > > > > > -NOOPT_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > -O0 > > > DEF(CLANGDWARF_X64_TARGET) -g > > > +NOOPT_CLANGDWARF_X64_CC_FLAGS =3D > > > DEF(CLANGDWARF_ALL_CC_FLAGS) -m64 > > > "-DEFIAPI=3D__attribute__((ms_abi))" -mno-red-zone -mcmodel=3Dsmall -= fpie > > > -fdirect-access-external-data -O0 DEF(CLANGDWARF_X64_TARGET) -g > > > NOOPT_CLANGDWARF_X64_DLINK_FLAGS =3D > > > DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_x86_64 > > > -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=3Dsmall > > > -Wl,--apply-dynamic-relocs > > > NOOPT_CLANGDWARF_X64_DLINK2_FLAGS =3D > > > DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O0 -fuse-ld=3Dlld > > > > > > -- > > > 2.40.1 > > > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20