summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-01-04 17:12:25 +0000
committerNico Weber <nicolasweber@gmx.de>2019-01-04 17:12:25 +0000
commitc01e15ed98a2ab887e47aafc751dcc5bc4924658 (patch)
tree9788c8409dfd786725a9d5cb54d57d8813902d57
parent39ac159c24b5c0ae37506d1588321bebf429c973 (diff)
downloadbcm5719-llvm-c01e15ed98a2ab887e47aafc751dcc5bc4924658.tar.gz
bcm5719-llvm-c01e15ed98a2ab887e47aafc751dcc5bc4924658.zip
[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
-rw-r--r--llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn7
-rw-r--r--llvm/utils/gn/secondary/llvm/tools/lto/BUILD.gn39
2 files changed, 45 insertions, 1 deletions
diff --git a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
index 78bbb5398c9..c2fad99acf5 100644
--- a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
@@ -6,7 +6,7 @@ import("//llvm/version.gni")
# - 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 @@ target(libclang_target_type, "libclang") {
ldflags = [
"-Wl,-compatibility_version,1",
"-Wl,-current_version,$llvm_version",
+
+ # See llvm_setup_rpath() in CMake.
"-Wl,-install_name,@rpath/libclang.dylib",
+ "-Wl,-rpath,@loader_path/../lib",
]
}
+
+ # FIXME: Use libclang.exports
}
diff --git a/llvm/utils/gn/secondary/llvm/tools/lto/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/lto/BUILD.gn
new file mode 100644
index 00000000000..dfd33292b71
--- /dev/null
+++ b/llvm/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,@rpath/libLTO.dylib",
+ "-Wl,-rpath,@loader_path/../lib",
+ ]
+ }
+
+ # FIXME: Use lto.exports
+}
OpenPOWER on IntegriCloud