Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

klee: migrate to llvm@16 #181628

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions Formula/k/klee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Klee < Formula
depends_on "cmake" => :build

depends_on "gperftools"
depends_on "llvm@14" # LLVM 16 PR: https://github.com/klee/klee/pull/1664
depends_on "llvm@16"
depends_on "python@3.12"
depends_on "sqlite"
depends_on "stp"
Expand All @@ -37,16 +37,12 @@ class Klee < Formula
depends_on "minisat"
end

on_linux do
depends_on "python-setuptools" => :build # Remove with LLVM 15+
end

fails_with gcc: "5"

# klee needs a version of libc++ compiled with wllvm
resource "libcxx" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-project-14.0.6.src.tar.xz"
sha256 "8b3cfd7bc695bd6cea0f37f53f0981f34f87496e79e2529874fd03a2f9dd3a8a"
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/llvm-project-16.0.6.src.tar.xz"
sha256 "ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e"
end

resource "tabulate" do
Expand All @@ -66,8 +62,10 @@ def install
# Use build configuration at
# https://github.com/klee/klee/blob/v#{version}/scripts/build/p-libcxx.inc
libcxx_args = std_cmake_args(install_prefix: libcxx_install_dir) + %W[
-DCMAKE_INSTALL_RPATH=#{rpath}
-DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi
-DRUNTIMES_CMAKE_ARGS=-DCMAKE_INSTALL_RPATH=#{rpath}
-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi
-DLLVM_ENABLE_PROJECTS=
-DLLVM_ENABLE_PROJECTS_USED:BOOL=ON
-DLLVM_ENABLE_THREADS:BOOL=OFF
-DLLVM_ENABLE_EH:BOOL=OFF
-DLLVM_ENABLE_RTTI:BOOL=OFF
Expand All @@ -84,8 +82,8 @@ def install
LLVM_COMPILER_PATH: llvm.opt_bin,
) do
system "cmake", "-S", libcxx_src_dir/"llvm", "-B", "libcxx_build", *libcxx_args
system "cmake", "--build", "libcxx_build", "--target", "cxx"
system "cmake", "--build", "libcxx_build/projects", "--target", "install"
system "cmake", "--build", "libcxx_build", "--target", "runtimes"
system "cmake", "--install", "libcxx_build/runtimes"
end

libcxx_libs = libcxx_install_dir.glob("lib/{#{shared_library("*")},*.a}").reject(&:symlink?)
Expand Down Expand Up @@ -157,7 +155,7 @@ def install
"-c", "-g", "-O0", "-Xclang", "-disable-O0-optnone",
testpath/"get_sign.c"

total_instructions = 33
total_instructions = 32
expected_output = <<~EOS
KLEE: done: total instructions = #{total_instructions}
KLEE: done: completed paths = 3
Expand Down
Loading