up to 1.4.0+20180108

OBS-URL: https://build.opensuse.org/package/show/devel:tools:statica/klee?expand=0&rev=37
This commit is contained in:
Jiri Slaby 2018-01-15 11:59:55 +00:00 committed by Git OBS Bridge
parent a1f875cd43
commit 777c059881
36 changed files with 644 additions and 108 deletions

View File

@ -27,5 +27,5 @@ index 53f4c5b85754..4f51ecb6301b 100644
}
ref<Expr> res = ConcatExpr::createN(kids.size(), kids.data());
--
2.15.0
2.15.1

View File

@ -0,0 +1,36 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 09:20:32 +0100
Subject: MergeHandler: remove unused closedStateCount
Patch-mainline: no
clang 5 reports:
In file included from ../lib/Core/MergeHandler.cpp:10:
../include/klee/MergeHandler.h:81:12: warning: private field 'closedStateCount' is not used [-Wunused-private-field]
unsigned closedStateCount;
^
So fix it by removing the member.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
include/klee/MergeHandler.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/klee/MergeHandler.h b/include/klee/MergeHandler.h
index d374e1684036..0c596825e867 100644
--- a/include/klee/MergeHandler.h
+++ b/include/klee/MergeHandler.h
@@ -76,10 +76,6 @@ class MergeHandler {
private:
Executor *executor;
- /// @brief Number of states that are tracked by this MergeHandler, that ran
- /// into a relevant klee_close_merge
- unsigned closedStateCount;
-
/// @brief Mapping the different 'klee_close_merge' calls to the states that ran into
/// them
std::map<llvm::Instruction *, std::vector<ExecutionState *> >
--
2.15.1

View File

@ -68,5 +68,5 @@ index b02605208bbb..54bda16013b6 100644
}
ii->removeFromParent();
--
2.15.0
2.15.1

View File

@ -96,5 +96,5 @@ index 4f51ecb6301b..92dee5ac3906 100644
}
--
2.15.0
2.15.1

View File

@ -161,7 +161,7 @@ index 13e4f7d47e58..c597fa2a7b82 100644
TLI = TM->getSubtargetImpl()->getTargetLowering();
#else
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 4a820578bf16..f8706f9f74e5 100644
index 9bdf06f600ce..ea24d89c5aaf 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -35,6 +35,7 @@
@ -173,5 +173,5 @@ index 4a820578bf16..f8706f9f74e5 100644
#include "llvm/Support/TargetSelect.h"
--
2.15.0
2.15.1

View File

@ -0,0 +1,44 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:24:48 +0100
Subject: llvm50: use auto variable instead of SwitchInst::CaseIt
Patch-mainline: no
llvm50 changed the semantics of SwitchInst::CaseIt and started using
"auto" variable type. So use it here too for all versions.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Core/Executor.cpp | 3 +--
lib/Module/LowerSwitch.cpp | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index be92b16a459d..d836598927ce 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1553,8 +1553,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
std::map<ref<Expr>, BasicBlock *> expressionOrder;
// Iterate through all non-default cases and order them by expressions
- for (SwitchInst::CaseIt i = si->case_begin(), e = si->case_end(); i != e;
- ++i) {
+ for (auto i : si->cases()) {
ref<Expr> value = evalConstant(i.getCaseValue());
BasicBlock *caseSuccessor = i.getCaseSuccessor();
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
index 1a194245a09a..02f00a3ae94e 100644
--- a/lib/Module/LowerSwitch.cpp
+++ b/lib/Module/LowerSwitch.cpp
@@ -115,7 +115,7 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
CaseVector cases;
- for (SwitchInst::CaseIt i = SI->case_begin(), e = SI->case_end(); i != e; ++i)
+ for (auto i : SI->cases())
cases.push_back(SwitchCase(i.getCaseValue(),
i.getCaseSuccessor()));
--
2.15.1

View File

@ -9,10 +9,10 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 0b7aa1a97f68..dcb8d30e0ffa 100644
index d836598927ce..fd1da6478fb2 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2392,15 +2392,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
@@ -2391,15 +2391,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
const unsigned elementCount = vt->getNumElements();
llvm::SmallVector<ref<Expr>, 8> elems;
elems.reserve(elementCount);
@ -33,7 +33,7 @@ index 0b7aa1a97f68..dcb8d30e0ffa 100644
}
ref<Expr> Result = ConcatExpr::createN(elementCount, elems.data());
@@ -2430,12 +2426,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
@@ -2429,12 +2425,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
return;
}
@ -48,5 +48,5 @@ index 0b7aa1a97f68..dcb8d30e0ffa 100644
bindLocal(ki, state, Result);
break;
--
2.15.0
2.15.1

View File

