about summary refs log tree commit diff homepage
path: root/Makefile.rules
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2013-11-07 20:46:05 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2013-11-08 12:00:48 +0000
commitdbe21a488ca0f99d77df6bc1c11107b12cc00d8d (patch)
tree789f839bcb672587e6ea7cf6bfa736eae08c89c3 /Makefile.rules
parentdaa26b1240e1f17854040975f220b1d62430a8e7 (diff)
downloadklee-dbe21a488ca0f99d77df6bc1c11107b12cc00d8d.tar.gz
Fix the detection of the LLVM bitcode compiler. This is now done at KLEE
configure time, not LLVM configure time! Configure will fail without
a working LLVM bitcode compiler. The precedence of detection is as
follows:

1. Compilers set by newly added --with-llvmcc= --with-llvmcxx= configure flags.
2. Clang in LLVM build directory.
3. llvm-gcc in PATH.
4. clang in PATH.

This has been tested with llvm2.9 (llvm-gcc in PATH) and llvm3.3 (clang
built in LLVM build directory).

This addresses a major pain point for new users of KLEE who forget to
put llvm-gcc in their PATH at LLVM configure time and then are later
forced to reconfigure and rebuild LLVM just so KLEE knows the right
PATH!
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules22
1 files changed, 3 insertions, 19 deletions
diff --git a/Makefile.rules b/Makefile.rules
index be1dab5d..5e954adf 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -433,24 +433,9 @@ endif
 # LLVM Capable Compiler
 #--------------------------------------------------------------------
 
-ifeq ($(LLVMCC_OPTION),llvm-gcc)
-  LLVMCC := $(LLVMGCC)
-  LLVMCXX := $(LLVMGXX)
-else
-  ifeq ($(LLVMCC_OPTION),clang)
-    ifneq ($(CLANGPATH),)
-      LLVMCC := $(CLANGPATH)
-      LLVMCXX := $(CLANGXXPATH)
-    else
-      ifeq ($(ENABLE_BUILT_CLANG),1)
-        LLVMCC := $(LLVMToolDir)/clang
-        LLVMCXX := $(LLVMToolDir)/clang++
-      endif
-    endif
-  else
-    LLVMCC := $(LLVMGCC)
-    LLVMCXX := $(LLVMGXX)
-  endif
+# Use detected compiler at KLEE configure time, not llvm configure time
+LLVMCC := $(KLEE_BITCODE_C_COMPILER)
+LLVMCXX := $(KLEE_BITCODE_CXX_COMPILER)
 
   ifeq ($(wildcard $(LLVMCC)),)
     $(warning Provided Compiler "$(LLVMCC)" is not found. Provide full path!)
@@ -458,7 +443,6 @@ else
   ifeq ($(wildcard $(LLVMCXX)),)
     $(warning Provided Compiler "$(LLVMCXX)" is not found. Provide full path!)
   endif
-endif
 
 #--------------------------------------------------------------------
 # Full Paths To Compiled Tools and Utilities