From 5454dd510f7414989440988c3df85d9bef6852c2 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Sun, 20 Nov 2016 18:31:35 +0000 Subject: 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. --- Makefile.common | 10 ++++++++-- 1 file 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 -- cgit 1.4.1