[PATCH] D56317: [gn build] Add build file for libLTO.dylib
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 4 09:16:10 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350409: [gn build] Add build file for libLTO.dylib (authored by nico, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56317?vs=180238&id=180257#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56317/new/
https://reviews.llvm.org/D56317
Files:
llvm/trunk/utils/gn/secondary/clang/tools/libclang/BUILD.gn
llvm/trunk/utils/gn/secondary/llvm/tools/lto/BUILD.gn
Index: llvm/trunk/utils/gn/secondary/llvm/tools/lto/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/llvm/tools/lto/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/llvm/tools/lto/BUILD.gn
@@ -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, at rpath/libLTO.dylib",
+ "-Wl,-rpath, at loader_path/../lib",
+ ]
+ }
+
+ # FIXME: Use lto.exports
+}
Index: llvm/trunk/utils/gn/secondary/clang/tools/libclang/BUILD.gn
===================================================================
--- llvm/trunk/utils/gn/secondary/clang/tools/libclang/BUILD.gn
+++ llvm/trunk/utils/gn/secondary/clang/tools/libclang/BUILD.gn
@@ -6,7 +6,7 @@
# - linking in clangTidyPlugin and clangIncludeFixerPlugin from
# clang-tools-extra (which doesn't have any GN build files yet)
# - using libclang.exports
-# - an build target copying the Python bindings
+# - a build target copying the Python bindings
# - the GN linux build always builds without -fPIC (as if LLVM_ENABLE_PIC=OFF
# in the CMake build), so libclang is always a static library on linux
# - the GN build doesn't have LIBCLANG_BUILD_STATIC
@@ -78,7 +78,12 @@
ldflags = [
"-Wl,-compatibility_version,1",
"-Wl,-current_version,$llvm_version",
+
+ # See llvm_setup_rpath() in CMake.
"-Wl,-install_name, at rpath/libclang.dylib",
+ "-Wl,-rpath, at loader_path/../lib",
]
}
+
+ # FIXME: Use libclang.exports
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56317.180257.patch
Type: text/x-patch
Size: 2252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190104/bea644c7/attachment.bin>
More information about the llvm-commits
mailing list