about summary refs log tree commit diff homepage
path: root/Makefile.common
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-11-20 18:31:35 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2017-01-19 11:50:41 +0000
commit5454dd510f7414989440988c3df85d9bef6852c2 (patch)
treea57dc8a710615ef760339deb45ed34ab554eb531 /Makefile.common
parent1ffef7b5a0bf78bd4b4a31c626f20e150229d814 (diff)
downloadklee-5454dd510f7414989440988c3df85d9bef6852c2.tar.gz
Fix the Autoconf/Makefile build system when building with coverage
flags.

The old build system stupidly propagates flags for the host C compiler
into the flags for the C bitcode compiler leading to unwanted
instrumentation being added to KLEE's runtime.
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.common b/Makefile.common
index a6ce34fb..0eb741ea 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -80,8 +80,14 @@ endif
 # For metaSMT
 include $(PROJ_SRC_ROOT)/MetaSMT.mk
 
-# If building KLEE with the Sanitizers don't build the runtime with it
-# because KLEE doesn't know how to handle it.
+# When building the runtime filter out unwanted flags.
+# that add instrumentatation because KLEE can't handle this.
 ifneq ("X$(MODULE_NAME)$(BYTECODE_LIBRARY)X","XX")
+  # Sanitizer flags.
   CFLAGS := $(filter-out -fsanitize=%,$(CFLAGS))
+  # Coverag flags.
+  CFLAGS := $(filter-out -fprofile-arcs,$(CFLAGS))
+  CFLAGS := $(filter-out -ftest-coverage,$(CFLAGS))
+  CFLAGS := $(filter-out -coverage,$(CFLAGS))
+  CFLAGS := $(filter-out --coverage,$(CFLAGS))
 endif