diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-09-20 23:09:24 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-21 11:23:27 -0700 |
commit | 735e5a6ee2df4f04420b739b3ef05e6d1a81792a (patch) | |
tree | 0cd9e2d78054835711ee7dc46c49d4d751f3dec4 /Makefile.toolchain | |
parent | f4b65c5d950cd9c89b132b576fad77299540fb0c (diff) | |
download | chrome-ec-735e5a6ee2df4f04420b739b3ef05e6d1a81792a.tar.gz |
Define SECTION=* and SECTION_IS_* when compiling
The linker scripts are passed through the preprocessor so that
they can distinguish between RO and RW images. This change makes
the same macros available when compiling, so that code can
contain directives like
#ifdef SECTION_IS_RO
or
#define FW_SIZE_(section) CONFIG_##section##_SIZE
#define FW_SIZE(section) FW_SIZE_(section)
int size = FW_SIZE(SECTION);
BUG=none
BRANCH=none
TEST=make buildall
Nothing uses this yet, so there's no change to the images.
Change-Id: I6e03cd07c134f4b86aeddd9d516b74bbdb95b8a8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/301255
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r-- | Makefile.toolchain | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain index 9f20faff67..f01572634b 100644 --- a/Makefile.toolchain +++ b/Makefile.toolchain @@ -42,7 +42,8 @@ CFLAGS_DEFINE=-DOUTDIR=$(out)/$(BLD) -DCHIP=$(CHIP) -DBOARD_TASKFILE=$(_tsk_lst_ -DCHIP_VARIANT_$(UC_CHIP_VARIANT) -DCHIP_FAMILY_$(UC_CHIP_FAMILY) \ -DFINAL_OUTDIR=$(out) CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(CFLAGS_TEST) \ - $(EXTRA_CFLAGS) $(CFLAGS_COVERAGE) $(LATE_CFLAGS_DEFINE) + $(EXTRA_CFLAGS) $(CFLAGS_COVERAGE) $(LATE_CFLAGS_DEFINE) \ + -DSECTION_IS_$(BLD) -DSECTION=$(BLD) CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(CFLAGS_WARN) $(CFLAGS_y) CFLAGS+= -ffunction-sections -fshort-wchar CFLAGS+= -fno-delete-null-pointer-checks -fconserve-stack |