* [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain @ 2020-02-04 4:54 Liming Gao 2020-02-04 12:02 ` [edk2-devel] " Laszlo Ersek 2020-02-06 10:01 ` Bob Feng 0 siblings, 2 replies; 7+ messages in thread From: Liming Gao @ 2020-02-04 4:54 UTC (permalink / raw) To: devel; +Cc: Bob Feng BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 This option is required to make GCC49 tool chain work with the high version GCC compiler. Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> --- 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_def.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 = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) -- 2.24.1.windows.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 4:54 [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain Liming Gao @ 2020-02-04 12:02 ` Laszlo Ersek 2020-02-04 12:52 ` Liming Gao 2020-02-06 10:01 ` Bob Feng 1 sibling, 1 reply; 7+ messages in thread From: Laszlo Ersek @ 2020-02-04 12:02 UTC (permalink / raw) To: devel, liming.gao; +Cc: Bob Feng, Ard Biesheuvel (+Ard) On 02/04/20 05:54, Liming Gao wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 > This option is required to make GCC49 tool chain work with the high > version GCC compiler. > > Cc: Bob Feng <bob.c.feng@intel.com> > Signed-off-by: Liming Gao <liming.gao@intel.com> > --- > 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_def.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 = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) > DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) > > -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) > +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie > DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) > DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable > @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) > DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) > > -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie > +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) > DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) > DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) > - What has changed relative to commit 11d0cd23dd1b ("BaseTools/tools_def IA32: drop -no-pie linker option for GCC49", 2018-06-18)? - Also, if we are reverting one half of 11d0cd23dd1b (the compiler flags), shouldn't we then revert the other half too (the linker flags)? - 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. Ah, indeed, I need only look at TianoCore#2502: "GCC49 tool chain meets with the build failure when GCC7.4 compiler". 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? Thanks Laszlo ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 12:02 ` [edk2-devel] " Laszlo Ersek @ 2020-02-04 12:52 ` Liming Gao 2020-02-04 16:21 ` Michael D Kinney 2020-02-04 18:34 ` Laszlo Ersek 0 siblings, 2 replies; 7+ messages in thread From: Liming Gao @ 2020-02-04 12:52 UTC (permalink / raw) To: Laszlo Ersek, devel@edk2.groups.io Cc: Feng, Bob C, Ard Biesheuvel, Gao, Liming Laszlo: > -----Original Message----- > From: Laszlo Ersek <lersek@redhat.com> > Sent: Tuesday, February 4, 2020 8:02 PM > To: devel@edk2.groups.io; Gao, Liming <liming.gao@intel.com> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org> > Subject: Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain > > (+Ard) > > On 02/04/20 05:54, Liming Gao wrote: > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 > > This option is required to make GCC49 tool chain work with the high > > version GCC compiler. > > > > Cc: Bob Feng <bob.c.feng@intel.com> > > Signed-off-by: Liming Gao <liming.gao@intel.com> > > --- > > 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_def.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 = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat > > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) > > DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) > > > > -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) > > +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie > > DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) > > DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 > > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 > DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable > > @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) > > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) > > DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) > > > > -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie > > +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) > > DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) > > DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) > > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) > > > > - What has changed relative to commit 11d0cd23dd1b ("BaseTools/tools_def > IA32: drop -no-pie linker option for GCC49", 2018-06-18)? > > - 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 the 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 Is in GCC ARM and AARCH64 arch. So, I think this change is enough. > > - 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. > > Ah, indeed, I need only look at TianoCore#2502: > > "GCC49 tool chain meets with the build failure when GCC7.4 compiler". > > 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. GCC49 is the tool chain without LTO enable. GCC5 is the tool chain with LTO. So, they are for two different GCC setting. They should both support 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 tool chain name brings a little confuse. I will add more detail info in tools_def.txt for them. Thanks Liming > > Thanks > Laszlo ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 12:52 ` Liming Gao @ 2020-02-04 16:21 ` Michael D Kinney 2020-02-05 9:30 ` Liming Gao 2020-02-04 18:34 ` Laszlo Ersek 1 sibling, 1 reply; 7+ messages in thread From: Michael D Kinney @ 2020-02-04 16:21 UTC (permalink / raw) To: devel@edk2.groups.io, Gao, Liming, Laszlo Ersek, Kinney, Michael D Cc: Feng, Bob C, Ard Biesheuvel Liming, Can you please provide a few more details on the failure. For the UnitTestFrameworkPkg patch set, I had to add the following to get host based unit test applications to build and run. I was seeing link failures between FW libs and host libs when building the POSIX host application. [BuildOptions] GCC:*_*_*_CC_FLAGS = -fno-pie I think with the proposed change below, I could remove this. Do you agree? Thanks, Mike > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On > Behalf Of Liming Gao > Sent: Tuesday, February 4, 2020 4:52 AM > To: Laszlo Ersek <lersek@redhat.com>; > devel@edk2.groups.io > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard Biesheuvel > <ard.biesheuvel@linaro.org>; Gao, Liming > <liming.gao@intel.com> > Subject: Re: [edk2-devel] [Patch] BaseTools > tools_def.template: Add back -fno-pie option in GCC49 > tool chain > > Laszlo: > > > -----Original Message----- > > From: Laszlo Ersek <lersek@redhat.com> > > Sent: Tuesday, February 4, 2020 8:02 PM > > To: devel@edk2.groups.io; Gao, Liming > <liming.gao@intel.com> > > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard > Biesheuvel <ard.biesheuvel@linaro.org> > > Subject: Re: [edk2-devel] [Patch] BaseTools > tools_def.template: Add back -fno-pie option in GCC49 > tool chain > > > > (+Ard) > > > > On 02/04/20 05:54, Liming Gao wrote: > > > BZ: > https://bugzilla.tianocore.org/show_bug.cgi?id=2502 > > > This option is required to make GCC49 tool chain > work with the high > > > version GCC compiler. > > > > > > Cc: Bob Feng <bob.c.feng@intel.com> > > > Signed-off-by: Liming Gao <liming.gao@intel.com> > > > --- > > > 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_def.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 = > DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat > > > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = > DEF(GCC_AARCH64_ASLDLINK_FLAGS) > > > DEFINE GCC48_ASLCC_FLAGS = > DEF(GCC_ASLCC_FLAGS) > > > > > > -DEFINE GCC49_IA32_CC_FLAGS = > DEF(GCC48_IA32_CC_FLAGS) > > > +DEFINE GCC49_IA32_CC_FLAGS = > DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie > > > DEFINE GCC49_X64_CC_FLAGS = > DEF(GCC48_X64_CC_FLAGS) > > > DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib - > Wl,-n,-q,--gc-sections -z common-page-size=0x40 > > > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = > DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,-- > defsym=PECOFF_HEADER_SIZE=0 > > DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,-- > entry,ReferenceAcpiTable -u ReferenceAcpiTable > > > @@ -1997,7 +1997,7 @@ DEFINE > GCC49_ARM_ASLDLINK_FLAGS = > DEF(GCC48_ARM_ASLDLINK_FLAGS) > > > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = > DEF(GCC48_AARCH64_ASLDLINK_FLAGS) > > > DEFINE GCC49_ASLCC_FLAGS = > DEF(GCC48_ASLCC_FLAGS) > > > > > > -DEFINE GCC5_IA32_CC_FLAGS = > DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie > > > +DEFINE GCC5_IA32_CC_FLAGS = > DEF(GCC49_IA32_CC_FLAGS) > > > DEFINE GCC5_X64_CC_FLAGS = > DEF(GCC49_X64_CC_FLAGS) > > > DEFINE GCC5_IA32_X64_DLINK_COMMON = > DEF(GCC49_IA32_X64_DLINK_COMMON) > > > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = > DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) > > > > > > > - What has changed relative to commit 11d0cd23dd1b > ("BaseTools/tools_def > > IA32: drop -no-pie linker option for GCC49", 2018-06- > 18)? > > > > - 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 the 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 > Is in GCC ARM and AARCH64 arch. So, I think this change > is enough. > > > > > - 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. > > > > Ah, indeed, I need only look at TianoCore#2502: > > > > "GCC49 tool chain meets with the build failure when > GCC7.4 compiler". > > > > 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. > GCC49 is the tool chain without LTO enable. GCC5 is the > tool chain with LTO. > So, they are for two different GCC setting. They should > both support > 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 tool chain > name brings a little confuse. I will add more detail > info in tools_def.txt for them. > > Thanks > Liming > > > > Thanks > > Laszlo > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 16:21 ` Michael D Kinney @ 2020-02-05 9:30 ` Liming Gao 0 siblings, 0 replies; 7+ messages in thread From: Liming Gao @ 2020-02-05 9:30 UTC (permalink / raw) To: Kinney, Michael D, devel@edk2.groups.io, Laszlo Ersek Cc: Feng, Bob C, Ard Biesheuvel Mike: GCC IA32 arch requires -fno-pie option. You can check the commit c25d3905523ae4961bb039b1aba597983f7e3e4e "BaseTools/tools_def IA32: disable PIE code generation explicitly". GCC X64 arch requires -fpie option. You can check the commit f49513f666ed25d24bdf3a02a1fdb5d18ae081c0 " BaseTools/tools_def: switch GCC/X64 to the PIE small model". This patch is to add back -fno-pie option for GCC IA32 arch. GCC X64 arch still requires -fpie option. So, your change is still required for X64 host. Thanks Liming > -----Original Message----- > From: Kinney, Michael D <michael.d.kinney@intel.com> > Sent: Wednesday, February 5, 2020 12:22 AM > To: devel@edk2.groups.io; Gao, Liming <liming.gao@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kinney, Michael D > <michael.d.kinney@intel.com> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org> > Subject: RE: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain > > Liming, > > Can you please provide a few more details on the failure. > > For the UnitTestFrameworkPkg patch set, I had to add the > following to get host based unit test applications to build > and run. I was seeing link failures between FW libs and > host libs when building the POSIX host application. > > [BuildOptions] > GCC:*_*_*_CC_FLAGS = -fno-pie > > I think with the proposed change below, I could remove > this. Do you agree? > > Thanks, > > Mike > > > > -----Original Message----- > > From: devel@edk2.groups.io <devel@edk2.groups.io> On > > Behalf Of Liming Gao > > Sent: Tuesday, February 4, 2020 4:52 AM > > To: Laszlo Ersek <lersek@redhat.com>; > > devel@edk2.groups.io > > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard Biesheuvel > > <ard.biesheuvel@linaro.org>; Gao, Liming > > <liming.gao@intel.com> > > Subject: Re: [edk2-devel] [Patch] BaseTools > > tools_def.template: Add back -fno-pie option in GCC49 > > tool chain > > > > Laszlo: > > > > > -----Original Message----- > > > From: Laszlo Ersek <lersek@redhat.com> > > > Sent: Tuesday, February 4, 2020 8:02 PM > > > To: devel@edk2.groups.io; Gao, Liming > > <liming.gao@intel.com> > > > Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard > > Biesheuvel <ard.biesheuvel@linaro.org> > > > Subject: Re: [edk2-devel] [Patch] BaseTools > > tools_def.template: Add back -fno-pie option in GCC49 > > tool chain > > > > > > (+Ard) > > > > > > On 02/04/20 05:54, Liming Gao wrote: > > > > BZ: > > https://bugzilla.tianocore.org/show_bug.cgi?id=2502 > > > > This option is required to make GCC49 tool chain > > work with the high > > > > version GCC compiler. > > > > > > > > Cc: Bob Feng <bob.c.feng@intel.com> > > > > Signed-off-by: Liming Gao <liming.gao@intel.com> > > > > --- > > > > 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_def.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 = > > DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat > > > > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = > > DEF(GCC_AARCH64_ASLDLINK_FLAGS) > > > > DEFINE GCC48_ASLCC_FLAGS = > > DEF(GCC_ASLCC_FLAGS) > > > > > > > > -DEFINE GCC49_IA32_CC_FLAGS = > > DEF(GCC48_IA32_CC_FLAGS) > > > > +DEFINE GCC49_IA32_CC_FLAGS = > > DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie > > > > DEFINE GCC49_X64_CC_FLAGS = > > DEF(GCC48_X64_CC_FLAGS) > > > > DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib - > > Wl,-n,-q,--gc-sections -z common-page-size=0x40 > > > > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = > > DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,-- > > defsym=PECOFF_HEADER_SIZE=0 > > > DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,-- > > entry,ReferenceAcpiTable -u ReferenceAcpiTable > > > > @@ -1997,7 +1997,7 @@ DEFINE > > GCC49_ARM_ASLDLINK_FLAGS = > > DEF(GCC48_ARM_ASLDLINK_FLAGS) > > > > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = > > DEF(GCC48_AARCH64_ASLDLINK_FLAGS) > > > > DEFINE GCC49_ASLCC_FLAGS = > > DEF(GCC48_ASLCC_FLAGS) > > > > > > > > -DEFINE GCC5_IA32_CC_FLAGS = > > DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie > > > > +DEFINE GCC5_IA32_CC_FLAGS = > > DEF(GCC49_IA32_CC_FLAGS) > > > > DEFINE GCC5_X64_CC_FLAGS = > > DEF(GCC49_X64_CC_FLAGS) > > > > DEFINE GCC5_IA32_X64_DLINK_COMMON = > > DEF(GCC49_IA32_X64_DLINK_COMMON) > > > > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = > > DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) > > > > > > > > > > - What has changed relative to commit 11d0cd23dd1b > > ("BaseTools/tools_def > > > IA32: drop -no-pie linker option for GCC49", 2018-06- > > 18)? > > > > > > - 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 the 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 > > Is in GCC ARM and AARCH64 arch. So, I think this change > > is enough. > > > > > > > > - 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. > > > > > > Ah, indeed, I need only look at TianoCore#2502: > > > > > > "GCC49 tool chain meets with the build failure when > > GCC7.4 compiler". > > > > > > 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. > > GCC49 is the tool chain without LTO enable. GCC5 is the > > tool chain with LTO. > > So, they are for two different GCC setting. They should > > both support > > 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 tool chain > > name brings a little confuse. I will add more detail > > info in tools_def.txt for them. > > > > Thanks > > Liming > > > > > > Thanks > > > Laszlo > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 12:52 ` Liming Gao 2020-02-04 16:21 ` Michael D Kinney @ 2020-02-04 18:34 ` Laszlo Ersek 1 sibling, 0 replies; 7+ messages in thread From: Laszlo Ersek @ 2020-02-04 18:34 UTC (permalink / raw) To: Gao, Liming, devel@edk2.groups.io; +Cc: Feng, Bob C, Ard Biesheuvel On 02/04/20 13:52, Gao, Liming wrote: > Laszlo: > >> -----Original Message----- >> From: Laszlo Ersek <lersek@redhat.com> >> Sent: Tuesday, February 4, 2020 8:02 PM >> To: devel@edk2.groups.io; Gao, Liming <liming.gao@intel.com> >> Cc: Feng, Bob C <bob.c.feng@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org> >> Subject: Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain >> >> (+Ard) >> >> On 02/04/20 05:54, Liming Gao wrote: >>> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 >>> This option is required to make GCC49 tool chain work with the high >>> version GCC compiler. >>> >>> Cc: Bob Feng <bob.c.feng@intel.com> >>> Signed-off-by: Liming Gao <liming.gao@intel.com> >>> --- >>> 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_def.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 = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat >>> DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) >>> DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) >>> >>> -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) >>> +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie >>> DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) >>> DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 >>> DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 >> DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable >>> @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) >>> DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) >>> DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) >>> >>> -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie >>> +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) >>> DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) >>> DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) >>> DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) >>> >> >> - What has changed relative to commit 11d0cd23dd1b ("BaseTools/tools_def >> IA32: drop -no-pie linker option for GCC49", 2018-06-18)? >> >> - 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 the 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 > Is in GCC ARM and AARCH64 arch. So, I think this change is enough. > >> >> - 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. >> >> Ah, indeed, I need only look at TianoCore#2502: >> >> "GCC49 tool chain meets with the build failure when GCC7.4 compiler". >> >> 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. > GCC49 is the tool chain without LTO enable. GCC5 is the tool chain with LTO. > So, they are for two different GCC setting. They should both support > 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 tool chain > name brings a little confuse. I will add more detail info in tools_def.txt for them. Ah right, thanks for reminding me of this! OK, I no longer object to this patch. Thanks! Laszlo ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain 2020-02-04 4:54 [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain Liming Gao 2020-02-04 12:02 ` [edk2-devel] " Laszlo Ersek @ 2020-02-06 10:01 ` Bob Feng 1 sibling, 0 replies; 7+ messages in thread From: Bob Feng @ 2020-02-06 10:01 UTC (permalink / raw) To: Gao, Liming, devel@edk2.groups.io Reviewed-by: Bob Feng <bob.c.feng@intel.com> -----Original Message----- From: Gao, Liming <liming.gao@intel.com> Sent: Tuesday, February 4, 2020 12:55 PM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@intel.com> Subject: [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 This option is required to make GCC49 tool chain work with the high version GCC compiler. Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> --- 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_def.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 = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) -- 2.24.1.windows.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-02-06 10:01 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-02-04 4:54 [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain Liming Gao 2020-02-04 12:02 ` [edk2-devel] " Laszlo Ersek 2020-02-04 12:52 ` Liming Gao 2020-02-04 16:21 ` Michael D Kinney 2020-02-05 9:30 ` Liming Gao 2020-02-04 18:34 ` Laszlo Ersek 2020-02-06 10:01 ` Bob Feng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox