public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, liming.gao@intel.com
Cc: Bob Feng <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
Date: Tue, 4 Feb 2020 13:02:01 +0100	[thread overview]
Message-ID: <9cfe929c-0448-d7d2-2ce1-cd491ce16083@redhat.com> (raw)
In-Reply-To: <20200204045456.241-1-liming.gao@intel.com>

(+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


  reply	other threads:[~2020-02-04 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-02-04 12:52   ` [edk2-devel] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9cfe929c-0448-d7d2-2ce1-cd491ce16083@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox