From 36ab145919a701c462e4e97220f07c0c9a725a17 Mon Sep 17 00:00:00 2001 From: Siddharth Priya Date: Tue, 23 Jan 2024 14:58:37 -0500 Subject: [PATCH] fix(build): link using lld-14 explictly --- CMakeLists.txt | 1 + Cargo.toml | 4 ++-- cmake/SeaHornBuild.cmake | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 667e22a..eb7f520 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ set(SEA_PP "${SEAHORN_ROOT}/bin/seapp" CACHE STRING "Path to seapp binary") set(LLVM_OBJCOPY "llvm-objcopy-14" CACHE STRING "Path to llvm-objcopy") set(LLVM_DIS "llvm-dis-14" CACHE STRING "Path to llvm-dis") +set(LLD "lld-14" CACHE STRING "Path to lld") set(LLVM_NM ${DEFAULT_LLVM_NM} CACHE PATH "Path to llvm-nm") set(LLVMIR_LINK ${SEA_LINK}) diff --git a/Cargo.toml b/Cargo.toml index b295f33..c15ea87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ opt-level = 2 rustflags = [ "-Clinker-plugin-lto", "-Clinker=clang-14", - "-Clink-arg=-fuse-ld=lld", + "-Clink-arg=-fuse-ld=lld-14", "-Zemit-thin-lto=no", ] @@ -24,7 +24,7 @@ opt-level = 2 rustflags = [ "-Clinker-plugin-lto", "-Clinker=clang-14", - "-Clink-arg=-fuse-ld=lld", + "-Clink-arg=-fuse-ld=lld-14", "-Zemit-thin-lto=no" ] diff --git a/cmake/SeaHornBuild.cmake b/cmake/SeaHornBuild.cmake index ab798d9..e1893c1 100644 --- a/cmake/SeaHornBuild.cmake +++ b/cmake/SeaHornBuild.cmake @@ -79,7 +79,7 @@ function(c_rust_llvm TARGET SRC_FILES) # Still do optimization for the executable (XXX is this needed?) target_link_options(${TARGET} PUBLIC -flto - -fuse-ld=lld + -fuse-ld=${LLD} -Wl,--plugin-opt=-lto-embed-bitcode=post-merge-pre-opt --target=${ARCH} -O1