Skip to content

Commit

Permalink
Build GIE ffi wrapper using clang with llvm LTO.
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <sighingnow@gmail.com>
  • Loading branch information
sighingnow committed Apr 16, 2021
1 parent 1a6b040 commit fa37867
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions interactive_engine/src/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ members = [
"Pegasus",
]

[build]
rustflags = [
"-C", "linker-plugin-lto",
"-C", "linker=clang",
"-C", "link-arg=-fuse-ld=lld",
]

[profile.release]
opt-level = 3
debug = true
Expand Down
2 changes: 2 additions & 0 deletions interactive_engine/src/executor/runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ use std::env;

fn main() {
let dst = Config::new("native")
.define("CMAKE_C_COMPILER", "clang")
.define("CMAKE_CXX_COMPILER", "clang++")
.build_target("native_store")
.build();

Expand Down
5 changes: 3 additions & 2 deletions interactive_engine/src/executor/runtime/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ macro(install_vineyard_target target)
)
endmacro()

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-deprecated-declarations")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -flto=thin -fuse-ld=lld")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=thin -fuse-ld=lld -std=c++14 -Wall -Wno-deprecated-declarations")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -Wl,-fuse-ld=lld")

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
Expand Down

0 comments on commit fa37867

Please sign in to comment.