Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gn build] Add build file for libLTO.dylib
Not used by anything yet, but will be needed to make check-llvm run ld64's libLTO plugin tests. Differential Revision: https://reviews.llvm.org/D56317 llvm-svn: 350409
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import("//llvm/version.gni") | ||
|
||
lto_target_type = "loadable_module" | ||
if (host_os == "linux") { | ||
# Linux needs -fPIC to build shared libs but they aren't on by default. | ||
# For now, make libclang a static lib there. | ||
lto_target_type = "static_library" | ||
} | ||
|
||
target(lto_target_type, "lto") { | ||
output_name = "libLTO" | ||
deps = [ | ||
"//llvm/lib/Bitcode/Reader", | ||
"//llvm/lib/IR", | ||
"//llvm/lib/LTO", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/MC/MCDisassembler", | ||
"//llvm/lib/Support", | ||
"//llvm/lib/Target", | ||
"//llvm/lib/Target:TargetsToBuild", | ||
] | ||
sources = [ | ||
"LTODisassembler.cpp", | ||
"lto.cpp", | ||
] | ||
|
||
if (host_os == "mac") { | ||
ldflags = [ | ||
"-Wl,-compatibility_version,1", | ||
"-Wl,-current_version,$llvm_version", | ||
|
||
# See llvm_setup_rpath() in CMake. | ||
"-Wl,-install_name,@rpath/libLTO.dylib", | ||
"-Wl,-rpath,@loader_path/../lib", | ||
] | ||
} | ||
|
||
# FIXME: Use lto.exports | ||
} |