[llvm] 58d630f - Revert "[gn build] port bc39d7bdd497 (libclang.map -> libclang.exports)"
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 25 04:10:51 PDT 2022
Author: Nico Weber
Date: 2022-08-25T07:08:44-04:00
New Revision: 58d630fbfab11a2847bd2970bcff897d860d36eb
URL: https://github.com/llvm/llvm-project/commit/58d630fbfab11a2847bd2970bcff897d860d36eb
DIFF: https://github.com/llvm/llvm-project/commit/58d630fbfab11a2847bd2970bcff897d860d36eb.diff
LOG: Revert "[gn build] port bc39d7bdd497 (libclang.map -> libclang.exports)"
This reverts commit 94c00c10e837aded6a6b15fe84c12f1ced4d856d.
bc39d7bdd497 was reverted in 0f28d4856630.
Added:
Modified:
llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
index 41e98ec368485..6f2c19c613a36 100644
--- a/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
@@ -7,14 +7,24 @@ import("//llvm/version.gni")
# - a build target copying the Python bindings
# - the GN build doesn't have LIBCLANG_BUILD_STATIC
+action("linker_script_to_exports") {
+ script = "linker-script-to-export-list.py"
+ inputs = [ "libclang.map" ]
+ outputs = [ "$target_gen_dir/libclang.exports" ]
+ args = [
+ rebase_path(inputs[0], root_build_dir),
+ rebase_path(outputs[0], root_build_dir),
+ ]
+}
+
symbol_exports("exports") {
- exports_file = "libclang.exports"
+ deps = [ ":linker_script_to_exports" ]
+ exports_file = "$target_gen_dir/libclang.exports"
}
shared_library("libclang") {
configs += [ "//llvm/utils/gn/build:clang_code" ]
deps = [
- ":exports",
"//clang/include/clang/Config",
"//clang/lib/AST",
"//clang/lib/Basic",
@@ -29,6 +39,13 @@ shared_library("libclang") {
"//llvm/lib/Support",
"//llvm/lib/Target:TargetsToBuild",
]
+ if (current_os == "win" || current_os == "mac") {
+ deps += [ ":exports" ]
+ } else {
+ inputs = [ "libclang.map" ]
+ ldflags =
+ [ "-Wl,--version-script," + rebase_path(inputs[0], root_build_dir) ]
+ }
if (clang_enable_arcmt) {
deps += [ "//clang/lib/ARCMigrate" ]
}
More information about the llvm-commits
mailing list