The package rpms/klee.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/klee.git/commit/?id=4c81b783dbc80....
Change:
+%ifarch x86_64
Thanks.
Full change:
============
commit 4c81b783dbc80601ee6a80ac93cb4fa44d13cf0d
Author: Lukas Zaoral <lzaoral(a)redhat.com>
Date: Mon Aug 2 16:47:54 2021 +0200
Initial import (#1981739)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8015da7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/klee-2.2.tar.gz
diff --git a/fix-llvm12.patch b/fix-llvm12.patch
new file mode 100644
index 0000000..c57ad92
--- /dev/null
+++ b/fix-llvm12.patch
@@ -0,0 +1,72 @@
+From 5f182431d333c127ec71930950483039b89fb07f Mon Sep 17 00:00:00 2001
+From: Lukas Zaoral <lzaoral(a)redhat.com>
+Date: Thu, 4 Mar 2021 15:02:57 +0100
+Subject: [PATCH 1/2] llvm12: VectorType::getNumElements() has been deprecated
+
+... and has already been removed from the LLVM 13 source tree.
+
+See:
+https://reviews.llvm.org/D78127
+https://reviews.llvm.org/D95570
+---
+ lib/Core/Executor.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
+index bf359c2d..e5d57eb0 100644
+--- a/lib/Core/Executor.cpp
++++ b/lib/Core/Executor.cpp
+@@ -3095,7 +3095,11 @@ void Executor::executeInstruction(ExecutionState &state,
KInstruction *ki) {
+ return;
+ }
+ uint64_t iIdx = cIdx->getZExtValue();
++#if LLVM_VERSION_MAJOR >= 11
++ const auto *vt = cast<llvm::FixedVectorType>(iei->getType());
++#else
+ const llvm::VectorType *vt = iei->getType();
++#endif
+ unsigned EltBits = getWidthForLLVMType(vt->getElementType());
+
+ if (iIdx >= vt->getNumElements()) {
+@@ -3133,7 +3137,11 @@ void Executor::executeInstruction(ExecutionState &state,
KInstruction *ki) {
+ return;
+ }
+ uint64_t iIdx = cIdx->getZExtValue();
++#if LLVM_VERSION_MAJOR >= 11
++ const auto *vt = cast<llvm::FixedVectorType>(eei->getVectorOperandType());
++#else
+ const llvm::VectorType *vt = eei->getVectorOperandType();
++#endif
+ unsigned EltBits = getWidthForLLVMType(vt->getElementType());
+
+ if (iIdx >= vt->getNumElements()) {
+--
+2.30.2
+
+
+From a4f04ad1b628455f0ebb82ce1aa5941a38dc11b9 Mon Sep 17 00:00:00 2001
+From: Lukas Zaoral <lzaoral(a)redhat.com>
+Date: Thu, 4 Mar 2021 15:12:03 +0100
+Subject: [PATCH 2/2] llvm12: Add LLVM 12 to lit.cfg
+
+---
+ test/lit.cfg | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/test/lit.cfg b/test/lit.cfg
+index 6a02daee..135a45af 100644
+--- a/test/lit.cfg
++++ b/test/lit.cfg
+@@ -157,7 +157,8 @@ 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 = set(["3.8", "3.9", "4.0",
"5.0", "6.0", "7.0", "7.1", "8.0",
"9.0", "10.0", "11.0"])
++known_llvm_versions = { "3.8", "3.9", "4.0",
"5.0", "6.0", "7.0", "7.1", "8.0",
++ "9.0", "10.0", "11.0",
"11.1", "12.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.30.2
+
diff --git a/klee.spec b/klee.spec
new file mode 100644
index 0000000..4c9b3ee
--- /dev/null
+++ b/klee.spec
@@ -0,0 +1,110 @@
+Name: klee
+Version: 2.2
+Release: 1%{?dist}
+Summary: Symbolic Execution Engine
+
+# Licenses
+#
+# * Most files are under NCSA.
+# * cmake/GetGitRevisionDescription.cmake* are under Boost.
+# * cmake/modules/FindSQLite3.cmake is under MIT.
+# * lib/Support/RNG.cpp and runtime/klee-libc/stpcpy.c are under BSD.
+# * runtime/Freestanding/memcmp.c and runtime/klee-libc/{atoi.c,memchr.c,
+# strcat.c,strncmp.c,strncpy.c,strtol.c,strtoul.c} are under BSD with
+# advertising.
+
+License: NCSA and Boost and MIT and BSD and BSD with advertising
+URL: https://%{name}.github.io
+Source0:
https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}...
+
+# KLEE does not compile on 32 bit architectures.
+Excludearch: %{ix86} %{arm}
+
+#
https://github.com/klee/klee/pull/1403
+Patch0: use-python3.patch
+#
https://github.com/klee/klee/pull/1389
+Patch1: fix-llvm12.patch
+Patch2: use-system-gtest.patch
+
+BuildRequires: clang
+BuildRequires: cmake
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: gperftools-devel
+BuildRequires: llvm-devel
+BuildRequires: make
+BuildRequires: ninja-build
+BuildRequires: sqlite-devel
+BuildRequires: stp-devel
+BuildRequires: zlib-devel
+
+# FIXME: Remove when rhbz#1981466 is resolved.
+BuildRequires: cryptominisat-devel
+BuildRequires: minisat2-devel
+
+# Needed for tests.
+BuildRequires: gtest-devel
+BuildRequires: python3-lit
+BuildRequires: python3-tabulate
+
+%description
+Symbolic virtual machine built on top of the LLVM compiler infrastructure.
+
+%prep
+%autosetup -p1
+
+%build
+%cmake -GNinja \
+ -DENABLE_DOXYGEN:BOOL=OFF \
+ -DENABLE_SOLVER_STP:BOOL=ON \
+ -DENABLE_SOLVER_Z3:BOOL=OFF \
+ -DENABLE_SOLVER_METASMT:BOOL=OFF \
+ -DENABLE_UNIT_TESTS:BOOL=ON
+%cmake_build
+
+%install
+%cmake_install
+
+%check
+# Tests expect x86_64.
+%ifarch x86_64
+%cmake_build --target systemtests
+
+# FIXME: Workaround as lit is currently incompatible with upstream gtest.
+#
https://reviews.llvm.org/D100043
+for test in ./%{__cmake_builddir}/unittests/*Test; do
+ ./"$test"
+done
+%endif
+
+%files
+%doc NEWS README.md
+%license LICENSE.TXT
+
+%{_bindir}/gen-bout
+%{_bindir}/gen-random-bout
+%{_bindir}/kleaver
+%{_bindir}/klee
+%{_bindir}/klee-replay
+%{_bindir}/klee-stats
+%{_bindir}/klee-zesti
+%{_bindir}/ktest-tool
+%{_libdir}/klee/
+
+# Following files are meant to be used by users of KLEE and not by developers.
+#
+# * <klee/klee.h> contains definitions of functions used by the executed
+# bitcode to interact with KLEE itself,
+# * libkleeRuntest is a support library that can be linked to the source code
+# for which the tests were generated to replay a concrete test case.
+#
+# For more information see
https://klee.github.io/tutorials/testing-function.
+
+%dir %{_includedir}/klee
+%{_includedir}/klee/klee.h
+%{_libdir}/libkleeRuntest.so
+%{_libdir}/libkleeRuntest.so.1.0
+
+%changelog
+* Thu Jul 15 2021 Lukas Zaoral <lzaoral(a)redhat.com> - 2.2-1
+- First release
diff --git a/sources b/sources
new file mode 100644
index 0000000..14b46e9
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (klee-2.2.tar.gz) =
ed4ab4f26082700affa44efff071547c6868b43c5cc2491d180ab939ec8e8c8f7926c2a58102057a5c0a9a49d349c6786b737d6a8b8ad0dbd0539cac95fbc983
diff --git a/use-python3.patch b/use-python3.patch
new file mode 100644
index 0000000..59cad75
--- /dev/null
+++ b/use-python3.patch
@@ -0,0 +1,22 @@
+From 0a0e962568bdcb01e4be9fe9792b4c43d794caa5 Mon Sep 17 00:00:00 2001
+From: Lukas Zaoral <lzaoral(a)redhat.com>
+Date: Sat, 20 Mar 2021 14:23:24 +0100
+Subject: [PATCH] [tests] Use Python 3
+
+---
+ test/Concrete/ConcreteTest.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/Concrete/ConcreteTest.py b/test/Concrete/ConcreteTest.py
+index 0de481b3..0c464b09 100755
+--- a/test/Concrete/ConcreteTest.py
++++ b/test/Concrete/ConcreteTest.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ from __future__ import print_function
+ import argparse
+--
+2.30.2
+
diff --git a/use-system-gtest.patch b/use-system-gtest.patch
new file mode 100644
index 0000000..f08f17f
--- /dev/null
+++ b/use-system-gtest.patch
@@ -0,0 +1,89 @@
+From 858fa5392d43419f97a87c1bf4bdac7793bb418a Mon Sep 17 00:00:00 2001
+From: Lukas Zaoral <lzaoral(a)redhat.com>
+Date: Thu, 8 Apr 2021 11:15:38 +0200
+Subject: [PATCH] cmake: Use system GTest if it is available
+
+---
+ unittests/CMakeLists.txt | 40 ++++++++++++++++++++++++++--------------
+ 1 file changed, 26 insertions(+), 14 deletions(-)
+
+diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
+index aff9d26e..5f0bb854 100644
+--- a/unittests/CMakeLists.txt
++++ b/unittests/CMakeLists.txt
+@@ -50,9 +50,12 @@ if (TARGET gtest AND TARGET gtest_main)
+ endif()
+ else()
+ # LLVM's targets are not reused
+-
+ if (NOT GTEST_SRC_DIR)
+- if (USE_CMAKE_FIND_PACKAGE_LLVM AND LLVM_BUILD_MAIN_SRC_DIR)
++ # Try using system installation of GTest first
++ find_package(GTest CONFIG QUIET)
++ if (GTest_FOUND)
++ message(STATUS "Found GTest ${GTest_VERSION}")
++ elseif (USE_CMAKE_FIND_PACKAGE_LLVM AND LLVM_BUILD_MAIN_SRC_DIR)
+ # build from LLVM's utils directory
+ # NOTE: This can only be done using USE_CMAKE_FIND_PACKAGE_LLVM as
+ # LLVM replaced Google Test's CMakeLists.txt with its own,
+@@ -89,7 +92,7 @@ else()
+ endif()
+ endif()
+
+- if (NOT (TARGET gtest AND TARGET gtest_main))
++ if (NOT ((TARGET gtest AND TARGET gtest_main) OR GTest_FOUND))
+ # building from GTEST_SRC_DIR, not from LLVM's utils directory
+ find_path(GTEST_INCLUDE_DIR
+ "gtest/gtest.h"
+@@ -122,11 +125,13 @@ else()
+ add_subdirectory(${GTEST_SRC_DIR}
"${CMAKE_CURRENT_BINARY_DIR}/gtest_build")
+ endif()
+
+- # build Google Test with KLEE's defines and compile flags
+- target_compile_definitions(gtest PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})
+- target_compile_definitions(gtest_main PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})
+- target_compile_options(gtest PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
+- target_compile_options(gtest_main PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
++ if (NOT GTest_FOUND)
++ # build Google Test with KLEE's defines and compile flags
++ target_compile_definitions(gtest PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})
++ target_compile_definitions(gtest_main PRIVATE ${KLEE_COMPONENT_CXX_DEFINES})
++ target_compile_options(gtest PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
++ target_compile_options(gtest_main PRIVATE ${KLEE_COMPONENT_CXX_FLAGS})
++ endif()
+ endif()
+
+
+@@ -139,16 +144,23 @@ define_property(GLOBAL
+ FULL_DOCS "KLEE unit tests"
+ )
+
+-if (NOT IS_DIRECTORY "${GTEST_INCLUDE_DIR}")
+- message(FATAL_ERROR
+- "Cannot find Google Test include directory
\"${GTEST_INCLUDE_DIR}\"")
++if (NOT GTest_FOUND)
++ if (NOT IS_DIRECTORY "${GTEST_INCLUDE_DIR}")
++ message(FATAL_ERROR
++ "Cannot find Google Test include directory
\"${GTEST_INCLUDE_DIR}\"")
++ endif()
++ message(STATUS "GTEST_INCLUDE_DIR: ${GTEST_INCLUDE_DIR}")
+ endif()
+-message(STATUS "GTEST_INCLUDE_DIR: ${GTEST_INCLUDE_DIR}")
+
+ function(add_klee_unit_test target_name)
+ add_executable(${target_name} ${ARGN})
+- target_link_libraries(${target_name} PRIVATE gtest_main)
+- target_include_directories(${target_name} BEFORE PRIVATE
"${GTEST_INCLUDE_DIR}")
++ if (GTest_FOUND)
++ target_link_libraries(${target_name} PRIVATE GTest::gtest_main)
++ else()
++ target_link_libraries(${target_name} PRIVATE gtest_main)
++ target_include_directories(${target_name} BEFORE PRIVATE
"${GTEST_INCLUDE_DIR}")
++ endif()
++
+ target_include_directories(${target_name} BEFORE PRIVATE
${KLEE_COMPONENT_EXTRA_INCLUDE_DIRS})
+ set_target_properties(${target_name}
+ PROPERTIES
+--
+2.30.2
+