From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.5624.1580820732222341124 for ; Tue, 04 Feb 2020 04:52:12 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 04:52:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,401,1574150400"; d="scan'208";a="279050183" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 04 Feb 2020 04:52:10 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 4 Feb 2020 04:52:09 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 4 Feb 2020 20:52:04 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Tue, 4 Feb 2020 20:52:04 +0800 From: "Liming Gao" To: Laszlo Ersek , "devel@edk2.groups.io" CC: "Feng, Bob C" , Ard Biesheuvel , "Gao, Liming" Subject: Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain Thread-Topic: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain Thread-Index: AQHV21LoFApfrA61gkm8yraSWGLiqagK+WBQ Date: Tue, 4 Feb 2020 12:52:04 +0000 Message-ID: References: <20200204045456.241-1-liming.gao@intel.com> <9cfe929c-0448-d7d2-2ce1-cd491ce16083@redhat.com> In-Reply-To: <9cfe929c-0448-d7d2-2ce1-cd491ce16083@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Laszlo: > -----Original Message----- > From: Laszlo Ersek > Sent: Tuesday, February 4, 2020 8:02 PM > To: devel@edk2.groups.io; Gao, Liming > Cc: Feng, Bob C ; Ard Biesheuvel > Subject: Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back = -fno-pie option in GCC49 tool chain >=20 > (+Ard) >=20 > On 02/04/20 05:54, Liming Gao wrote: > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2502 > > This option is required to make GCC49 tool chain work with the high > > version GCC compiler. > > > > Cc: Bob Feng > > Signed-off-by: Liming Gao > > --- > > BaseTools/Conf/tools_def.template | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_d= ef.template > > index feee2bbf16..d02424ae44 100755 > > --- a/BaseTools/Conf/tools_def.template > > +++ b/BaseTools/Conf/tools_def.template > > @@ -1974,7 +1974,7 @@ DEFINE GCC48_ARM_ASLDLINK_FLAGS =3D DEF(GCC_= ARM_ASLDLINK_FLAGS) -Wl,--oformat > > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS =3D DEF(GCC_AARCH64_ASLDLINK_FLAG= S) > > DEFINE GCC48_ASLCC_FLAGS =3D DEF(GCC_ASLCC_FLAGS) > > > > -DEFINE GCC49_IA32_CC_FLAGS =3D DEF(GCC48_IA32_CC_FLAGS) > > +DEFINE GCC49_IA32_CC_FLAGS =3D DEF(GCC48_IA32_CC_FLAGS) -fno= -pic -fno-pie > > DEFINE GCC49_X64_CC_FLAGS =3D DEF(GCC48_X64_CC_FLAGS) > > DEFINE GCC49_IA32_X64_DLINK_COMMON =3D -nostdlib -Wl,-n,-q,--gc-sect= ions -z common-page-size=3D0x40 > > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS =3D DEF(GCC49_IA32_X64_DLINK_COMM= ON) -Wl,--defsym=3DPECOFF_HEADER_SIZE=3D0 > DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceA= cpiTable > > @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS =3D DEF(GCC4= 8_ARM_ASLDLINK_FLAGS) > > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS =3D DEF(GCC48_AARCH64_ASLDLINK_FL= AGS) > > DEFINE GCC49_ASLCC_FLAGS =3D DEF(GCC48_ASLCC_FLAGS) > > > > -DEFINE GCC5_IA32_CC_FLAGS =3D DEF(GCC49_IA32_CC_FLAGS) -fno= -pic -fno-pie > > +DEFINE GCC5_IA32_CC_FLAGS =3D DEF(GCC49_IA32_CC_FLAGS) > > DEFINE GCC5_X64_CC_FLAGS =3D DEF(GCC49_X64_CC_FLAGS) > > DEFINE GCC5_IA32_X64_DLINK_COMMON =3D DEF(GCC49_IA32_X64_DLINK_COMM= ON) > > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS =3D DEF(GCC49_IA32_X64_ASLDLINK_F= LAGS) > > >=20 > - What has changed relative to commit 11d0cd23dd1b ("BaseTools/tools_def > IA32: drop -no-pie linker option for GCC49", 2018-06-18)? >=20 > - Also, if we are reverting one half of 11d0cd23dd1b (the compiler > flags), shouldn't we then revert the other half too (the linker flags)? Yes. Half change is revert. CC_FLAGS is added back. DLINK flag is not, because GCC4.9 doesn't know the link option -no-pie. But, GCC 4.9 accepts t= he CC option -fno-pie. I verify this change. CC flags -fno-pie can resolve the build failure with = GCC7.4. I also see -fno-pie option=20 Is in GCC ARM and AARCH64 arch. So, I think this change is enough.=20 >=20 > - The commit message says, "work with the high version GCC compiler". > What does that mean? If it is 4.9.x, with x>2, then I agree the patch is > justified (because commit 11d0cd23dd1b was apparently made for 4.9.2). > But if the phrase stands for gcc8 or so (just an example), then I don't > think the patch is a good idea; users of gcc8 can just specify the GCC5 > toolchain. >=20 > Ah, indeed, I need only look at TianoCore#2502: >=20 > "GCC49 tool chain meets with the build failure when GCC7.4 compiler". >=20 > So I think this approach is wrong. Unless there is a new gcc-4.9.x > release, i.e., after gcc-4.9.2, I think we still need commit > 11d0cd23dd1b in place. And, please use GCC5 for gcc-7.4 -- is there a > problem with that? By design, GCC49 can work with the high version GCC compiler like GCC5.=20 GCC49 is the tool chain without LTO enable. GCC5 is the tool chain with LTO= .=20 So, they are for two different GCC setting. They should both support=20 high version GCC compiler. GCC49 supported GCC compiler version is from GCC= 4.9. GCC5 supported GCC compiler version is from GCC 5.0. I know GCC49 or GCC5 t= ool chain=20 name brings a little confuse. I will add more detail info in tools_def.txt = for them.=20 Thanks Liming >=20 > Thanks > Laszlo