klee/klee.spec

192 lines
5.9 KiB
RPMSpec

#
# spec file for package klee
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define llvm_version_major 6
%define llvm_version_minor 0
%define llvm_version %{llvm_version_major}
%define version_unconverted 1.4.0+20180614
%ifarch %{ix86} x86_64
%define with_uclibc 1
%else
%define with_uclibc 0
%endif
Name: klee
Summary: LLVM Execution Engine
License: NCSA
Group: Development/Languages/Other
Version: 1.4.0+20180614
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
Patch201: 0001-test-remove-undefined-behaviour.patch
Patch202: 0002-llvm38-no-rounding-in-APFloat.patch
Patch203: 0003-llvm38-handle-optimization-passes-changes.patch
Patch204: 0004-llvm38-SmallString-is-always-up-to-date.patch
Patch205: 0005-llvm38-materializeAllPermanently-was-renamed.patch
Patch206: 0006-llvm38-adapt-to-new-Linker-linkModules.patch
Patch207: 0007-llvm38-archive-child-iterator-changes.patch
Patch208: 0008-llvm38-no-more-implicit-iterators.patch
Patch209: 0009-llvm38-test-change-some-tests.patch
Patch210: 0010-llvm-make-KLEE-compile-against-LLVM-3.9.patch
Patch211: 0011-cmake-find_llvm-fix-libraries-with-llvm-config-3.9.patch
Patch212: 0012-llvm40-handle-different-header-names.patch
Patch213: 0013-llvm-APFloat-members-are-functions-in-LLVM-4.0.patch
Patch214: 0014-llvm40-errorOr-and-similar.patch
Patch215: 0015-llvm-use-chrono-helpers-from-LLVM-4.0.patch
Patch216: 0016-llvm-PointerType-is-not-SequentialType-in-LLVM-4.patch
Patch217: 0017-llvm40-gep_type_iterator-has-no-operator.patch
Patch218: 0018-llvm50-avoid-on-function-arg_begin.patch
Patch219: 0019-llvm50-integerPartWidth-is-from-llvm-APFloatBase.patch
Patch220: 0020-llvm50-handle-getOrInsertFunction-terminator.patch
Patch221: 0021-llvm50-SwitchInst-case-functions-now-return-pointers.patch
Patch222: 0022-llvm50-handle-new-file_magic-s-location.patch
Patch223: 0023-llvm50-use-MutableArrayRef-for-APFloat-convertToInte.patch
Patch224: 0024-llvm50-AllocaInst-takes-address-space.patch
Patch225: 0025-llvm50-Intrinsic-objectsize-has-three-arguments.patch
Patch226: 0026-llvm50-test-change-objectsize.patch
Patch227: 0027-llvm50-test-add-disable-O0-optnone-to-O0.patch
Patch228: 0028-llvm60-SetVersionPrinter-now-passes-down-a-stream.patch
Patch229: 0029-llvm60-handle-headers-renaming.patch
BuildRequires: clang%{llvm_version}
BuildRequires: cmake
BuildRequires: gperftools-devel
%if %{with_uclibc}
BuildRequires: klee-uclibc-devel-static(llvm%{llvm_version})
%endif
BuildRequires: libacl-devel
BuildRequires: libcap-devel
BuildRequires: libselinux-devel
BuildRequires: llvm%{llvm_version}-devel
BuildRequires: ninja
BuildRequires: python3-base
BuildRequires: python3-lit
BuildRequires: python3-setuptools
BuildRequires: stp-devel
BuildRequires: xz
BuildRequires: zlib-devel
%description
KLEE is a symbolic virtual machine built on top of the LLVM compiler
infrastructure, and available under the UIUC open source license. For more
information on what KLEE is and what it can do, see the OSDI 2008 paper.
%prep
%setup -q
%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
%patch221 -p1
%patch222 -p1
%patch223 -p1
%patch224 -p1
%patch225 -p1
%patch226 -p1
%patch227 -p1
%patch228 -p1
%patch229 -p1
mkdir -p build/test/
cp %{SOURCE2} build/test/
cp %{SOURCE3} build/test/
sed -i '1s@env python@python3@' test/Concrete/ConcreteTest.py \
tools/klee-stats/klee-stats \
tools/ktest-tool/ktest-tool
%build
%define __builder ninja
# they use -DNDEBUG, but we cannot, hence setting CMAKE_C*_FLAGS
# SHARED libs do not work at all yet
%cmake \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DENABLE_DOXYGEN=OFF \
-DENABLE_SOLVER_STP=ON \
-DENABLE_TCMALLOC=ON \
-DENABLE_UNIT_TESTS=OFF \
-DENABLE_SYSTEM_TESTS=ON \
-DCMAKE_C_FLAGS="%optflags" \
-DCMAKE_CXX_FLAGS="%optflags" \
%if %{with_uclibc}
-DENABLE_POSIX_RUNTIME=ON \
-DENABLE_KLEE_UCLIBC=ON \
-DKLEE_UCLIBC_PATH=%{_libdir}/klee-uclibc/ \
%endif
-DBUILD_SHARED_LIBS:BOOL=OFF
%make_jobs
%check
%ifarch x86_64
cd build
ninja check
%endif
%install
%cmake_install
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc LICENSE.TXT NEWS README.md TODO.txt
%{_bindir}/gen-random-bout
%{_bindir}/kleaver
%{_bindir}/klee
%{_bindir}/klee-replay
%{_bindir}/klee-stats
%{_bindir}/ktest-tool
%{_includedir}/klee/
%{_libdir}/libkleeRuntest.so*
%dir %{_libdir}/klee/
%dir %{_libdir}/klee/runtime/
%{_libdir}/klee/runtime/klee-libc.bc
%{_libdir}/klee/runtime/kleeRuntimeIntrinsic.bc
%if %{with_uclibc}
%{_libdir}/klee/runtime/klee-uclibc.bca
%{_libdir}/klee/runtime/libkleeRuntimePOSIX.bca
%endif
%changelog