Patchwork patch: always build cbfstool -g; problem with segv.

login
register
about
Submitter ron minnich
Date 2009-09-16 05:30:53
Message ID <13426df10909152230q8a6f744g662070788a447293@mail.gmail.com>
Download mbox | patch
Permalink /patch/254/
State Accepted
Headers show

Comments

ron minnich - 2009-09-16 05:30:53
I'm getting this on dell s1850:

rm -f ./coreboot.rom
cat fallback/coreboot.rom > ./coreboot.rom.bootblock
./cbfs/cbfstool ./coreboot.rom create 1048576 90112 ./coreboot.rom.bootblock
./cbfs/cbfstool ./coreboot.rom add-payload /tmp/filo.elf fallback/payload
make: *** [coreboot.rom] Segmentation fault
make: *** Deleting file `coreboot.rom'

And gdb is unhappy. So here's a patch to make our life easier:
You might care about performance but in fact there's not enough of a

Patch

difference to matter or even be measured. And, when I get a segv, it's
nice to have it debuggable. And there's certainly no need to strip the
binary ...

Index: util/cbfstool/Makefile
===================================================================
--- util/cbfstool/Makefile	(revision 4636)
+++ util/cbfstool/Makefile	(working copy)
@@ -2,7 +2,9 @@ 

 HOSTCXX ?= g++
 HOSTCC ?= gcc
+CFLAGS ?= -g

+
 BINARY:=$(obj)/cbfstool

 COMMON:=common.o compress.o minilzma.o
@@ -43,9 +45,8 @@ 
 	ctags *.[ch]

 CXXFLAGS=-DCOMPACT
-CFLAGS=
-LDFLAGS=
+CFLAGS=-g
+LDFLAGS=-g

 $(obj)/cbfstool:$(COMMON)
 	$(HOSTCXX) $(LDFLAGS) -o $@ $^
-	strip $@