[coreboot] New patch to review for coreboot: e0eb602 cbmem compilation needs to use the hardened toolchain

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Nov 7 03:56:03 CET 2012

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


commit e0eb6023ac0509612f9faf7daee2939c0459e798
Author: Vadim Bendebury <vbendeb at chromium.org>
Date:   Fri Oct 19 10:57:18 2012 -0700

    cbmem compilation needs to use the hardened toolchain
    The appropriate compiler (provided by the build system) is used to
    ensure proper toolchain options are used.
    cbmem.c is being modified to suppress pointer to integer typecast
    Change-Id: Ibab2faacbd7bdfcf617ce9ea4296ebe7d7b64562
    Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
 util/cbmem/Makefile | 15 +++++++--------
 util/cbmem/cbmem.c  |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/util/cbmem/Makefile b/util/cbmem/Makefile
index 3541e90..bf74e08 100644
--- a/util/cbmem/Makefile
+++ b/util/cbmem/Makefile
@@ -19,17 +19,16 @@
 PROGRAM = cbmem
 ROOT = ../../src
-CC      = gcc
-CFLAGS  = -O2 -Wall -Werror -iquote $(ROOT)/include \
-	-iquote $(ROOT)/src/arch/x86
+CC     = $(CROSS_COMPILE)gcc
+CFLAGS ?= -O2
+CFLAGS += -Wall -Werror
+CPPFLAGS += -iquote $(ROOT)/include -iquote $(ROOT)/src/arch/x86
-all: dep $(PROGRAM)
+all: $(PROGRAM)
-	$(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
 	rm -f $(PROGRAM) *.o *~
@@ -37,9 +36,9 @@ clean:
 distclean: clean
 	rm -f .dependencies
 	@$(CC) $(CFLAGS) -MM *.c > .dependencies
-.PHONY: all clean distclean dep
+.PHONY: all clean distclean
 -include .dependencies
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index ff411db..31950e2 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -125,7 +125,7 @@ static const struct timestamp_table *find_tstamps(u64 address)
 				int new_size;
 				struct timestamp_table *tst_p;
 				u32 stamp_addr = (u32)
-					((u64)cbmr_p->cbmem_addr);
+					((uintptr_t)(cbmr_p->cbmem_addr));
 				readmem(buf, stamp_addr,
 					sizeof(struct timestamp_table));

More information about the coreboot mailing list