From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.25991.1685608700082202969 for ; Thu, 01 Jun 2023 01:38:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eAAte2r0; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B5BA60F6B for ; Thu, 1 Jun 2023 08:38:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4EE9C4339C for ; Thu, 1 Jun 2023 08:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685608698; bh=Er8Dhx/ioFn/s/TnzCKz2rGoJzeRkMG23UangER2iNs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eAAte2r00/j13ZjeihwClgh5jPUFeKxLHkmOPivP/nM5atgs5SCKFmc6eYp0gyOFk qogWZUX4alpclTodLfN2ok/X+e83Tooed0hVtrJMXWNZWF7AUSdBGa+jScavzThlKz IHQCtwn15MfgnWvuYQoVKabgsKVX14h2qC4cb5gfYcNk0wYUPr8W9KV+jI6BBJsnah FBUBnvPJW0Y1DBoBJsIUx3HlaL6+Z9wqW5JYz2FeNk9Aoq6b092sacIRD9iD77EYuZ 6OBSIkrWLFu2Tdgdh0l/m3ZknhAhwP1Xg/wOho2DXVmujCthoCoNgGBADj044I3tc4 JzUiBqsqQnEQw== Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2af1c884b08so8208531fa.1 for ; Thu, 01 Jun 2023 01:38:18 -0700 (PDT) X-Gm-Message-State: AC+VfDyU1Z7LVXG4+BGDtvtNtlLc2slg6Qi+kc0mJb2S9DNOgWnmh1ai KNm7TZvoOi/pkiWjst8jG12cYO/zHftoi4ZBWbI= X-Google-Smtp-Source: ACHHUZ7QCZmav5ygk7DKWNBXb/rcTReWY/RhijewwXJBlSzdQwlHf5uMziB0AwKRTwqHAj8J/11SsA5t4eMPvrIo9Wg= X-Received: by 2002:a2e:a230:0:b0:2af:1460:4253 with SMTP id i16-20020a2ea230000000b002af14604253mr347190ljm.3.1685608696920; Thu, 01 Jun 2023 01:38:16 -0700 (PDT) MIME-Version: 1.0 References: <20230524140600.1432056-1-kraxel@redhat.com> <20230524140600.1432056-3-kraxel@redhat.com> <021a01d9945f$29c6f910$7d54eb30$@byosoft.com.cn> In-Reply-To: <021a01d9945f$29c6f910$7d54eb30$@byosoft.com.cn> From: "Ard Biesheuvel" Date: Thu, 1 Jun 2023 10:38:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: =?UTF-8?B?UmU6IFtlZGsyLWRldmVsXSDlm57lpI06IFtQQVRDSCB2NiAwMi8xMV0gQmFzZVRvb2xzOiBhZGQgLWZkaXJlY3QtYWNjZXNzLWV4dGVybmFsLWRhdGEgdG8gY2xhbmcgcGllIGJ1aWxkcw==?= To: devel@edk2.groups.io, gaoliming@byosoft.com.cn 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 CLANGPD= B_X64_CC_FLAGS. > As far as I know, PE based toolchains assume that external accesses are local unless the variable declaration is decorated with __dllimport. Also, the reason we need this is not that the codegen is incorrect, but that it complicates ELF to PE/COFF conversion. So I don't think this is needed for CLANGPDB > > -----=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-ext= ernal-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 -fp= ie -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 -fp= ie > > -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 -fp= ie -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 -fp= ie > > -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 -fp= ie -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 -fp= ie > > -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 > >