* [Patch] BaseTools: support the NOOPT target with the GCC tool chains
@ 2016-09-30 7:44 Yonghong Zhu
2016-09-30 10:11 ` Laszlo Ersek
2016-10-03 16:11 ` Bruce Cran
0 siblings, 2 replies; 10+ messages in thread
From: Yonghong Zhu @ 2016-09-30 7:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Laszlo Ersek
Update the tools_def.template to add NOOPT support with GCC tool chains.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Conf/tools_def.template | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 5414454..54fccec 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4767,10 +4767,11 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
*_GCC46_IA32_OBJCOPY_FLAGS =
*_GCC46_IA32_NASM_FLAGS = -f elf32
DEBUG_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os
RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
+ NOOPT_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -O0
##################
# GCC46 X64 definitions
##################
*_GCC46_X64_OBJCOPY_PATH = DEF(GCC46_X64_PREFIX)objcopy
@@ -4794,10 +4795,11 @@ RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but
*_GCC46_X64_OBJCOPY_FLAGS =
*_GCC46_X64_NASM_FLAGS = -f elf64
DEBUG_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS)
RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -O0
##################
# GCC46 ARM definitions
##################
*_GCC46_ARM_OBJCOPY_PATH = echo
@@ -4826,10 +4828,11 @@ RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-v
*_GCC46_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC46_ARM_CC_XIPFLAGS = DEF(GCC46_ARM_CC_XIPFLAGS)
DEBUG_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0
RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0
####################################################################################
#
# GCC 4.7 - This configuration is used to compile under Linux to produce
# PE/COFF binaries using GCC 4.7.
@@ -4873,10 +4876,11 @@ RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-v
*_GCC47_IA32_OBJCOPY_FLAGS =
*_GCC47_IA32_NASM_FLAGS = -f elf32
DEBUG_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os
RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
+ NOOPT_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -O0
##################
# GCC47 X64 definitions
##################
*_GCC47_X64_OBJCOPY_PATH = DEF(GCC47_X64_PREFIX)objcopy
@@ -4900,10 +4904,11 @@ RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but
*_GCC47_X64_OBJCOPY_FLAGS =
*_GCC47_X64_NASM_FLAGS = -f elf64
DEBUG_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS)
RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -O0
##################
# GCC47 ARM definitions
##################
*_GCC47_ARM_CC_PATH = ENV(GCC47_ARM_PREFIX)gcc
@@ -4931,10 +4936,11 @@ RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-v
*_GCC47_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC47_ARM_CC_XIPFLAGS = DEF(GCC47_ARM_CC_XIPFLAGS)
DEBUG_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0
RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0
##################
# GCC47 AARCH64 definitions
##################
*_GCC47_AARCH64_CC_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
@@ -4959,10 +4965,11 @@ RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-v
*_GCC47_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC47_AARCH64_CC_XIPFLAGS = DEF(GCC47_AARCH64_CC_XIPFLAGS)
DEBUG_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0
RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer
+ NOOPT_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0
####################################################################################
#
# GCC 4.8 - This configuration is used to compile under Linux to produce
# PE/COFF binaries using GCC 4.8.
@@ -5006,10 +5013,11 @@ RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s
*_GCC48_IA32_OBJCOPY_FLAGS =
*_GCC48_IA32_NASM_FLAGS = -f elf32
DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os
RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
+ NOOPT_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -O0
##################
# GCC48 X64 definitions
##################
*_GCC48_X64_OBJCOPY_PATH = DEF(GCC48_X64_PREFIX)objcopy
@@ -5033,10 +5041,11 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but
*_GCC48_X64_OBJCOPY_FLAGS =
*_GCC48_X64_NASM_FLAGS = -f elf64
DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -O0
##################
# GCC48 ARM definitions
##################
*_GCC48_ARM_CC_PATH = ENV(GCC48_ARM_PREFIX)gcc
@@ -5064,10 +5073,11 @@ RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-v
*_GCC48_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC48_ARM_CC_XIPFLAGS = DEF(GCC48_ARM_CC_XIPFLAGS)
DEBUG_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0
RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0
##################
# GCC48 AARCH64 definitions
##################
*_GCC48_AARCH64_CC_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
@@ -5092,10 +5102,11 @@ RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-v
*_GCC48_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC48_AARCH64_CC_XIPFLAGS)
DEBUG_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0
RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer
+ NOOPT_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0
####################################################################################
#
# GCC 4.9 - This configuration is used to compile under Linux to produce
# PE/COFF binaries using GCC 4.9.
@@ -5139,10 +5150,11 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
*_GCC49_IA32_OBJCOPY_FLAGS =
*_GCC49_IA32_NASM_FLAGS = -f elf32
DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os
RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
+ NOOPT_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -O0
##################
# GCC49 X64 definitions
##################
*_GCC49_X64_OBJCOPY_PATH = DEF(GCC49_X64_PREFIX)objcopy
@@ -5166,10 +5178,11 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but
*_GCC49_X64_OBJCOPY_FLAGS =
*_GCC49_X64_NASM_FLAGS = -f elf64
DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -O0
##################
# GCC49 ARM definitions
##################
*_GCC49_ARM_CC_PATH = ENV(GCC49_ARM_PREFIX)gcc
@@ -5197,10 +5210,11 @@ RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-v
*_GCC49_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
*_GCC49_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS)
DEBUG_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0
RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0
##################
# GCC49 AARCH64 definitions
##################
*_GCC49_AARCH64_CC_PATH = ENV(GCC49_AARCH64_PREFIX)gcc
@@ -5229,10 +5243,14 @@ RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-v
DEBUG_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
RELEASE_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS)
+ NOOPT_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -O0 -mcmodel=small
+ NOOPT_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
+ NOOPT_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
+
####################################################################################
#
# GCC 5 - This configuration is used to compile under Linux to produce
# PE/COFF binaries using GCC 5
#
@@ -5275,10 +5293,11 @@ RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS)
*_GCC5_IA32_OBJCOPY_FLAGS =
*_GCC5_IA32_NASM_FLAGS = -f elf32
DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os
RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
+ NOOPT_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0
##################
# GCC5 X64 definitions
##################
*_GCC5_X64_OBJCOPY_PATH = DEF(GCC5_X64_PREFIX)objcopy
@@ -5302,10 +5321,11 @@ RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-s
*_GCC5_X64_OBJCOPY_FLAGS =
*_GCC5_X64_NASM_FLAGS = -f elf64
DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS)
RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-variable
+ NOOPT_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0
##################
# GCC5 ARM definitions
##################
*_GCC5_ARM_CC_PATH = ENV(GCC5_ARM_PREFIX)gcc
@@ -5334,10 +5354,13 @@ RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-va
DEBUG_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS)
RELEASE_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable
RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
+ NOOPT_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0
+ NOOPT_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0
+
##################
# GCC5 AARCH64 definitions
##################
*_GCC5_AARCH64_CC_PATH = ENV(GCC5_AARCH64_PREFIX)gcc
*_GCC5_AARCH64_SLINK_PATH = ENV(GCC5_AARCH64_PREFIX)gcc-ar
@@ -5365,10 +5388,14 @@ RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
RELEASE_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
+ NOOPT_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small
+ NOOPT_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
+ NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
+
####################################################################################
#
# CLANG35 - This configuration is used to compile under Linux to produce
# PE/COFF binaries using the clang compiler and assembler (v3.5 and up)
# and GNU linker
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-09-30 7:44 [Patch] BaseTools: support the NOOPT target with the GCC tool chains Yonghong Zhu
@ 2016-09-30 10:11 ` Laszlo Ersek
2016-10-03 1:45 ` Bruce Cran
2016-10-03 16:11 ` Bruce Cran
1 sibling, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2016-09-30 10:11 UTC (permalink / raw)
To: Bruce Cran
Cc: Yonghong Zhu, edk2-devel, Liming Gao,
Jordan Justen (Intel address)
Bruce,
On 09/30/16 09:44, Yonghong Zhu wrote:
> Update the tools_def.template to add NOOPT support with GCC tool chains.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
> BaseTools/Conf/tools_def.template | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
Can you please test this in the environment where you wanted to use it
originally? (I assume you were using some kind of source level debugging.)
For that, you'll probably have to add NOOPT to BUILD_TARGETS in the
OvmfPkg/OvmfPkg*.dsc files. If you do that and everything works fine for
you, I'd appreciate if you could also submit the OvmfPkg patch to the list.
Thanks!
Laszlo
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 5414454..54fccec 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -4767,10 +4767,11 @@ DEFINE GCC5_AARCH64_ASLDLINK_FLAGS = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
> *_GCC46_IA32_OBJCOPY_FLAGS =
> *_GCC46_IA32_NASM_FLAGS = -f elf32
>
> DEBUG_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os
> RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
> + NOOPT_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -O0
>
> ##################
> # GCC46 X64 definitions
> ##################
> *_GCC46_X64_OBJCOPY_PATH = DEF(GCC46_X64_PREFIX)objcopy
> @@ -4794,10 +4795,11 @@ RELEASE_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os -Wno-unused-but
> *_GCC46_X64_OBJCOPY_FLAGS =
> *_GCC46_X64_NASM_FLAGS = -f elf64
>
> DEBUG_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS)
> RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -O0
>
> ##################
> # GCC46 ARM definitions
> ##################
> *_GCC46_ARM_OBJCOPY_PATH = echo
> @@ -4826,10 +4828,11 @@ RELEASE_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC46_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC46_ARM_CC_XIPFLAGS = DEF(GCC46_ARM_CC_XIPFLAGS)
>
> DEBUG_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0
> RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0
>
> ####################################################################################
> #
> # GCC 4.7 - This configuration is used to compile under Linux to produce
> # PE/COFF binaries using GCC 4.7.
> @@ -4873,10 +4876,11 @@ RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC47_IA32_OBJCOPY_FLAGS =
> *_GCC47_IA32_NASM_FLAGS = -f elf32
>
> DEBUG_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os
> RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
> + NOOPT_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -O0
>
> ##################
> # GCC47 X64 definitions
> ##################
> *_GCC47_X64_OBJCOPY_PATH = DEF(GCC47_X64_PREFIX)objcopy
> @@ -4900,10 +4904,11 @@ RELEASE_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os -Wno-unused-but
> *_GCC47_X64_OBJCOPY_FLAGS =
> *_GCC47_X64_NASM_FLAGS = -f elf64
>
> DEBUG_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS)
> RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -O0
>
> ##################
> # GCC47 ARM definitions
> ##################
> *_GCC47_ARM_CC_PATH = ENV(GCC47_ARM_PREFIX)gcc
> @@ -4931,10 +4936,11 @@ RELEASE_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC47_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC47_ARM_CC_XIPFLAGS = DEF(GCC47_ARM_CC_XIPFLAGS)
>
> DEBUG_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0
> RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0
>
> ##################
> # GCC47 AARCH64 definitions
> ##################
> *_GCC47_AARCH64_CC_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
> @@ -4959,10 +4965,11 @@ RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC47_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC47_AARCH64_CC_XIPFLAGS = DEF(GCC47_AARCH64_CC_XIPFLAGS)
>
> DEBUG_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0
> RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer
> + NOOPT_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0
>
> ####################################################################################
> #
> # GCC 4.8 - This configuration is used to compile under Linux to produce
> # PE/COFF binaries using GCC 4.8.
> @@ -5006,10 +5013,11 @@ RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s
> *_GCC48_IA32_OBJCOPY_FLAGS =
> *_GCC48_IA32_NASM_FLAGS = -f elf32
>
> DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os
> RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
> + NOOPT_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -O0
>
> ##################
> # GCC48 X64 definitions
> ##################
> *_GCC48_X64_OBJCOPY_PATH = DEF(GCC48_X64_PREFIX)objcopy
> @@ -5033,10 +5041,11 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but
> *_GCC48_X64_OBJCOPY_FLAGS =
> *_GCC48_X64_NASM_FLAGS = -f elf64
>
> DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
> RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -O0
>
> ##################
> # GCC48 ARM definitions
> ##################
> *_GCC48_ARM_CC_PATH = ENV(GCC48_ARM_PREFIX)gcc
> @@ -5064,10 +5073,11 @@ RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC48_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC48_ARM_CC_XIPFLAGS = DEF(GCC48_ARM_CC_XIPFLAGS)
>
> DEBUG_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0
> RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0
>
> ##################
> # GCC48 AARCH64 definitions
> ##################
> *_GCC48_AARCH64_CC_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
> @@ -5092,10 +5102,11 @@ RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC48_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC48_AARCH64_CC_XIPFLAGS)
>
> DEBUG_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0
> RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -fomit-frame-pointer
> + NOOPT_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0
>
> ####################################################################################
> #
> # GCC 4.9 - This configuration is used to compile under Linux to produce
> # PE/COFF binaries using GCC 4.9.
> @@ -5139,10 +5150,11 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
> *_GCC49_IA32_OBJCOPY_FLAGS =
> *_GCC49_IA32_NASM_FLAGS = -f elf32
>
> DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os
> RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
> + NOOPT_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -O0
>
> ##################
> # GCC49 X64 definitions
> ##################
> *_GCC49_X64_OBJCOPY_PATH = DEF(GCC49_X64_PREFIX)objcopy
> @@ -5166,10 +5178,11 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but
> *_GCC49_X64_OBJCOPY_FLAGS =
> *_GCC49_X64_NASM_FLAGS = -f elf64
>
> DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
> RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -O0
>
> ##################
> # GCC49 ARM definitions
> ##################
> *_GCC49_ARM_CC_PATH = ENV(GCC49_ARM_PREFIX)gcc
> @@ -5197,10 +5210,11 @@ RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-v
> *_GCC49_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
> *_GCC49_ARM_CC_XIPFLAGS = DEF(GCC49_ARM_CC_XIPFLAGS)
>
> DEBUG_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0
> RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -O0
>
> ##################
> # GCC49 AARCH64 definitions
> ##################
> *_GCC49_AARCH64_CC_PATH = ENV(GCC49_AARCH64_PREFIX)gcc
> @@ -5229,10 +5243,14 @@ RELEASE_GCC49_ARM_CC_FLAGS = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-v
> DEBUG_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
> RELEASE_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
> RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS)
>
> + NOOPT_GCC49_AARCH64_CC_FLAGS = DEF(GCC49_AARCH64_CC_FLAGS) -O0 -mcmodel=small
> + NOOPT_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
> + NOOPT_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
> +
> ####################################################################################
> #
> # GCC 5 - This configuration is used to compile under Linux to produce
> # PE/COFF binaries using GCC 5
> #
> @@ -5275,10 +5293,11 @@ RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS)
> *_GCC5_IA32_OBJCOPY_FLAGS =
> *_GCC5_IA32_NASM_FLAGS = -f elf32
>
> DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os
> RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
> + NOOPT_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0
>
> ##################
> # GCC5 X64 definitions
> ##################
> *_GCC5_X64_OBJCOPY_PATH = DEF(GCC5_X64_PREFIX)objcopy
> @@ -5302,10 +5321,11 @@ RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -Os -Wno-unused-but-s
> *_GCC5_X64_OBJCOPY_FLAGS =
> *_GCC5_X64_NASM_FLAGS = -f elf64
>
> DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS)
> RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-variable
> + NOOPT_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0
>
> ##################
> # GCC5 ARM definitions
> ##################
> *_GCC5_ARM_CC_PATH = ENV(GCC5_ARM_PREFIX)gcc
> @@ -5334,10 +5354,13 @@ RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -Wno-unused-but-set-va
> DEBUG_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS)
>
> RELEASE_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable
> RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm
>
> + NOOPT_GCC5_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0
> + NOOPT_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0
> +
> ##################
> # GCC5 AARCH64 definitions
> ##################
> *_GCC5_AARCH64_CC_PATH = ENV(GCC5_AARCH64_PREFIX)gcc
> *_GCC5_AARCH64_SLINK_PATH = ENV(GCC5_AARCH64_PREFIX)gcc-ar
> @@ -5365,10 +5388,14 @@ RELEASE_GCC5_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKS
> DEBUG_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
>
> RELEASE_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
> RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64
>
> + NOOPT_GCC5_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small
> + NOOPT_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
> + NOOPT_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0
> +
> ####################################################################################
> #
> # CLANG35 - This configuration is used to compile under Linux to produce
> # PE/COFF binaries using the clang compiler and assembler (v3.5 and up)
> # and GNU linker
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-09-30 10:11 ` Laszlo Ersek
@ 2016-10-03 1:45 ` Bruce Cran
2016-10-03 8:59 ` Laszlo Ersek
0 siblings, 1 reply; 10+ messages in thread
From: Bruce Cran @ 2016-10-03 1:45 UTC (permalink / raw)
To: Laszlo Ersek
Cc: Yonghong Zhu, edk2-devel, Liming Gao,
Jordan Justen (Intel address), andrey.warkentin
(cc'ing Andrei Warkentin)
On 9/30/2016 4:11 AM, Laszlo Ersek wrote:
> Can you please test this in the environment where you wanted to use it
> originally? (I assume you were using some kind of source level debugging.)
>
> For that, you'll probably have to add NOOPT to BUILD_TARGETS in the
> OvmfPkg/OvmfPkg*.dsc files. If you do that and everything works fine for
> you, I'd appreciate if you could also submit the OvmfPkg patch to the list.
The patch looks good, but unfortunately for some reason it breaks
debugging using Andrei's gdb_uefi.py script: loading symbols fails:
The target architecture is assumed to be i386:x86-64:intel
0x000000007e65dec8 in ?? ()
Python Exception <class 'gdb.error'> No type named
EFI_SYSTEM_TABLE_POINTER.:
/home/bcran/.gdbinit:8: Error in sourced command file:
Error occurred in Python command: No type named EFI_SYSTEM_TABLE_POINTER.
I've verified that a DEBUG build with the same git checkout does still
work. I've looked through OvmfX64.dsc and couldn't see anything that
depends on DEBUG that would be omitting stuff for NOOPT, so I'm stuck.
--
Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 1:45 ` Bruce Cran
@ 2016-10-03 8:59 ` Laszlo Ersek
2016-10-03 16:02 ` Bruce Cran
0 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2016-10-03 8:59 UTC (permalink / raw)
To: Bruce Cran
Cc: Yonghong Zhu, edk2-devel, Liming Gao,
Jordan Justen (Intel address), andrey.warkentin
On 10/03/16 03:45, Bruce Cran wrote:
> (cc'ing Andrei Warkentin)
>
> On 9/30/2016 4:11 AM, Laszlo Ersek wrote:
>> Can you please test this in the environment where you wanted to use it
>> originally? (I assume you were using some kind of source level
>> debugging.)
>>
>> For that, you'll probably have to add NOOPT to BUILD_TARGETS in the
>> OvmfPkg/OvmfPkg*.dsc files. If you do that and everything works fine for
>> you, I'd appreciate if you could also submit the OvmfPkg patch to the
>> list.
>
> The patch looks good, but unfortunately for some reason it breaks
> debugging using Andrei's gdb_uefi.py script: loading symbols fails:
>
> The target architecture is assumed to be i386:x86-64:intel
> 0x000000007e65dec8 in ?? ()
> Python Exception <class 'gdb.error'> No type named
> EFI_SYSTEM_TABLE_POINTER.:
> /home/bcran/.gdbinit:8: Error in sourced command file:
> Error occurred in Python command: No type named EFI_SYSTEM_TABLE_POINTER.
>
> I've verified that a DEBUG build with the same git checkout does still
> work. I've looked through OvmfX64.dsc and couldn't see anything that
> depends on DEBUG that would be omitting stuff for NOOPT, so I'm stuck.
>
Can you compare "DEBUG/GdbSyms.dll" with "NOOPT/GdbSyms.dll", just
visually, using "nm" and/or "readelf"? Something might stand out.
Thanks
Laszlo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 8:59 ` Laszlo Ersek
@ 2016-10-03 16:02 ` Bruce Cran
2016-10-03 16:09 ` Laszlo Ersek
0 siblings, 1 reply; 10+ messages in thread
From: Bruce Cran @ 2016-10-03 16:02 UTC (permalink / raw)
To: Laszlo Ersek
Cc: Jordan Justen (Intel address), edk2-devel, Liming Gao,
andrey.warkentin
On 10/3/2016 2:59 AM, Laszlo Ersek wrote:
> Can you compare "DEBUG/GdbSyms.dll" with "NOOPT/GdbSyms.dll", just
> visually, using "nm" and/or "readelf"? Something might stand out.
The NOOPT GdbSyms.dll file is missing the .gnu_debuglink section. It's
also missing ".LCx" (where x is 0 to 20) symbols in the .symtab section.
--
Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 16:02 ` Bruce Cran
@ 2016-10-03 16:09 ` Laszlo Ersek
2016-10-03 16:13 ` Bruce Cran
0 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2016-10-03 16:09 UTC (permalink / raw)
To: Bruce Cran, Ard Biesheuvel
Cc: Jordan Justen (Intel address), edk2-devel, Liming Gao,
andrey.warkentin
On 10/03/16 18:02, Bruce Cran wrote:
> On 10/3/2016 2:59 AM, Laszlo Ersek wrote:
>
>> Can you compare "DEBUG/GdbSyms.dll" with "NOOPT/GdbSyms.dll", just
>> visually, using "nm" and/or "readelf"? Something might stand out.
>
> The NOOPT GdbSyms.dll file is missing the .gnu_debuglink section. It's
> also missing ".LCx" (where x is 0 to 20) symbols in the .symtab section.
>
"BaseTools/Scripts/GccBase.lds" discards the gnu_debuglink section --
intentionally, from commit efe690cab3fb5 ("BaseTools GCC: add unified
GCC linker script for all archs and versions").
If this section is necessary for debugging, then why does the DEBUG
build work? In other words, why does the DEBUG build contain
gnu_debuglink despite the discard rule? Ard, any idea?
Thanks
Laszlo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-09-30 7:44 [Patch] BaseTools: support the NOOPT target with the GCC tool chains Yonghong Zhu
2016-09-30 10:11 ` Laszlo Ersek
@ 2016-10-03 16:11 ` Bruce Cran
1 sibling, 0 replies; 10+ messages in thread
From: Bruce Cran @ 2016-10-03 16:11 UTC (permalink / raw)
To: Yonghong Zhu, edk2-devel; +Cc: Laszlo Ersek, Liming Gao
On 9/30/2016 1:44 AM, Yonghong Zhu wrote:
> Update the tools_def.template to add NOOPT support with GCC tool chains.
In the section "GCC Common" there's
DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =
--add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
A NOOPT line similar to the DEBUG one needs to be added for debugging to
work.
I've verified that by adding it the reload-uefi command runs and
single-stepping works.
--
Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 16:09 ` Laszlo Ersek
@ 2016-10-03 16:13 ` Bruce Cran
2016-10-03 16:53 ` Laszlo Ersek
0 siblings, 1 reply; 10+ messages in thread
From: Bruce Cran @ 2016-10-03 16:13 UTC (permalink / raw)
To: Laszlo Ersek, Ard Biesheuvel
Cc: Jordan Justen (Intel address), edk2-devel, Liming Gao,
andrey.warkentin
On 10/3/2016 10:09 AM, Laszlo Ersek wrote:
> "BaseTools/Scripts/GccBase.lds" discards the gnu_debuglink section --
> intentionally, from commit efe690cab3fb5 ("BaseTools GCC: add unified
> GCC linker script for all archs and versions").
>
> If this section is necessary for debugging, then why does the DEBUG
> build work? In other words, why does the DEBUG build contain
> gnu_debuglink despite the discard rule? Ard, any idea?
tools_def.template contains a command to add it:
DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =
--add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
I've followed up with the original email to say that adding a NOOPT line
fixes debugging for me.
--
Bruce
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 16:13 ` Bruce Cran
@ 2016-10-03 16:53 ` Laszlo Ersek
2016-10-05 1:32 ` Zhu, Yonghong
0 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2016-10-03 16:53 UTC (permalink / raw)
To: Bruce Cran, Ard Biesheuvel
Cc: Jordan Justen (Intel address), edk2-devel, Liming Gao,
andrey.warkentin
On 10/03/16 18:13, Bruce Cran wrote:
> On 10/3/2016 10:09 AM, Laszlo Ersek wrote:
>
>> "BaseTools/Scripts/GccBase.lds" discards the gnu_debuglink section --
>> intentionally, from commit efe690cab3fb5 ("BaseTools GCC: add unified
>> GCC linker script for all archs and versions").
>>
>> If this section is necessary for debugging, then why does the DEBUG
>> build work? In other words, why does the DEBUG build contain
>> gnu_debuglink despite the discard rule? Ard, any idea?
>
> tools_def.template contains a command to add it:
>
> DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =
> --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
>
> I've followed up with the original email to say that adding a NOOPT line
> fixes debugging for me.
>
Thank you, perfect!
Laszlo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch] BaseTools: support the NOOPT target with the GCC tool chains
2016-10-03 16:53 ` Laszlo Ersek
@ 2016-10-05 1:32 ` Zhu, Yonghong
0 siblings, 0 replies; 10+ messages in thread
From: Zhu, Yonghong @ 2016-10-05 1:32 UTC (permalink / raw)
To: Laszlo Ersek, Bruce Cran, Ard Biesheuvel
Cc: Justen, Jordan L, edk2-devel@ml01.01.org, Gao, Liming,
andrey.warkentin@gmail.com, Zhu, Yonghong
Thanks Laszlo and Bruce!
I sent a V2 to add "NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug"
Best Regards,
Zhu Yonghong
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Laszlo Ersek
Sent: Tuesday, October 4, 2016 12:53 AM
To: Bruce Cran <bruce@cran.org.uk>; Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Justen, Jordan L <jordan.l.justen@intel.com>; edk2-devel@ml01.01.org; Gao, Liming <liming.gao@intel.com>; andrey.warkentin@gmail.com
Subject: Re: [edk2] [Patch] BaseTools: support the NOOPT target with the GCC tool chains
On 10/03/16 18:13, Bruce Cran wrote:
> On 10/3/2016 10:09 AM, Laszlo Ersek wrote:
>
>> "BaseTools/Scripts/GccBase.lds" discards the gnu_debuglink section --
>> intentionally, from commit efe690cab3fb5 ("BaseTools GCC: add unified
>> GCC linker script for all archs and versions").
>>
>> If this section is necessary for debugging, then why does the DEBUG
>> build work? In other words, why does the DEBUG build contain
>> gnu_debuglink despite the discard rule? Ard, any idea?
>
> tools_def.template contains a command to add it:
>
> DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =
> --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
>
> I've followed up with the original email to say that adding a NOOPT
> line fixes debugging for me.
>
Thank you, perfect!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-10-05 1:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-30 7:44 [Patch] BaseTools: support the NOOPT target with the GCC tool chains Yonghong Zhu
2016-09-30 10:11 ` Laszlo Ersek
2016-10-03 1:45 ` Bruce Cran
2016-10-03 8:59 ` Laszlo Ersek
2016-10-03 16:02 ` Bruce Cran
2016-10-03 16:09 ` Laszlo Ersek
2016-10-03 16:13 ` Bruce Cran
2016-10-03 16:53 ` Laszlo Ersek
2016-10-05 1:32 ` Zhu, Yonghong
2016-10-03 16:11 ` Bruce Cran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox