Isaac Christensen (isaac.christensen@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7005
-gerrit
commit 00d2245275d18a2ed12c93df6f774d95bcf4957b Author: Vadim Bendebury vbendeb@chromium.org Date: Tue Apr 22 17:06:43 2014 -0700
Provide a way to compile some files with -O0 option
When preparing an image for source level debugging, it is convenient to be able to compile some modules with -O0, which makes it much easier to follow the execution flow.
This patch allows to do it by defining GDB_DEBUG=1 in the environment before invoking make. Adding this feature as a common config flag is problematic, because we don't want to compile the entire image with -O0.
Signed-off-by: Vadim Bendebury vbendeb@chromium.org Reviewed-on: https://chromium-review.googlesource.com/196359 (cherry picked from commit dde4928c045d12e502cb109015a710cd9fdf2a04)
Changed from CFLAGS to CFLAGS_common.
Change-Id: Ie0be653509509eeb64ea3a7229f54c0c812840a9 Signed-off-by: Isaac Christensen isaac.christensen@se-eng.com --- Makefile.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile.inc b/Makefile.inc index 382eead..fe04a7a 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -218,7 +218,7 @@ CPPFLAGS_common := -Isrc -Isrc/include -I$(obj) CPPFLAGS_common += -Isrc/device/oprom/include CPPFLAGS_common += -include $(src)/include/kconfig.h
-CFLAGS_common += -Os -pipe -g -nostdinc +CFLAGS_common += -pipe -g -nostdinc CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS_common += -Wstrict-aliasing -Wshadow @@ -226,6 +226,12 @@ ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) CFLAGS_common += -Werror endif CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer +ifneq ($(GDB_DEBUG),) +CFLAGS_common += -O0 +else +CFLAGS_common += -Os +endif +
additional-dirs := $(objutil)/cbfstool $(objutil)/romcc $(objutil)/ifdtool \ $(objutil)/ifdfake $(objutil)/options $(objutil)/fletcher \