[coreboot-gerrit] New patch to review for coreboot: 606ffc1 Makefile.inc: Use -Og when compiling with GDB support

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Sun Mar 15 20:49:08 CET 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8689

-gerrit

commit 606ffc151cf1c2b1d3c57f979766f6da56507b08
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Sun Mar 15 00:21:17 2015 +0100

    Makefile.inc: Use -Og when compiling with GDB support
    
    From GCC's documentation:
    
    Optimize debugging experience. -Og enables optimizations that do not interfere
    with debugging. It should be the optimization level of choice for the standard
    edit-compile-debug cycle, offering a reasonable level of optimization while
    maintaining fast compilation and a good debugging experience.
    
    Change-Id: I9a3dadbf8e894cb28e29d7b2f4e9add252e7bbb3
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
    Signed-off-by: Scott Duplichan <scott at notabs.org>
---
 Makefile.inc                 |  2 +-
 src/cpu/x86/smm/Makefile.inc | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index d4748fc..412afde 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -259,7 +259,7 @@ CFLAGS_common += -Werror
 endif
 CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
 ifneq ($(GDB_DEBUG),)
-CFLAGS_common += -O0
+CFLAGS_common += -Og
 else
 CFLAGS_common += -Os
 endif
diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc
index fc6f8f3..971eacf 100644
--- a/src/cpu/x86/smm/Makefile.inc
+++ b/src/cpu/x86/smm/Makefile.inc
@@ -19,9 +19,13 @@
 
 ramstage-$(CONFIG_BACKUP_DEFAULT_SMM_REGION) += backup_default_smm.c
 
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
 $(eval $(call create_class_compiler,smm,x86_32))
 $(eval $(call create_class_compiler,smmstub,x86_32))
-
+else
+$(eval $(call create_class_compiler,smm,x86_64))
+$(eval $(call create_class_compiler,smmstub,x86_64))
+endif
 
 $(obj)/cpu/x86/smm/smm.o: $$(smm-objs) $(COMPILER_RT_smm)
 	$(LD_smm) -nostdlib -r -o $@ $(COMPILER_RT_FLAGS_smm) --start-group $(smm-objs) $(COMPILER_RT_smm) --end-group
@@ -35,7 +39,11 @@ $(obj)/cpu/x86/smm/smm_wrap: $(obj)/cpu/x86/smm/smm.o $(src)/cpu/x86/smm/$(SMM_L
 # ELF symbol names.
 $(obj)/cpu/x86/smm/smm_wrap.ramstage.o: $(obj)/cpu/x86/smm/smm_wrap
 	@printf "    OBJCOPY    $(subst $(obj)/,,$(@))\n"
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
 	cd $(obj)/cpu/x86/smm; $(OBJCOPY_smm) -I binary smm -O elf32-i386 -B i386 smm_wrap.ramstage.o
+else
+	cd $(obj)/cpu/x86/smm; $(OBJCOPY_smm) -I binary smm -O elf64-x86_64 -B x86_64 smm_wrap.ramstage.o
+endif
 
 
 ifeq ($(CONFIG_SMM_MODULES),y)
@@ -66,14 +74,22 @@ $(obj)/cpu/x86/smm/smmstub.ramstage.o: $(obj)/cpu/x86/smm/smmstub
 
 # C-based SMM handler.
 
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
 $(eval $(call rmodule_link,$(obj)/cpu/x86/smm/smm.elf, $(obj)/cpu/x86/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_32))
+else
+$(eval $(call rmodule_link,$(obj)/cpu/x86/smm/smm.elf, $(obj)/cpu/x86/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_64))
+endif
 
 $(obj)/cpu/x86/smm/smm: $(obj)/cpu/x86/smm/smm.elf.rmod
 	$(OBJCOPY_smm) -O binary $< $@
 
 $(obj)/cpu/x86/smm/smm.ramstage.o: $(obj)/cpu/x86/smm/smm
 	@printf "    OBJCOPY    $(subst $(obj)/,,$(@))\n"
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
 	cd $(dir $@); $(OBJCOPY_smm) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
+else
+	cd $(dir $@); $(OBJCOPY_smm) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
+endif
 
 else # CONFIG_SMM_MODULES
 



More information about the coreboot-gerrit mailing list