From c7c749d0de5023cf7c7fc77741506c6933a74884 Mon Sep 17 00:00:00 2001 From: jirislaby <> Date: Mar 22 2023 21:43:42 +0000 Subject: Update klee to version 2.3+20230320 / rev 34 via SR 1073721 https://build.opensuse.org/request/show/1073721 by user jirislaby + dimstar_suse - Update to version 2.3+20230320: * ConstantArrayExprVisitor: Fix detection of multiple array indices * ConstantArrayExprVisitor: Deduplicate `visitConcat` and `visitRead` * llvm14 support * Update KDAlloc unittests * Don't fail `KleeStats.c` test if it takes 1s or longer * Disable `const_array_opt1` for ubsan as well * Fix uninitialised memory access while reading last path entry * Fix building of runtime library and klee-replay * Add support to disable memsan instrumentation; update UB/Asan suppression * [MemSan] Mark memory objects modified by syscalls as initialised * Fix compiler warning with newer compilers * Use bitcode library paths via config generation instead of `-D` flags * [cmake] Use LLVM's CMake functionality only * Fixed a bug in KLEE libc's imple --- diff --git a/packages/k/klee/.files b/packages/k/klee/.files index d33754b..d5b619d 100644 Binary files a/packages/k/klee/.files and b/packages/k/klee/.files differ diff --git a/packages/k/klee/.rev b/packages/k/klee/.rev index b993781..900ec56 100644 --- a/packages/k/klee/.rev +++ b/packages/k/klee/.rev @@ -1277,4 +1277,41 @@ build with uclibc - update FileCheck.cpp to llvm 14's 1031045 + + 01b34637115291a52a75f1449d76771a + 2.3+20230320 + + dimstar_suse + - Update to version 2.3+20230320: + * ConstantArrayExprVisitor: Fix detection of multiple array indices + * ConstantArrayExprVisitor: Deduplicate `visitConcat` and `visitRead` + * llvm14 support + * Update KDAlloc unittests + * Don't fail `KleeStats.c` test if it takes 1s or longer + * Disable `const_array_opt1` for ubsan as well + * Fix uninitialised memory access while reading last path entry + * Fix building of runtime library and klee-replay + * Add support to disable memsan instrumentation; update UB/Asan suppression + * [MemSan] Mark memory objects modified by syscalls as initialised + * Fix compiler warning with newer compilers + * Use bitcode library paths via config generation instead of `-D` flags + * [cmake] Use LLVM's CMake functionality only + * Fixed a bug in KLEE libc's implementation of strcmp: according to the C standard, characters should be compared as unsigned chars. + * Add some system tests for KDAlloc + * Integrate KDAlloc into KLEE + * Have the STP coverage build also provide Z3, so that the crosscheck solver can also be tested + * Add a few simple solver tests + * create klee-last as a relative link + * Fix integer overflow + * Add an extra check to test/Runtime/FreeStanding/memcpy_chk_err.c ensuring that a call to __memcpy_chk is emitted + * fix output check in test const_arr_opt1 + * add missing FileCheck command to test + * Fixed some leaks in klee-replay + * fix FileCheck cmd of VarArgByVal test +- remove (upstream): + * 0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch + * 0001-llvm14-Add-LLVM-14-to-lit.cfg.patch + * 0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch + 1073721 + diff --git a/packages/k/klee/.servicemark b/packages/k/klee/.servicemark deleted file mode 100644 index 6ae27ac..0000000 --- a/packages/k/klee/.servicemark +++ /dev/null @@ -1 +0,0 @@ -c3d8e5111daa803a49329c79230069b4 diff --git a/packages/k/klee/0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch b/packages/k/klee/0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch deleted file mode 100644 index d8c76a6..0000000 --- a/packages/k/klee/0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= -Date: Sat, 5 Mar 2022 13:48:35 +0100 -Subject: Module/InstructionOperandTypeCheckPass: Fix - -Wbitwise-instead-of-logical warning -Git-repo: https://github.com/lzaoral/klee#llvm14 -Git-commit: fc8c581aac41a1b8df23a5f47d70ac2296be7ffc -Patch-mainline: no -References: llvm 14 - -This warning was introduced in Clang 14. - -Signed-off-by: Jiri Slaby ---- - lib/Module/InstructionOperandTypeCheckPass.cpp | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/lib/Module/InstructionOperandTypeCheckPass.cpp b/lib/Module/InstructionOperandTypeCheckPass.cpp -index 5f428471..e67f051c 100644 ---- a/lib/Module/InstructionOperandTypeCheckPass.cpp -+++ b/lib/Module/InstructionOperandTypeCheckPass.cpp -@@ -94,7 +94,7 @@ bool checkInstruction(const Instruction *i) { - // scalarizer pass might not remove these. This could be selecting which - // vector operand to feed to another instruction. The Executor can handle - // this so case so this is not a problem -- return checkOperandTypeIsScalarInt(i, 0) & -+ return checkOperandTypeIsScalarInt(i, 0) && - checkOperandsHaveSameType(i, 1, 2); - } - // Integer arithmetic, logical and shifting -@@ -111,12 +111,12 @@ bool checkInstruction(const Instruction *i) { - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr: { -- return checkOperandTypeIsScalarInt(i, 0) & -+ return checkOperandTypeIsScalarInt(i, 0) && - checkOperandTypeIsScalarInt(i, 1); - } - // Integer comparison - case Instruction::ICmp: { -- return checkOperandTypeIsScalarIntOrPointer(i, 0) & -+ return checkOperandTypeIsScalarIntOrPointer(i, 0) && - checkOperandTypeIsScalarIntOrPointer(i, 1); - } - // Integer Conversion -@@ -136,7 +136,7 @@ bool checkInstruction(const Instruction *i) { - case Instruction::FMul: - case Instruction::FDiv: - case Instruction::FRem: { -- return checkOperandTypeIsScalarFloat(i, 0) & -+ return checkOperandTypeIsScalarFloat(i, 0) && - checkOperandTypeIsScalarFloat(i, 1); - } - // Floating point conversion -@@ -152,7 +152,7 @@ bool checkInstruction(const Instruction *i) { - } - // Floating point comparison - case Instruction::FCmp: { -- return checkOperandTypeIsScalarFloat(i, 0) & -+ return checkOperandTypeIsScalarFloat(i, 0) && - checkOperandTypeIsScalarFloat(i, 1); - } - default: --- -2.35.3 - diff --git a/packages/k/klee/0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch b/packages/k/klee/0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch new file mode 100644 index 0000000..5544457 --- /dev/null +++ b/packages/k/klee/0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch @@ -0,0 +1,243 @@ +From: Jiri Slaby +Date: Wed, 22 Mar 2023 09:36:46 +0100 +Subject: [cmake] implement USE_MAP to support single LLVM library +Patch-mainline: no +References: https://github.com/klee/klee/pull/1585 + +Otherwise we see: +: && /var/lib/build/ccache/bin/clang++ -O2 -Wall ... test-randgen.cpp.o -o bin/ktest-randgen lib/libkleeBasic.a -lLLVMSupport && : + /usr/bin/ld: cannot find -lLLVMSupport: No such file or directory + +Fixes #1581. + +Signed-off-by: Jiri Slaby (SUSE) +--- + CMakeLists.txt | 8 ++++++++ + lib/Basic/CMakeLists.txt | 7 ++++++- + lib/Core/CMakeLists.txt | 7 ++++++- + lib/Expr/CMakeLists.txt | 7 ++++++- + lib/Module/CMakeLists.txt | 34 +++++++++++++++++++--------------- + lib/Solver/CMakeLists.txt | 7 ++++++- + lib/Support/CMakeLists.txt | 6 +++++- + test/CMakeLists.txt | 12 ++++++++++-- + tools/kleaver/CMakeLists.txt | 6 +++++- + unittests/CMakeLists.txt | 6 +++++- + 10 files changed, 76 insertions(+), 24 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cf01df24e9df..43f7144b4562 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -727,3 +727,11 @@ add_custom_target(uninstall + COMMENT "Uninstalling..." + VERBATIM + ) ++ ++set(USE_MAP FALSE) ++if (TARGET LLVMSupport) ++ get_target_property(LLVMSupport_TYPE LLVMSupport TYPE) ++ if (LLVMSupport STREQUAL SHARED_LIBRARY) ++ set(USE_MAP TRUE) ++ endif() ++endif() +diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt +index 5671c1445948..d489ba9c47f6 100644 +--- a/lib/Basic/CMakeLists.txt ++++ b/lib/Basic/CMakeLists.txt +@@ -11,7 +11,12 @@ add_library(kleeBasic + Statistics.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs support) ++else() ++ set(llvm_libs LLVM) ++endif() ++ + target_link_libraries(kleeBasic PRIVATE ${llvm_libs}) + target_compile_options(kleeBasic PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) + target_compile_definitions(kleeBasic PRIVATE ${KLEE_COMPONENT_CXX_DEFINES}) +diff --git a/lib/Core/CMakeLists.txt b/lib/Core/CMakeLists.txt +index 0905a7f03e98..5467f240aed1 100644 +--- a/lib/Core/CMakeLists.txt ++++ b/lib/Core/CMakeLists.txt +@@ -36,7 +36,12 @@ target_link_libraries(kleeCore PRIVATE + kleeSupport + ) + +-llvm_map_components_to_libnames(llvm_libs core executionengine mcjit native support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs core executionengine mcjit native support) ++else() ++ set(llvm_libs LLVM) ++endif() ++ + target_link_libraries(kleeCore PRIVATE ${llvm_libs} ${SQLITE3_LIBRARIES}) + target_include_directories(kleeCore PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIRS}) + target_compile_options(kleeCore PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) +diff --git a/lib/Expr/CMakeLists.txt b/lib/Expr/CMakeLists.txt +index 6b8a873bb8ed..eed9e9b354c1 100644 +--- a/lib/Expr/CMakeLists.txt ++++ b/lib/Expr/CMakeLists.txt +@@ -26,7 +26,12 @@ add_library(kleaverExpr + Updates.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs support) ++else() ++ set(llvm_libs LLVM) ++endif() ++ + target_link_libraries(kleaverExpr PRIVATE ${llvm_libs}) + target_include_directories(kleaverExpr PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS}) + target_compile_options(kleaverExpr PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) +diff --git a/lib/Module/CMakeLists.txt b/lib/Module/CMakeLists.txt +index c81d395e2cb8..49b51a9936c6 100644 +--- a/lib/Module/CMakeLists.txt ++++ b/lib/Module/CMakeLists.txt +@@ -26,21 +26,25 @@ add_library(kleeModule + ${KLEE_MODULE_COMPONENT_SRCS} + ) + +-llvm_map_components_to_libnames(llvm_libs bitreader +- bitwriter +- codegen +- ipo +- irreader +- linker +- support +- scalaropts +- instcombine +- transformutils +- analysis +- object +- mc +- binaryformat +- ) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs bitreader ++ bitwriter ++ codegen ++ ipo ++ irreader ++ linker ++ support ++ scalaropts ++ instcombine ++ transformutils ++ analysis ++ object ++ mc ++ binaryformat ++ ) ++else() ++ set(llvm_libs LLVM) ++endif() + + target_link_libraries(kleeModule PRIVATE ${llvm_libs}) + +diff --git a/lib/Solver/CMakeLists.txt b/lib/Solver/CMakeLists.txt +index 81a64882672c..bef0391325e5 100644 +--- a/lib/Solver/CMakeLists.txt ++++ b/lib/Solver/CMakeLists.txt +@@ -32,7 +32,12 @@ add_library(kleaverSolver + Z3Solver.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs support) ++else() ++ set(llvm_libs LLVM) ++endif() ++ + target_link_libraries(kleaverSolver PRIVATE + kleeBasic + kleaverExpr +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index 7ff4daa34e85..8e6e876dc415 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -18,7 +18,11 @@ add_library(kleeSupport + TreeStream.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs support) ++else() ++ set(llvm_libs LLVM) ++endif() + + target_link_libraries(kleeSupport PRIVATE ${llvm_libs} ${ZLIB_LIBRARIES} ${TCMALLOC_LIBRARIES}) + target_include_directories(kleeSupport PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${TCMALLOC_INCLUDE_DIR}) +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 226eb08a3d1f..4c6bdfd172b9 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -96,7 +96,11 @@ if (DOWNLOAD_FILECHECK_SOURCE) + add_executable(FileCheck + ${FILECHECK_SRC_FILE} + ) +- llvm_map_components_to_libnames(FILECHECK_NEEDED_LIBS support) ++ if (USE_MAP) ++ llvm_map_components_to_libnames(FILECHECK_NEEDED_LIBS support) ++ else() ++ set(FILECHECK_NEEDED_LIBS LLVM) ++ endif() + target_include_directories(FileCheck PRIVATE ${LLVM_INCLUDE_DIRS}) + target_link_libraries(FileCheck PRIVATE ${FILECHECK_NEEDED_LIBS}) + endif() +@@ -117,7 +121,11 @@ if (DOWNLOAD_NOT_SOURCE) + add_executable("not" + ${NOT_SRC_FILE} + ) +- llvm_map_components_to_libnames(NOT_NEEDED_LIBS support) ++ if (USE_MAP) ++ llvm_map_components_to_libnames(NOT_NEEDED_LIBS support) ++ else() ++ set(NOT_NEEDED_LIBS LLVM) ++ endif() + target_include_directories("not" PRIVATE ${LLVM_INCLUDE_DIRS}) + target_link_libraries("not" PRIVATE ${NOT_NEEDED_LIBS}) + endif() +diff --git a/tools/kleaver/CMakeLists.txt b/tools/kleaver/CMakeLists.txt +index acc681e506c3..414c4d53ad10 100644 +--- a/tools/kleaver/CMakeLists.txt ++++ b/tools/kleaver/CMakeLists.txt +@@ -10,7 +10,11 @@ add_executable(kleaver + main.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs core support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(llvm_libs core support) ++else() ++ set(llvm_libs LLVM) ++endif() + + target_link_libraries(kleaver kleaverSolver ${llvm_libs}) + target_include_directories(kleaver PRIVATE ${KLEE_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS}) +diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt +index 9e30a9b76613..e852558d930a 100644 +--- a/unittests/CMakeLists.txt ++++ b/unittests/CMakeLists.txt +@@ -201,7 +201,11 @@ endif() + + add_library(unittest_main) + target_sources(unittest_main PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/TestMain.cpp") +-llvm_map_components_to_libnames(UNITTEST_MAIN_LIBS support) ++if (USE_MAP) ++ llvm_map_components_to_libnames(UNITTEST_MAIN_LIBS support) ++else() ++ set(UNITTEST_MAIN_LIBS LLVM) ++endif() + + target_link_libraries(unittest_main + PUBLIC +-- +2.40.0 + diff --git a/packages/k/klee/0001-gcc13-include-cstint-for-int-_t.patch b/packages/k/klee/0001-gcc13-include-cstint-for-int-_t.patch new file mode 100644 index 0000000..23f97ad --- /dev/null +++ b/packages/k/klee/0001-gcc13-include-cstint-for-int-_t.patch @@ -0,0 +1,39 @@ +From a5b33410851e89eff9b0baee52bc68c0d209aaeb Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Wed, 22 Mar 2023 09:48:50 +0100 +Subject: [PATCH] [gcc13] include cstint for *int*_t + +Otherwise we see errors like this with gcc13: +include/klee/Statistics/Statistic.h:31:10: error: no type named 'uint32_t' in namespace 'std' +--- + include/klee/Core/Interpreter.h | 1 + + include/klee/Statistics/Statistic.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/include/klee/Core/Interpreter.h b/include/klee/Core/Interpreter.h +index f14e3d88..04fdef88 100644 +--- a/include/klee/Core/Interpreter.h ++++ b/include/klee/Core/Interpreter.h +@@ -9,6 +9,7 @@ + #ifndef KLEE_INTERPRETER_H + #define KLEE_INTERPRETER_H + ++#include + #include + #include + #include +diff --git a/include/klee/Statistics/Statistic.h b/include/klee/Statistics/Statistic.h +index bbb67116..e675b067 100644 +--- a/include/klee/Statistics/Statistic.h ++++ b/include/klee/Statistics/Statistic.h +@@ -10,6 +10,7 @@ + #ifndef KLEE_STATISTIC_H + #define KLEE_STATISTIC_H + ++#include + #include + + namespace klee { +-- +2.35.3 + diff --git a/packages/k/klee/0001-llvm14-Add-LLVM-14-to-lit.cfg.patch b/packages/k/klee/0001-llvm14-Add-LLVM-14-to-lit.cfg.patch deleted file mode 100644 index 5845545..0000000 --- a/packages/k/klee/0001-llvm14-Add-LLVM-14-to-lit.cfg.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= -Date: Sat, 5 Mar 2022 13:44:24 +0100 -Subject: llvm14: Add LLVM 14 to lit.cfg -Git-repo: https://github.com/lzaoral/klee#llvm14 -Git-commit: 87b74ea337994d2a564bd583004ef4ae3d0bd2ce -Patch-mainline: no -References: llvm 14 - -Signed-off-by: Jiri Slaby ---- - test/lit.cfg | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/lit.cfg b/test/lit.cfg -index 4d7382cf..c935ab8e 100644 ---- a/test/lit.cfg -+++ b/test/lit.cfg -@@ -161,7 +161,7 @@ config.substitutions.append( - - # Add feature for the LLVM version in use, so it can be tested in REQUIRES and - # XFAIL checks. We also add "not-XXX" variants, for the same reason. --known_llvm_versions = { "9.0", "10.0", "11.0", "11.1", "12.0", "13.0" } -+known_llvm_versions = { "9.0", "10.0", "11.0", "11.1", "12.0", "13.0", "14.0" } - current_llvm_version_tuple = (int(config.llvm_version_major), int(config.llvm_version_minor)) - current_llvm_version = "%s.%s" % current_llvm_version_tuple - --- -2.35.3 - diff --git a/packages/k/klee/0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch b/packages/k/klee/0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch deleted file mode 100644 index 007a4bb..0000000 --- a/packages/k/klee/0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= -Date: Sat, 5 Mar 2022 14:08:11 +0100 -Subject: llvm14: TargetRegistry.h was moved from Support to MC -Git-repo: https://github.com/lzaoral/klee#llvm14 -Git-commit: fcbec7650d30a39bed145041c6b5e9d996185524 -Patch-mainline: no -References: llvm 14 - -Signed-off-by: Jiri Slaby ---- - lib/Module/RaiseAsm.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp -index 98e580a8..457927f9 100644 ---- a/lib/Module/RaiseAsm.cpp -+++ b/lib/Module/RaiseAsm.cpp -@@ -19,7 +19,11 @@ - #include "llvm/IR/Instructions.h" - #include "llvm/IR/LLVMContext.h" - #include "llvm/Support/Host.h" -+#if LLVM_VERSION_CODE >= LLVM_VERSION(14, 0) -+#include "llvm/MC/TargetRegistry.h" -+#else - #include "llvm/Support/TargetRegistry.h" -+#endif - #include "llvm/Target/TargetMachine.h" - - --- -2.35.3 - diff --git a/packages/k/klee/0003-llvm14-PointerType-getElementType-was-deprecated.patch b/packages/k/klee/0003-llvm14-PointerType-getElementType-was-deprecated.patch deleted file mode 100644 index 44f4393..0000000 --- a/packages/k/klee/0003-llvm14-PointerType-getElementType-was-deprecated.patch +++ /dev/null @@ -1,203 +0,0 @@ -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= -Date: Sat, 5 Mar 2022 16:50:36 +0100 -Subject: llvm14: PointerType::getElementType() was deprecated -Git-repo: https://github.com/lzaoral/klee#llvm14 -Git-commit: 6caf7f74dd5aedcb39ade5f33a34673d3b6b091f -Patch-mainline: no -References: llvm 14 - -... for LLVM 14 in [1] and has already been removed from the LLVM 15 -branch in [2]. - -Some changes are only temporary to silence the warning though, as -Type::getPointerElementType() is planned to be removed as well. [3] - -[1] https://reviews.llvm.org/D117885/new/ -[2] https://github.com/llvm/llvm-project/commit/d593cf7 -[3] https://llvm.org/docs/OpaquePointers.html#migration-instructions - -Signed-off-by: Jiri Slaby ---- - include/klee/Module/KCallable.h | 5 +++++ - include/klee/Module/KModule.h | 4 ++++ - lib/Core/Executor.cpp | 30 ++++++++++++---------------- - lib/Core/Executor.h | 2 +- - lib/Core/ExternalDispatcher.cpp | 3 +-- - lib/Core/GetElementPtrTypeIterator.h | 4 ++-- - lib/Module/FunctionAlias.cpp | 6 ++---- - 7 files changed, 28 insertions(+), 26 deletions(-) - -diff --git a/include/klee/Module/KCallable.h b/include/klee/Module/KCallable.h -index bf8b17ea..e25fb5b5 100644 ---- a/include/klee/Module/KCallable.h -+++ b/include/klee/Module/KCallable.h -@@ -32,6 +32,7 @@ public: - CallableKind getKind() const { return Kind; } - - virtual llvm::StringRef getName() const = 0; -+ virtual llvm::FunctionType *getFunctionType() const = 0; - virtual llvm::PointerType *getType() const = 0; - virtual llvm::Value *getValue() = 0; - -@@ -55,6 +56,10 @@ public: - - llvm::StringRef getName() const override { return name; } - -+ llvm::FunctionType *getFunctionType() const override { -+ return value->getFunctionType(); -+ } -+ - llvm::PointerType *getType() const override { return value->getType(); } - - llvm::Value *getValue() override { return value; } -diff --git a/include/klee/Module/KModule.h b/include/klee/Module/KModule.h -index 71fe8a0a..ca6d2b22 100644 ---- a/include/klee/Module/KModule.h -+++ b/include/klee/Module/KModule.h -@@ -64,6 +64,10 @@ namespace klee { - - llvm::StringRef getName() const override { return function->getName(); } - -+ llvm::FunctionType *getFunctionType() const override { -+ return function->getFunctionType(); -+ } -+ - llvm::PointerType *getType() const override { return function->getType(); } - - llvm::Value *getValue() override { return function; } -diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp -index 42405982..661198e7 100644 ---- a/lib/Core/Executor.cpp -+++ b/lib/Core/Executor.cpp -@@ -710,7 +710,7 @@ void Executor::allocateGlobalObjects(ExecutionState &state) { - - for (const GlobalVariable &v : m->globals()) { - std::size_t globalObjectAlignment = getAllocationAlignment(&v); -- Type *ty = v.getType()->getElementType(); -+ Type *ty = v.getValueType(); - std::uint64_t size = 0; - if (ty->isSized()) - size = kmodule->targetData->getTypeStoreSize(ty); -@@ -2420,10 +2420,9 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { - } - - if (f) { -- const FunctionType *fType = -- dyn_cast(cast(f->getType())->getElementType()); -+ const FunctionType *fType = f->getFunctionType(); - const FunctionType *fpType = -- dyn_cast(cast(fp->getType())->getElementType()); -+ dyn_cast(fp->getType()->getPointerElementType()); - - // special case the call with a bitcast case - if (fType != fpType) { -@@ -3324,13 +3323,14 @@ void Executor::updateStates(ExecutionState *current) { - removedStates.clear(); - } - --template -+template - void Executor::computeOffsetsSeqTy(KGEPInstruction *kgepi, - ref &constantOffset, - uint64_t index, const TypeIt it) { -- const auto *sq = cast(*it); -+ assert(it->getNumContainedTypes() == 1 && -+ "Sequential type must contain one subtype"); - uint64_t elementSize = -- kmodule->targetData->getTypeStoreSize(sq->getElementType()); -+ kmodule->targetData->getTypeStoreSize(it->getContainedType(0)); - const Value *operand = it.getOperand(); - if (const Constant *c = dyn_cast(operand)) { - ref index = -@@ -3355,12 +3355,9 @@ 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())); -- } else if (isa(*ii)) { -- computeOffsetsSeqTy(kgepi, constantOffset, index, ii); -- } else if (isa(*ii)) { -- computeOffsetsSeqTy(kgepi, constantOffset, index, ii); -- } else if (isa(*ii)) { -- computeOffsetsSeqTy(kgepi, constantOffset, index, ii); -+ } else if (isa(*ii) || isa(*ii) || -+ isa(*ii)) { -+ computeOffsetsSeqTy(kgepi, constantOffset, index, ii); - } else - assert("invalid type" && 0); - index++; -@@ -4611,10 +4608,9 @@ size_t Executor::getAllocationAlignment(const llvm::Value *allocSite) const { - alignment = GO->getAlignment(); - if (const GlobalVariable *globalVar = dyn_cast(GO)) { - // All GlobalVariables's have pointer type -- llvm::PointerType *ptrType = -- dyn_cast(globalVar->getType()); -- assert(ptrType && "globalVar's type is not a pointer"); -- type = ptrType->getElementType(); -+ assert(globalVar->getType()->isPointerTy() && -+ "globalVar's type is not a pointer"); -+ type = globalVar->getValueType(); - } else { - type = GO->getType(); - } -diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h -index 279d8bee..4b88567a 100644 ---- a/lib/Core/Executor.h -+++ b/lib/Core/Executor.h -@@ -450,7 +450,7 @@ private: - /// bindModuleConstants - Initialize the module constant table. - void bindModuleConstants(); - -- template -+ template - void computeOffsetsSeqTy(KGEPInstruction *kgepi, - ref &constantOffset, uint64_t index, - const TypeIt it); -diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp -index 7a0d8e14..d286bea9 100644 ---- a/lib/Core/ExternalDispatcher.cpp -+++ b/lib/Core/ExternalDispatcher.cpp -@@ -284,8 +284,7 @@ Function *ExternalDispatcherImpl::createDispatcher(KCallable *target, - argI64sp->getType()->getPointerElementType(), argI64sp, "args"); - - // Get the target function type. -- FunctionType *FTy = cast( -- cast(target->getType())->getElementType()); -+ FunctionType *FTy = target->getFunctionType(); - - // Each argument will be passed by writing it into gTheArgsP[i]. - unsigned i = 0, idx = 2; -diff --git a/lib/Core/GetElementPtrTypeIterator.h b/lib/Core/GetElementPtrTypeIterator.h -index 89606a0a..54fe6a29 100644 ---- a/lib/Core/GetElementPtrTypeIterator.h -+++ b/lib/Core/GetElementPtrTypeIterator.h -@@ -88,8 +88,8 @@ class generic_gep_type_iterator - if (llvm::CompositeType *CT = dyn_cast(CurTy)) { - CurTy = CT->getTypeAtIndex(getOperand()); - #endif -- } else if (auto ptr = dyn_cast(CurTy)) { -- CurTy = ptr->getElementType(); -+ } else if (llvm::isa(CurTy)) { -+ CurTy = CurTy->getPointerElementType(); - } else { - CurTy = 0; - } -diff --git a/lib/Module/FunctionAlias.cpp b/lib/Module/FunctionAlias.cpp -index a98b74fb..aa80b35d 100644 ---- a/lib/Module/FunctionAlias.cpp -+++ b/lib/Module/FunctionAlias.cpp -@@ -135,10 +135,8 @@ bool FunctionAliasPass::runOnModule(Module &M) { - - const FunctionType *FunctionAliasPass::getFunctionType(const GlobalValue *gv) { - const Type *type = gv->getType(); -- while (type->isPointerTy()) { -- const PointerType *ptr = cast(type); -- type = ptr->getElementType(); -- } -+ while (type->isPointerTy()) -+ type = type->getPointerElementType(); - return cast(type); - } - --- -2.35.3 - diff --git a/packages/k/klee/_servicedata b/packages/k/klee/_servicedata index 33535d6..c7035bb 100644 --- a/packages/k/klee/_servicedata +++ b/packages/k/klee/_servicedata @@ -1,4 +1,4 @@ https://github.com/klee/klee - 667ce0f1ef33c32fbe2d1836fc1b334066e244ca \ No newline at end of file + 1398e960ec9aca3f0ceac5e37062631986b9c2a8 \ No newline at end of file diff --git a/packages/k/klee/klee-2.3+20220926.obscpio b/packages/k/klee/klee-2.3+20220926.obscpio deleted file mode 120000 index a997877..0000000 --- a/packages/k/klee/klee-2.3+20220926.obscpio +++ /dev/null @@ -1 +0,0 @@ -/ipfs/bafybeiam6hc7oqokvnsndbi3db7isbhlyag3uoixc2eegjtespxwfufbru \ No newline at end of file diff --git a/packages/k/klee/klee-2.3+20230320.obscpio b/packages/k/klee/klee-2.3+20230320.obscpio new file mode 120000 index 0000000..ce2a90d --- /dev/null +++ b/packages/k/klee/klee-2.3+20230320.obscpio @@ -0,0 +1 @@ +/ipfs/bafybeiapuh2bbrfxgnmxsm6x7phexztrqul35nys4zjb2zdrw4vusw3og4 \ No newline at end of file diff --git a/packages/k/klee/klee.changes b/packages/k/klee/klee.changes index 926d1e7..2455445 100644 --- a/packages/k/klee/klee.changes +++ b/packages/k/klee/klee.changes @@ -1,4 +1,42 @@ ------------------------------------------------------------------- +Wed Mar 22 08:17:59 UTC 2023 - jslaby@suse.cz + +- Update to version 2.3+20230320: + * ConstantArrayExprVisitor: Fix detection of multiple array indices + * ConstantArrayExprVisitor: Deduplicate `visitConcat` and `visitRead` + * llvm14 support + * Update KDAlloc unittests + * Don't fail `KleeStats.c` test if it takes 1s or longer + * Disable `const_array_opt1` for ubsan as well + * Fix uninitialised memory access while reading last path entry + * Fix building of runtime library and klee-replay + * Add support to disable memsan instrumentation; update UB/Asan suppression + * [MemSan] Mark memory objects modified by syscalls as initialised + * Fix compiler warning with newer compilers + * Use bitcode library paths via config generation instead of `-D` flags + * [cmake] Use LLVM's CMake functionality only + * Fixed a bug in KLEE libc's implementation of strcmp: according to the C standard, characters should be compared as unsigned chars. + * Add some system tests for KDAlloc + * Integrate KDAlloc into KLEE + * Have the STP coverage build also provide Z3, so that the crosscheck solver can also be tested + * Add a few simple solver tests + * create klee-last as a relative link + * Fix integer overflow + * Add an extra check to test/Runtime/FreeStanding/memcpy_chk_err.c ensuring that a call to __memcpy_chk is emitted + * fix output check in test const_arr_opt1 + * add missing FileCheck command to test + * Fixed some leaks in klee-replay + * fix FileCheck cmd of VarArgByVal test +- remove (upstream): + * 0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch + * 0001-llvm14-Add-LLVM-14-to-lit.cfg.patch + * 0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch + * 0003-llvm14-PointerType-getElementType-was-deprecated.patch +- add + * 0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch + * 0001-gcc13-include-cstint-for-int-_t.patch + +------------------------------------------------------------------- Tue Oct 25 06:53:25 UTC 2022 - jslaby@suse.cz - Update to version 2.3+20220926: diff --git a/packages/k/klee/klee.obsinfo b/packages/k/klee/klee.obsinfo index dd7ac39..3fcfb37 100644 --- a/packages/k/klee/klee.obsinfo +++ b/packages/k/klee/klee.obsinfo @@ -1,4 +1,4 @@ name: klee -version: 2.3+20220926 -mtime: 1664181727 -commit: 667ce0f1ef33c32fbe2d1836fc1b334066e244ca +version: 2.3+20230320 +mtime: 1679328338 +commit: 1398e960ec9aca3f0ceac5e37062631986b9c2a8 diff --git a/packages/k/klee/klee.spec b/packages/k/klee/klee.spec index 91cdf8e..471efb8 100644 --- a/packages/k/klee/klee.spec +++ b/packages/k/klee/klee.spec @@ -1,7 +1,7 @@ # # spec file for package klee # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,7 +31,7 @@ Name: klee Summary: LLVM Execution Engine License: NCSA Group: Development/Languages/Other -Version: 2.3+20220926 +Version: 2.3+20230320 Release: 0 URL: http://klee.github.io/ Source0: %{name}-%{version}.tar.xz @@ -39,10 +39,8 @@ Source1: %{name}-rpmlintrc Source2: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/not/not.cpp Source3: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{llvm_version_major}.0.0/llvm/utils/FileCheck/FileCheck.cpp Patch0: 0001-test-disable-until-it-is-fixed.patch -Patch1: 0001-llvm14-Add-LLVM-14-to-lit.cfg.patch -Patch2: 0001-Module-InstructionOperandTypeCheckPass-Fix-Wbitwise-.patch -Patch3: 0002-llvm14-TargetRegistry.h-was-moved-from-Support-to-MC.patch -Patch4: 0003-llvm14-PointerType-getElementType-was-deprecated.patch +Patch1: 0001-cmake-implement-USE_MAP-to-support-single-LLVM-libra.patch +Patch2: 0001-gcc13-include-cstint-for-int-_t.patch BuildRequires: clang%{llvm_version} BuildRequires: cmake BuildRequires: gperftools-devel