[Skiboot] [PATCH 08/34] Build host programs (and checks) with debug enabled

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Jul 24 09:27:02 AEST 2016


This enables memory poisoning in allocations and list checking
among other things.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 Makefile.main            | 1 +
 core/test/Makefile.check | 2 ++
 core/test/run-device.c   | 1 -
 core/test/stubs.c        | 2 ++
 hdata/test/stubs.c       | 2 ++
 5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.main b/Makefile.main
index 03ae972..bd5295f 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -39,6 +39,7 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
 	  $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \
 	  $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \
 	  $(call try-cflag,$(HOSTCC),-Wstack-usage=1024)
+HOSTCFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
 
 VALGRIND=valgrind -q --show-reachable=yes --error-exitcode=99
 
diff --git a/core/test/Makefile.check b/core/test/Makefile.check
index b24bc21..27520a6 100644
--- a/core/test/Makefile.check
+++ b/core/test/Makefile.check
@@ -17,6 +17,8 @@ CORE_TEST := core/test/run-device \
 	core/test/run-timebase \
 	core/test/run-timer
 
+HOSTCFLAGS+=-I . -I include
+
 CORE_TEST_NOSTUB := core/test/run-console-log
 CORE_TEST_NOSTUB += core/test/run-console-log-buf-overrun
 CORE_TEST_NOSTUB += core/test/run-console-log-pr_fmt
diff --git a/core/test/run-device.c b/core/test/run-device.c
index 61ecf84..3da4a2f 100644
--- a/core/test/run-device.c
+++ b/core/test/run-device.c
@@ -31,7 +31,6 @@ static inline bool fake_is_rodata(const void *p)
 #define zalloc(bytes) calloc((bytes), 1)
 
 #include "../device.c"
-#include "../../ccan/list/list.c" /* For list_check */
 #include <assert.h>
 #include "../../test/dt_common.c"
 
diff --git a/core/test/stubs.c b/core/test/stubs.c
index 33a3385..39ff18d 100644
--- a/core/test/stubs.c
+++ b/core/test/stubs.c
@@ -17,6 +17,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#include "../../ccan/list/list.c"
+
 void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
 
 #ifndef pr_fmt
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index e72b683..9687b31 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -17,6 +17,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#include "../../ccan/list/list.c"
+
 void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
 
 #ifndef pr_fmt
-- 
2.7.4



More information about the Skiboot mailing list