@ -1615,5 +1615,5 @@ index 000000000000..aa6b42ed6b9f
+ return 0;
+}
--
2.15.0
2.15.1

View File

@ -11,7 +11,7 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index dcb8d30e0ffa..dd3af9836187 100644
index fd1da6478fb2..efc59008e542 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -524,14 +524,20 @@ void Executor::initializeGlobals(ExecutionState &state) {
@ -39,5 +39,5 @@ index dcb8d30e0ffa..dd3af9836187 100644
These point into arrays of 384, so they can be indexed by any `unsigned
char' value [0,255]; by EOF (-1); or by any `signed char' value
--
2.15.0
2.15.1

View File

@ -29,5 +29,5 @@ index aaba72f4b5b7..3c117db9fa7b 100644
i++) {
if (i->second->Category != &Category) {
--
2.15.0
2.15.1

View File

@ -15,7 +15,7 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
4 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index dd3af9836187..3492cd7e9b3c 100644
index efc59008e542..045e353ba932 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -531,7 +531,10 @@ void Executor::initializeGlobals(ExecutionState &state) {
@ -30,7 +30,7 @@ index dd3af9836187..3492cd7e9b3c 100644
#endif
// Disabled, we don't want to promote use of live externals.
@@ -2973,6 +2976,27 @@ void Executor::callExternalFunction(ExecutionState &state,
@@ -2999,6 +3002,27 @@ void Executor::callExternalFunction(ExecutionState &state,
return;
}
@ -142,5 +142,5 @@ index 4e5c87346917..afb41390d071 100644
BitArray *concreteMask;
--
2.15.0
2.15.1

View File

@ -15,10 +15,10 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
7 files changed, 77 insertions(+), 9 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 3492cd7e9b3c..51531f8f46c8 100644
index 045e353ba932..96d85f503d4f 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2136,8 +2136,13 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
@@ -2135,8 +2135,13 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
!fpWidthToSemantics(right->getWidth()))
return terminateStateOnExecError(state, "Unsupported FRem operation");
llvm::APFloat Res(*fpWidthToSemantics(left->getWidth()), left->getAPValue());
@ -78,7 +78,7 @@ index 54bda16013b6..2b93319f2615 100644
Value *op2 = ii->getArgOperand(1);
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
index 1a194245a09a..b61da111908b 100644
index 02f00a3ae94e..7fe9d9768d72 100644
--- a/lib/Module/LowerSwitch.cpp
+++ b/lib/Module/LowerSwitch.cpp
@@ -64,7 +64,11 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr end,
@ -248,7 +248,7 @@ index 64e4863f70b3..944f51ef336d 100644
addPass(Passes, createLICMPass()); // Hoist loop invariants
addPass(Passes, createGVNPass()); // Remove redundancies
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index f8706f9f74e5..dbc166ed158a 100644
index ea24d89c5aaf..14afce0edf7c 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -291,7 +291,12 @@ KleeHandler::KleeHandler(int argc, char **argv)
@ -266,5 +266,5 @@ index f8706f9f74e5..dbc166ed158a 100644
// create directory and try to link klee-last
if (mkdir(d.c_str(), 0775) == 0) {
--
2.15.0
2.15.1

View File

@ -5,18 +5,19 @@ Patch-mainline: no
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
include/klee/klee.h | 2 ++
include/klee/klee.h | 3 +++
runtime/POSIX/fd.c | 6 ------
2 files changed, 2 insertions(+), 6 deletions(-)
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/klee/klee.h b/include/klee/klee.h
index bd3100b5007e..282670eebc91 100644
index 644c498e94ab..8b9cd2e266d3 100644
--- a/include/klee/klee.h
+++ b/include/klee/klee.h
@@ -152,6 +152,8 @@ extern "C" {
/* Print range for given argument and tagged with name */
void klee_print_range(const char * name, int arg );
@@ -157,6 +157,9 @@ extern "C" {
/* Merge all paths of the state that went through klee_open_merge */
void klee_close_merge();
+
+ /* Get errno value of the current state */
+ int klee_get_errno(void);
#ifdef __cplusplus
@ -40,5 +41,5 @@ index 6f78c7475000..cf07d1380ef8 100644
static exe_disk_file_t *__get_sym_file(const char *pathname) {
if (!pathname)
--
2.15.0
2.15.1

View File

@ -15,7 +15,7 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
7 files changed, 98 insertions(+), 5 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 51531f8f46c8..cd36eeec13e1 100644
index 96d85f503d4f..d7c3194d9de4 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1308,10 +1308,18 @@ void Executor::executeCall(ExecutionState &state,
@ -272,10 +272,10 @@ index b8b32e31264a..800cece95e9c 100644
llvm::cl::ParseCommandLineOptions(argc, argv);
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index dbc166ed158a..3c78b480bb23 100644
index 14afce0edf7c..436651f438d4 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1130,7 +1130,11 @@ int main(int argc, char **argv, char **envp) {
@@ -1132,7 +1132,11 @@ int main(int argc, char **argv, char **envp) {
llvm::InitializeNativeTarget();
parseArguments(argc, argv);
@ -288,5 +288,5 @@ index dbc166ed158a..3c78b480bb23 100644
if (Watchdog) {
if (MaxTime==0) {
--
2.15.0
2.15.1

View File

@ -5,16 +5,16 @@ Patch-mainline: no
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Core/SpecialFunctionHandler.cpp | 46 ++++++++++++++++++++++++++++++++++---
lib/Core/SpecialFunctionHandler.cpp | 44 +++++++++++++++++++++++++++++++++++--
lib/Core/SpecialFunctionHandler.h | 1 +
tools/klee/main.cpp | 2 ++
3 files changed, 46 insertions(+), 3 deletions(-)
3 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp
index 88e0d1a034bd..a019a09486c1 100644
index a8d6edecdd91..267a262fc133 100644
--- a/lib/Core/SpecialFunctionHandler.cpp
+++ b/lib/Core/SpecialFunctionHandler.cpp
@@ -89,6 +89,8 @@ static SpecialFunctionHandler::HandlerInfo handlerInfo[] = {
@@ -91,6 +91,8 @@ static SpecialFunctionHandler::HandlerInfo handlerInfo[] = {
add("klee_define_fixed_object", handleDefineFixedObject, false),
add("klee_get_obj_size", handleGetObjSize, true),
add("klee_get_errno", handleGetErrno, true),
@ -23,7 +23,7 @@ index 88e0d1a034bd..a019a09486c1 100644
add("klee_is_symbolic", handleIsSymbolic, true),
add("klee_make_symbolic", handleMakeSymbolic, false),
add("klee_mark_global", handleMarkGlobal, false),
@@ -537,10 +539,48 @@ void SpecialFunctionHandler::handleGetErrno(ExecutionState &state,
@@ -578,10 +580,48 @@ void SpecialFunctionHandler::handleGetErrno(ExecutionState &state,
// XXX should type check args
assert(arguments.size()==0 &&
"invalid number of arguments to klee_get_errno");
@ -47,8 +47,8 @@ index 88e0d1a034bd..a019a09486c1 100644
+ executor.terminateStateOnError(state, "Could not resolve address for errno",
+ Executor::User);
+ executor.bindLocal(target, state, result.second->read(0, Expr::Int32));
+}
+
}
+void SpecialFunctionHandler::handleErrnoLocation(
+ ExecutionState &state, KInstruction *target,
+ std::vector<ref<Expr> > &arguments) {
@ -70,13 +70,12 @@ index 88e0d1a034bd..a019a09486c1 100644
+ ConstantExpr::create((uint64_t)errno_addr,
+ executor.kmodule->targetData->getTypeSizeInBits(
+ target->inst->getType())));
}
-
+}
void SpecialFunctionHandler::handleCalloc(ExecutionState &state,
KInstruction *target,
std::vector<ref<Expr> > &arguments) {
diff --git a/lib/Core/SpecialFunctionHandler.h b/lib/Core/SpecialFunctionHandler.h
index 394b649aff72..5e58ede4f328 100644
index 7e58018f8366..b11a49749ccb 100644
--- a/lib/Core/SpecialFunctionHandler.h
+++ b/lib/Core/SpecialFunctionHandler.h
@@ -107,6 +107,7 @@ namespace klee {
@ -88,7 +87,7 @@ index 394b649aff72..5e58ede4f328 100644
HANDLER(handleFree);
HANDLER(handleGetErrno);
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index f1def38c90e5..4a820578bf16 100644
index 2b2fe3eb06c8..9bdf06f600ce 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -698,6 +698,8 @@ static const char *modelledExternals[] = {
@ -101,5 +100,5 @@ index f1def38c90e5..4a820578bf16 100644
"_exit",
"exit",
--
2.15.0
2.15.1

View File

@ -119,5 +119,5 @@ index 000000000000..f4e41293c347
+ ret i32 0
+}
--
2.15.0
2.15.1

View File

@ -38,5 +38,5 @@ index e8220276f8be..f1caaf77dea2 100644
#include <asm/ioctls.h>
#include <errno.h>
--
2.15.0
2.15.1

View File

@ -59,7 +59,7 @@ index ee4af254dae2..8aa070743048 100644
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Path.h"
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 3c78b480bb23..d45fad22896f 100644
index 436651f438d4..07f302a4641f 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -31,7 +31,6 @@
@ -84,5 +84,5 @@ index 3c78b480bb23..d45fad22896f 100644
#include <signal.h>
#include <unistd.h>
--
2.15.0
2.15.1

View File

@ -9,7 +9,7 @@ Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
1 file changed, 9 insertions(+)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index cd36eeec13e1..af7f680fec3d 100644
index d7c3194d9de4..19499e1be37d 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1451,12 +1451,21 @@ static bool isDebugIntrinsic(const Function *f, KModule *KM) {
@ -35,5 +35,5 @@ index cd36eeec13e1..af7f680fec3d 100644
return 0;
}
--
2.15.0
2.15.1

View File

@ -31,5 +31,5 @@ index 9cc11b709bbe..3dd5b4d59fe4 100644
+ // CHECK: {{^(ABCD|ABDC|ACBD|ACDB|ADBC|ADCB|BACD|BADC|BCAD|BCDA|BDAC|BDCA|CABD|CADB|CBAD|CBDA|CDAB|CDBA|DABC|DACB|DBAC|DBCA|DCAB|DCBA)$}}
}
--
2.15.0
2.15.1

View File

@ -124,5 +124,5 @@ index 8aa070743048..ad847de0b368 100644
#else
if (auto ec = module->materializeAllPermanently()) {
--
2.15.0
2.15.1

View File

@ -4,7 +4,7 @@ Subject: llvm: use chrono helpers from LLVM 4.0
Patch-mainline: no
LLVM 4.0 removes the old time interface and starts using the C++11's
chrono. So swiych to that in klee for LLVM 4.0 too.
chrono. So switch to that in klee for LLVM 4.0 too.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
@ -195,5 +195,5 @@ index da96981079ae..a223b39ada57 100644
+
+#endif
--
2.15.0
2.15.1

View File

@ -27,10 +27,10 @@ index 5fb9f4ec5c2f..bf7cb6ff0bea 100644
CurTy = 0;
}
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index af7f680fec3d..f435f5389f64 100644
index 19499e1be37d..093be697c7da 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2520,8 +2520,7 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
@@ -2522,8 +2522,7 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
uint64_t addend = sl->getElementOffset((unsigned) ci->getZExtValue());
constantOffset = constantOffset->Add(ConstantExpr::alloc(addend,
Context::get().getPointerWidth()));
@ -40,7 +40,7 @@ index af7f680fec3d..f435f5389f64 100644
uint64_t elementSize =
kmodule->targetData->getTypeStoreSize(set->getElementType());
Value *operand = ii.getOperand();
@@ -2535,7 +2534,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
@@ -2537,7 +2536,24 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
} else {
kgepi->indices.push_back(std::make_pair(index, elementSize));
}
@ -67,5 +67,5 @@ index af7f680fec3d..f435f5389f64 100644
}
kgepi->offset = constantOffset->getZExtValue();
--
2.15.0
2.15.1

View File

@ -28,5 +28,5 @@ index 92dee5ac3906..c9308795804e 100644
const StructLayout *SL = kmodule->targetData->getStructLayout(STy);
base = base->Add(
--
2.15.0
2.15.1

View File

@ -0,0 +1,50 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:35:19 +0100
Subject: llvm50: avoid ++ on function->arg_begin()
Patch-mainline: no
Starting with llvm 5, arguments of a function are not an iterator, but
an array. So they cannot be incremented in-place. Use +1 to construct a
new one instead.
Otherwise we see:
../tools/klee/main.cpp:661:23: error: expression is not assignable
Value *oldArgv = &*(++mainFn->arg_begin());
^ ~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
tools/klee/main.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 07f302a4641f..aeed018631ea 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -658,7 +658,11 @@ static int initEnv(Module *mainModule) {
Instruction *firstInst = &*(mainFn->begin()->begin());
Value *oldArgc = &*(mainFn->arg_begin());
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ Value *oldArgv = &*(mainFn->arg_begin() + 1);
+#else
Value *oldArgv = &*(++mainFn->arg_begin());
+#endif
AllocaInst* argcPtr =
new AllocaInst(oldArgc->getType(), "argcPtr", firstInst);
@@ -1117,7 +1121,11 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule, StringRef libDir)
args.push_back(llvm::ConstantExpr::getBitCast(userMainFn,
ft->getParamType(0)));
args.push_back(&*(stub->arg_begin())); // argc
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ args.push_back(&*(stub->arg_begin() + 1)); // argv
+#else
args.push_back(&*(++stub->arg_begin())); // argv
+#endif
args.push_back(Constant::getNullValue(ft->getParamType(3))); // app_init
args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini
args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini
--
2.15.1

View File

@ -0,0 +1,32 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:09:20 +0100
Subject: llvm50: integerPartWidth is from llvm::APFloatBase
Patch-mainline: no
Otherwise we see:
../lib/Expr/Expr.cpp:331:14: error: no member named 'integerPartWidth' in namespace 'llvm'; did you mean 'llvm::APFloatBase::integerPartWidth'?
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Expr/Expr.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index f73d1614c250..5433d9211ead 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -328,7 +328,11 @@ ref<Expr> ConstantExpr::fromMemory(void *address, Width width) {
// FIXME: what about machines without x87 support?
default:
return ConstantExpr::alloc(llvm::APInt(width,
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ (width+llvm::APFloatBase::integerPartWidth-1)/llvm::APFloatBase::integerPartWidth,
+#else
(width+llvm::integerPartWidth-1)/llvm::integerPartWidth,
+#endif
(const uint64_t*)address));
}
}
--
2.15.1

View File

@ -0,0 +1,119 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:27:54 +0100
Subject: llvm50: handle getOrInsertFunction terminator
Patch-mainline: no
llvm 5 does not terminate getOrInsertFunction parameters with NULL, take
care of that.
Since commit 9d54400bba7eb04bca80fce97fa170452d19eaf1.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
include/klee/Config/Version.h | 6 ++++++
lib/Module/Checks.cpp | 8 ++++----
lib/Module/IntrinsicCleaner.cpp | 2 +-
tools/klee/main.cpp | 20 ++++++++++----------
4 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
index 532051602fe3..a02ce28baaae 100644
--- a/include/klee/Config/Version.h
+++ b/include/klee/Config/Version.h
@@ -27,4 +27,10 @@
# define KLEE_LLVM_CL_VAL_END , clEnumValEnd
#endif
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+# define KLEE_LLVM_GOIF_TERMINATOR
+#else
+# define KLEE_LLVM_GOIF_TERMINATOR , NULL
+#endif
+
#endif
diff --git a/lib/Module/Checks.cpp b/lib/Module/Checks.cpp
index aac63e1d9854..406b3045e527 100644
--- a/lib/Module/Checks.cpp
+++ b/lib/Module/Checks.cpp
@@ -57,8 +57,8 @@ bool DivCheckPass::runOnModule(Module &M) {
if (!divZeroCheckFunction) {
Constant *fc = M.getOrInsertFunction("klee_div_zero_check",
Type::getVoidTy(ctx),
- Type::getInt64Ty(ctx),
- NULL);
+ Type::getInt64Ty(ctx)
+ KLEE_LLVM_GOIF_TERMINATOR);
divZeroCheckFunction = cast<Function>(fc);
}
@@ -118,8 +118,8 @@ bool OvershiftCheckPass::runOnModule(Module &M) {
Constant *fc = M.getOrInsertFunction("klee_overshift_check",
Type::getVoidTy(ctx),
Type::getInt64Ty(ctx),
- Type::getInt64Ty(ctx),
- NULL);
+ Type::getInt64Ty(ctx)
+ KLEE_LLVM_GOIF_TERMINATOR);
overshiftCheckFunction = cast<Function>(fc);
}
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 2b93319f2615..c00c77699e18 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -208,7 +208,7 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
// a call of the abort() function.
Function *F = cast<Function>(
M.getOrInsertFunction(
- "abort", Type::getVoidTy(ctx), NULL));
+ "abort", Type::getVoidTy(ctx) KLEE_LLVM_GOIF_TERMINATOR));
F->setDoesNotReturn();
F->setDoesNotThrow();
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index aeed018631ea..02748fbc0ee5 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -678,8 +678,8 @@ static int initEnv(Module *mainModule) {
cast<Function>(mainModule->getOrInsertFunction("klee_init_env",
Type::getVoidTy(ctx),
argcPtr->getType(),
- argvPtr->getType(),
- NULL));
+ argvPtr->getType()
+ KLEE_LLVM_GOIF_TERMINATOR));
assert(initEnvFn);
std::vector<Value*> args;
args.push_back(argcPtr);
@@ -1038,20 +1038,20 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule, StringRef libDir)
mainModule->getOrInsertFunction("realpath",
PointerType::getUnqual(i8Ty),
PointerType::getUnqual(i8Ty),
- PointerType::getUnqual(i8Ty),
- NULL);
+ PointerType::getUnqual(i8Ty)
+ KLEE_LLVM_GOIF_TERMINATOR);
mainModule->getOrInsertFunction("getutent",
- PointerType::getUnqual(i8Ty),
- NULL);
+ PointerType::getUnqual(i8Ty)
+ KLEE_LLVM_GOIF_TERMINATOR);
mainModule->getOrInsertFunction("__fgetc_unlocked",
Type::getInt32Ty(ctx),
- PointerType::getUnqual(i8Ty),
- NULL);
+ PointerType::getUnqual(i8Ty)
+ KLEE_LLVM_GOIF_TERMINATOR);
mainModule->getOrInsertFunction("__fputc_unlocked",
Type::getInt32Ty(ctx),
Type::getInt32Ty(ctx),
- PointerType::getUnqual(i8Ty),
- NULL);
+ PointerType::getUnqual(i8Ty)
+ KLEE_LLVM_GOIF_TERMINATOR);
}
f = mainModule->getFunction("__ctype_get_mb_cur_max");
--
2.15.1

View File

@ -0,0 +1,35 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:38:35 +0100
Subject: llvm50: SwitchInst case functions now return pointers
Patch-mainline: no
Starting llvm 5, SwitchInst->findCaseValue() now has to be dereferenced
using ->. So do so, otherwise we see:
../lib/Core/Executor.cpp:1598:38: error: no member named 'getCaseSuccessor' in 'llvm::SwitchInst::CaseIteratorImpl<llvm::SwitchInst::CaseHandle>'; did you mean to use '->' instead of '.'?
BasicBlock *caseSuccessor = i.getCaseSuccessor();
^
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Core/Executor.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 093be697c7da..5fe5bf9c1346 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1571,7 +1571,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
// switch to an internal rep.
llvm::IntegerType *Ty = cast<IntegerType>(si->getCondition()->getType());
ConstantInt *ci = ConstantInt::get(Ty, CE->getZExtValue());
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ unsigned index = si->findCaseValue(ci)->getSuccessorIndex();
+#else
unsigned index = si->findCaseValue(ci).getSuccessorIndex();
+#endif
transferToBasicBlock(si->getSuccessor(index), si->getParent(), state);
} else {
// Handle possible different branch targets
--
2.15.1

View File

@ -0,0 +1,69 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 10:42:53 +0100
Subject: llvm50: handle new file_magic's location
Patch-mainline: no
llvm 5, moved file_magic to BinaryFormat in commit
19ca2b0f9daed883c21730285d7f04424e5f5f88, so adapt to that.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
`
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Module/ModuleUtil.cpp | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index ad847de0b368..5f967410568c 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -14,6 +14,9 @@
#include "klee/Internal/Support/ErrorHandling.h"
#include "../Core/SpecialFunctionHandler.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+#include "llvm/BinaryFormat/Magic.h"
+#endif
#include "llvm/IRReader/IRReader.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
@@ -477,7 +480,9 @@ Module *klee::linkWithLibrary(Module *module,
MemoryBuffer *Buffer = bufferErr->get();
#endif
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ file_magic magic = identify_magic(Buffer.getBuffer());
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6)
sys::fs::file_magic magic = sys::fs::identify_magic(Buffer.getBuffer());
#else
sys::fs::file_magic magic = sys::fs::identify_magic(Buffer->getBuffer());
@@ -486,7 +491,11 @@ Module *klee::linkWithLibrary(Module *module,
LLVMContext &Context = module->getContext();
std::string ErrorMessage;
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ if (magic == file_magic::bitcode) {
+#else
if (magic == sys::fs::file_magic::bitcode) {
+#endif
#if LLVM_VERSION_CODE < LLVM_VERSION(3, 8)
Module *Result = 0;
#endif
@@ -538,7 +547,11 @@ Module *klee::linkWithLibrary(Module *module,
delete Result;
#endif
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ } else if (magic == file_magic::archive) {
+#else
} else if (magic == sys::fs::file_magic::archive) {
+#endif
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9)
Expected<std::unique_ptr<object::Binary> > arch =
object::createBinary(Buffer, &Context);
--
2.15.1

View File

@ -0,0 +1,49 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 11:07:47 +0100
Subject: llvm50: use MutableArrayRef for APFloat::convertToInteger
Patch-mainline: no
in llvm 5, since commit 957caa243d9270df37a566aedae3f1244e7b62ef, the
first parameter to APFloat::convertToInteger is MutableArrayRef. So
handle that.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
lib/Core/Executor.cpp | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 5fe5bf9c1346..44293f885136 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2219,7 +2219,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
llvm::APFloat Arg(*fpWidthToSemantics(arg->getWidth()), arg->getAPValue());
uint64_t value = 0;
bool isExact = true;
- Arg.convertToInteger(&value, resultType, false,
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ MutableArrayRef<uint64_t> valueRef = makeMutableArrayRef(value);
+#else
+ uint64_t *valueRef = &value;
+#endif
+ Arg.convertToInteger(valueRef, resultType, false,
llvm::APFloat::rmTowardZero, &isExact);
bindLocal(ki, state, ConstantExpr::alloc(value, resultType));
break;
@@ -2236,7 +2241,12 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
uint64_t value = 0;
bool isExact = true;
- Arg.convertToInteger(&value, resultType, true,
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ MutableArrayRef<uint64_t> valueRef = makeMutableArrayRef(value);
+#else
+ uint64_t *valueRef = &value;
+#endif
+ Arg.convertToInteger(valueRef, resultType, true,
llvm::APFloat::rmTowardZero, &isExact);
bindLocal(ki, state, ConstantExpr::alloc(value, resultType));
break;
--
2.15.1

View File

@ -0,0 +1,39 @@
From: Jiri Slaby <jirislaby@gmail.com>
Date: Mon, 15 Jan 2018 11:10:39 +0100
Subject: llvm50: AllocaInst takes address space
Patch-mainline: no
Add address space second parameter to new AllocaInst which is required
since llvm 5's commit e0b3c335a27ae50c4f339ffb81c18662bc983e52.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
tools/klee/main.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 02748fbc0ee5..30100b19af3b 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -664,10 +664,18 @@ static int initEnv(Module *mainModule) {
Value *oldArgv = &*(++mainFn->arg_begin());
#endif
+#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
+ const DataLayout &DL = mainFn->getParent()->getDataLayout();
+ AllocaInst* argcPtr =
+ new AllocaInst(oldArgc->getType(), DL.getAllocaAddrSpace(), "argcPtr", firstInst);
+ AllocaInst* argvPtr =
+ new AllocaInst(oldArgv->getType(), DL.getAllocaAddrSpace(), "argvPtr", firstInst);
+#else
AllocaInst* argcPtr =
new AllocaInst(oldArgc->getType(), "argcPtr", firstInst);
AllocaInst* argvPtr =
new AllocaInst(oldArgv->getType(), "argvPtr", firstInst);
+#endif
/* Insert void klee_init_env(int* argc, char*** argv) */
std::vector<const Type*> params;
--
2.15.1

View File

@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/klee/klee.git</param>
<param name="changesrevision">9caaae0b1b6e52be3c7bb783f3a8be659a1a1869</param></service></servicedata>
<param name="changesrevision">37f554d5cf587ec9f6befa359a0e3aa60e9ce73f</param></service></servicedata>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a4a0830328c4cbac4f059a7fa016994df5101b5b9a30105fdf9cc42e5c14169e
size 582380

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a419c2131fb65b0d4ac8e83d88c1444adfc6cbe02916c1405f435492ff2c4bc4
size 584980

View File

@ -1,3 +1,43 @@
-------------------------------------------------------------------
Mon Jan 15 10:24:53 UTC 2018 - jslaby@suse.com
- Update to version 1.4.0+20180108:
* [NFC] Remove unused config header template that was only used by the old build system (now removed).
* fix regression test: use `%klee` instead of `klee`
* fix merging tests: use `%klee` instead of `klee`
* Move Homebrew tap from personal repository to the KLEE organization
* Updated TravisCI to use pip2 instead of pip
* Bumped xcode version for TravisCI
* Implemented bounded merging functionality
* Added pause and continue functionality for states in Executor
* Replace confusing message in lit.site.cfg.in about the file being autogenerated
* klee_make_symbolic: add test cases for API
* klee_make_symbolic: warn on deprecated usage
- added patches:
* 0013-llvm40-gep_type_iterator-has-no-operator.patch
* 0014-llvm50-avoid-on-function-arg_begin.patch
* 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch
* 0016-llvm50-handle-getOrInsertFunction-terminator.patch
* 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch
* 0018-llvm50-handle-new-file_magic-s-location.patch
* 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch
* 0020-llvm50-AllocaInst-takes-address-space.patch
- renamed patches:
* 0013-llvm38-test-change-some-tests.patch ->
0007-llvm38-test-change-some-tests.patch
* 0007-llvm40-handle-different-header-names.patch ->
0008-llvm40-handle-different-header-names.patch
* 0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch ->
0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
* 0009-llvm40-errorOr-and-similar.patch ->
0010-llvm40-errorOr-and-similar.patch
* 0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch ->
0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch
* 0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch ->
0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
* 0012-llvm40-gep_type_iterator-has-no-operator.patch ->
0013-llvm40-gep_type_iterator-has-no-operator.patch
-------------------------------------------------------------------
Mon Jan 15 07:49:05 UTC 2018 - jslaby@suse.com

113
klee.spec
View File

@ -19,7 +19,7 @@
%define llvm_version_minor 0
%define llvm_version %{llvm_version_major}
%define version_unconverted 1.4.0+20171026
%define version_unconverted 1.4.0+20180108
%ifarch %{ix86} x86_64
%define with_uclibc 1
@ -31,36 +31,47 @@ Name: klee
Summary: LLVM Execution Engine
License: NCSA
Group: Development/Languages/Other
Version: 1.4.0+20171026
Version: 1.4.0+20180108
Release: 0
Url: http://klee.github.io/
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-rpmlintrc
Source2: https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/not/not.cpp
Source3: https://raw.githubusercontent.com/llvm-mirror/llvm/release_%{llvm_version_major}%{llvm_version_minor}/utils/FileCheck/FileCheck.cpp
Patch1: 0001-Fix-generation-of-expressions-from-constant-sequenti.patch
Patch2: 0002-Fix-getelementptr-for-array-or-vector-indices.patch
Patch3: 0003-Fix-correct-element-order-of-InsertElement-ExtractEl.patch
Patch4: 0004-Provide-errno-independent-of-CTYPE_EXTERNALS-being-d.patch
Patch5: 0005-Track-errno-correctly.patch
Patch6: 0006-Declare-klee_get_errno-and-remove-local-declarations.patch
Patch7: 0007-Add-support-for-modelling-errno_location.patch
Patch8: 0008-Cleanup-test-cases.patch
Patch9: 0009-test-fix-Feature-BFSSearcherAndDFSSearcherInterleave.patch
#---
Patch10: 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
Patch11: 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
Patch12: 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
Patch13: 0004-llvm37-handle-getRegisteredOptions.patch
Patch14: 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
Patch15: 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
Patch16: 0007-llvm40-handle-different-header-names.patch
Patch17: 0008-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
Patch18: 0009-llvm40-errorOr-and-similar.patch
Patch19: 0010-llvm-use-chrono-helpers-from-LLVM-4.0.patch
Patch20: 0011-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
Patch21: 0012-llvm40-gep_type_iterator-has-no-operator.patch
Patch22: 0013-llvm38-test-change-some-tests.patch
Patch1: 0001-MergeHandler-remove-unused-closedStateCount.patch
Patch2: 0002-llvm50-use-auto-variable-instead-of-SwitchInst-CaseI.patch
Patch101: 0001-Fix-generation-of-expressions-from-constant-sequenti.patch
Patch102: 0002-Fix-getelementptr-for-array-or-vector-indices.patch
Patch103: 0003-Fix-correct-element-order-of-InsertElement-ExtractEl.patch
Patch104: 0004-Provide-errno-independent-of-CTYPE_EXTERNALS-being-d.patch
Patch105: 0005-Track-errno-correctly.patch
Patch106: 0006-Declare-klee_get_errno-and-remove-local-declarations.patch
Patch107: 0007-Add-support-for-modelling-errno_location.patch
Patch108: 0008-Cleanup-test-cases.patch
Patch109: 0009-test-fix-Feature-BFSSearcherAndDFSSearcherInterleave.patch
Patch201: 0001-llvm37-handle-GetElementPtrInst-Create-s-new-paramet.patch
Patch202: 0002-llvm-make-KLEE-compile-against-LLVM-3.7.patch
Patch203: 0003-test-add-versions-of-some-tests-for-LLVM-3.7.patch
Patch204: 0004-llvm37-handle-getRegisteredOptions.patch
Patch205: 0005-llvm-make-KLEE-compile-against-LLVM-3.8.patch
Patch206: 0006-llvm-make-KLEE-compile-against-LLVM-3.9.patch
Patch207: 0007-llvm38-test-change-some-tests.patch
Patch208: 0008-llvm40-handle-different-header-names.patch
Patch209: 0009-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
Patch210: 0010-llvm40-errorOr-and-similar.patch
Patch211: 0011-llvm-use-chrono-helpers-from-LLVM-4.0.patch
Patch212: 0012-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
Patch213: 0013-llvm40-gep_type_iterator-has-no-operator.patch
Patch214: 0014-llvm50-avoid-on-function-arg_begin.patch
Patch215: 0015-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch
Patch216: 0016-llvm50-handle-getOrInsertFunction-terminator.patch
Patch217: 0017-llvm50-SwitchInst-case-functions-now-return-pointers.patch
Patch218: 0018-llvm50-handle-new-file_magic-s-location.patch
Patch219: 0019-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch
Patch220: 0020-llvm50-AllocaInst-takes-address-space.patch
BuildRequires: clang%{llvm_version}
BuildRequires: cmake
@ -89,26 +100,38 @@ information on what KLEE is and what it can do, see the OSDI 2008 paper.
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch201 -p1
%patch202 -p1
%patch203 -p1
%patch204 -p1
%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch208 -p1
%patch209 -p1
%patch210 -p1
%patch211 -p1
%patch212 -p1
%patch213 -p1
%patch214 -p1
%patch215 -p1
%patch216 -p1
%patch217 -p1
%patch218 -p1
%patch219 -p1
%patch220 -p1
mkdir -p build/test/
cp %{SOURCE2} build/test/
cp %{SOURCE3} build/test/