public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Brian J. Johnson" <brian.johnson@hpe.com>
To: <devel@edk2.groups.io>, <kraxel@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Erdem Aktas <erdemaktas@google.com>,
	"Pawel Polawski" <ppolawsk@redhat.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Yuwei Chen <yuwei.chen@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	"James Bottomley" <jejb@linux.ibm.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>, Min Xu <min.m.xu@intel.com>,
	"Brijesh Singh" <brijesh.singh@amd.com>,
	Bob Feng <bob.c.feng@intel.com>
Subject: Re: [edk2-devel] [PATCH v7 2/2] tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS
Date: Wed, 30 Nov 2022 13:28:42 -0600	[thread overview]
Message-ID: <88bbd6a4-1e6c-7916-91be-76cae167aa74@hpe.com> (raw)
In-Reply-To: <20221130094414.1983787-3-kraxel@redhat.com>

Gerd,

Sorry, gotta ask:  does this make much difference in the size of the 
compiled code?  That's a constraint on many real-hardware X64 platforms, 
especially for 32-bit code.

Brian J. Johnson

-------- Original Message --------
From: Gerd Hoffmann [mailto:kraxel@redhat.com]
Sent: Wednesday, November 30, 2022 at 3:44 AM
To: devel@edk2.groups.io
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>, Liming Gao 
<gaoliming@byosoft.com.cn>, Erdem Aktas <erdemaktas@google.com>, Pawel 
Polawski <ppolawsk@redhat.com>, Jordan Justen 
<jordan.l.justen@intel.com>, Ard Biesheuvel <ardb+tianocore@kernel.org>, 
Yuwei Chen <yuwei.chen@intel.com>, Tom Lendacky 
<thomas.lendacky@amd.com>, James Bottomley <jejb@linux.ibm.com>, Gerd 
Hoffmann <kraxel@redhat.com>, Oliver Steffen <osteffen@redhat.com>, 
Jiewen Yao <jiewen.yao@intel.com>, Min Xu <min.m.xu@intel.com>, Brijesh 
Singh <brijesh.singh@amd.com>, Bob Feng <bob.c.feng@intel.com>
Subject: [edk2-devel] [PATCH v7 2/2] tools_def: add 
-fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS

Fixes problems due to code assuming it runs with frame pointers and thus
updates rbp / ebp registers when switching stacks.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.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 73f95b2a3a9f..f1fd6a003062 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -1888,8 +1888,8 @@ DEFINE GCC_DEPS_FLAGS              = -MMD -MF $@.deps

   DEFINE GCC48_ALL_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) 
-ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
   DEFINE GCC48_IA32_X64_DLINK_COMMON   = -nostdlib 
-Wl,-n,-q,--gc-sections -z common-page-size=0x20
-DEFINE GCC48_IA32_CC_FLAGS           = DEF(GCC48_ALL_CC_FLAGS) -m32 
-march=i586 -malign-double -fno-stack-protector -D EFI32 
-fno-asynchronous-unwind-tables -Wno-address
-DEFINE GCC48_X64_CC_FLAGS            = DEF(GCC48_ALL_CC_FLAGS) -m64 
-fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" 
-maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small 
-fpie -fno-asynchronous-unwind-tables -Wno-address
+DEFINE GCC48_IA32_CC_FLAGS           = DEF(GCC48_ALL_CC_FLAGS) -m32 
-march=i586 -malign-double -fno-stack-protector -D EFI32 
-fno-asynchronous-unwind-tables -Wno-address -fno-omit-frame-pointer
+DEFINE GCC48_X64_CC_FLAGS            = DEF(GCC48_ALL_CC_FLAGS) -m64 
-fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" 
-maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small 
-fpie -fno-asynchronous-unwind-tables -Wno-address  -fno-omit-frame-pointer
   DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = 
DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u 
ReferenceAcpiTable
   DEFINE GCC48_IA32_X64_DLINK_FLAGS    = 
DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u 
$(IMAGE_ENTRY_POINT) 
-Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
   DEFINE GCC48_IA32_DLINK2_FLAGS       = 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)

-- 

                                                 Brian

--------------------------------------------------------------------

    "I love deadlines. I like the whooshing sound they make as they fly by."
                                            -- Douglas Adams


  reply	other threads:[~2022-11-30 19:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  9:44 [PATCH v7 0/2] Fix stack switching Gerd Hoffmann
2022-11-30  9:44 ` [PATCH v7 1/2] tools_def: remove GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGS Gerd Hoffmann
2022-12-07  1:34   ` 回复: [edk2-devel] " gaoliming
2022-11-30  9:44 ` [PATCH v7 2/2] tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS Gerd Hoffmann
2022-11-30 19:28   ` Brian J. Johnson [this message]
2022-12-01  8:38     ` [edk2-devel] " Gerd Hoffmann
2022-12-01 16:17       ` Brian J. Johnson
2022-12-07  1:36         ` 回复: " gaoliming
     [not found]         ` <172E5F05A68BEFC2.5063@groups.io>
2022-12-21  1:29           ` gaoliming
2022-12-21  6:26             ` Gerd Hoffmann
2022-12-22  0:44               ` 回复: " gaoliming

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=88bbd6a4-1e6c-7916-91be-76cae167aa74@hpe.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