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

add libunwind as dependency #1081

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ RUN apt-get update \
libfmt-dev \
libgmp-dev \
libmpfr-dev \
libyaml-dev \
libjemalloc-dev \
libunwind-dev \
libyaml-dev \
openjdk-${JDK_VERSION}-jdk \
curl \
maven \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.arch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM archlinux:base

RUN pacman -Syyu --noconfirm && \
pacman -S --noconfirm base-devel git cmake clang llvm lld flex boost gmp mpfr libyaml jemalloc curl maven pkg-config python3
pacman -S --noconfirm base-devel git cmake clang llvm lld flex boost gmp mpfr jemalloc libunwind libyaml curl maven pkg-config python3

ARG USER_ID=1000
ARG GROUP_ID=1000
Expand Down
2 changes: 2 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sudo apt install \
libgmp-dev \
libjemalloc-dev \
libmpfr-dev \
libunwind-dev \
libyaml-dev \
lld-15 \
llvm-15-tools \
Expand All @@ -40,6 +41,7 @@ brew install \
git \
gmp \
jemalloc \
libunwind \
libyaml \
llvm@15 \
maven \
Expand Down
6 changes: 3 additions & 3 deletions bin/llvm-kompile-clang
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ if [ "$main" = "static" ]; then
elif [[ "$main" =~ "python" ]]; then
# Don't link jemalloc when building a python library; it clashes with the
# pymalloc implementation that Python expects you to use.
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi")
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi" "-lunwind")
flags+=("-fPIC" "-shared" "-I${INCDIR}" "-fvisibility=hidden")

read -r -a python_include_flags <<< "$("${python_cmd}" -m pybind11 --includes)"
Expand All @@ -239,11 +239,11 @@ elif [ "$main" = "c" ]; then

# Avoid jemalloc for similar reasons as Python; we don't know who is loading
# this library so don't want to impose it.
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi")
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi" "-lunwind")
flags+=("-fPIC" "-shared" "$start_whole_archive" "$LIBDIR/libkllvmcruntime.a" "$end_whole_archive")
clangpp_args+=("-o" "${output_file}")
else
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi" "-ljemalloc")
all_libraries=("${libraries[@]}" "-lgmp" "-lgmpxx" "-lmpfr" "-lpthread" "-ldl" "-lffi" "-ljemalloc" "-lunwind")
fi

if $link; then
Expand Down
5 changes: 3 additions & 2 deletions nix/llvm-backend.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, src, cmake, flex, fmt, pkg-config, llvm, libllvm, libcxx, stdenv, boost, gmp
, jemalloc, libffi, libiconv, libyaml, mpfr, ncurses, python310, unixtools,
, jemalloc, libffi, libiconv, libunwind, libyaml, mpfr, ncurses, python310, unixtools,
# Runtime dependencies:
host,
# Options:
Expand All @@ -15,7 +15,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake flex llvm pkg-config ];
buildInputs = [ libyaml ];
propagatedBuildInputs = [
boost fmt gmp jemalloc libffi mpfr ncurses python-env unixtools.xxd
boost fmt gmp libunwind jemalloc libffi mpfr ncurses python-env unixtools.xxd
] ++ lib.optional stdenv.isDarwin libiconv;

dontStrip = true;
Expand All @@ -40,6 +40,7 @@ stdenv.mkDerivation {
--replace '"-liconv"' '"-L${libiconv}/lib" "-liconv"' \
--replace '"-lncurses"' '"-L${ncurses}/lib" "-lncurses"' \
--replace '"-ltinfo"' '"-L${ncurses}/lib" "-ltinfo"' \
--replace '"-lunwind"' '"-L${libunwind}/lib" "-lunwind"' \
--replace '"-L@BREW_PREFIX@/opt/libffi/lib"' ' ' \
--replace '-L@BREW_PREFIX@/lib' '-L${libcxx}/lib' \
--replace '-I "$(dirname "$0")"/../include/kllvm' \
Expand Down
2 changes: 1 addition & 1 deletion nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let
clang = llvmPackages.clangNoLibcxx;

llvm-backend = prev.callPackage ./llvm-backend.nix {
inherit (llvmPackages) llvm libllvm libcxx;
inherit (llvmPackages) llvm libllvm libcxx libunwind;
stdenv = llvmPackages.stdenv;
cmakeBuildType = prev.llvm-backend-build-type;
src = prev.llvm-backend-src;
Expand Down
4 changes: 2 additions & 2 deletions package/debian/control.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Source: k-llvm-backend
Section: devel
Priority: optional
Maintainer: Bruce Collie <bruce.collie@runtimeverification.com>
Build-Depends: clang-15 , cmake , debhelper (>=10) , flex , libboost-dev , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , llvm-15-tools , pkg-config , python3 , python3-dev , xxd
Build-Depends: clang-15 , cmake , debhelper (>=10) , flex , libboost-dev , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libunwind-dev , libyaml-dev , llvm-15-tools , pkg-config , python3 , python3-dev , xxd
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/llvm-backend

Package: k-llvm-backend
Architecture: any
Section: devel
Priority: optional
Depends: clang-15 , flex , libboost-dev , libffi-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-0-2 , lld-15 , llvm-15 , pkg-config
Depends: clang-15 , flex , libboost-dev , libffi-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libunwind-dev , libyaml-0-2 , lld-15 , llvm-15 , pkg-config
Description: K Framework LLVM backend
Fast concrete execution backend for programming language semantics implemented using the K Framework.
Homepage: https://github.com/runtimeverification/llvm-backend
4 changes: 2 additions & 2 deletions package/debian/control.noble
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Source: k-llvm-backend
Section: devel
Priority: optional
Maintainer: Bruce Collie <bruce.collie@runtimeverification.com>
Build-Depends: clang-17 , cmake , debhelper (>=10) , flex , libboost-dev , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-dev , llvm-17-tools , pkg-config , python3 , python3-dev , xxd
Build-Depends: clang-17 , cmake , debhelper (>=10) , flex , libboost-dev , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libunwind-dev , libyaml-dev , llvm-17-tools , pkg-config , python3 , python3-dev , xxd
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/llvm-backend

Package: k-llvm-backend
Architecture: any
Section: devel
Priority: optional
Depends: clang-17 , flex , libboost-dev , libffi-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libyaml-0-2 , lld-17 , llvm-17 , pkg-config
Depends: clang-17 , flex , libboost-dev , libffi-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libunwind-dev , libyaml-0-2 , lld-17 , llvm-17 , pkg-config
Description: K Framework LLVM backend
Fast concrete execution backend for programming language semantics implemented using the K Framework.
Homepage: https://github.com/runtimeverification/llvm-backend
Loading