diff --git a/utils/gn/build/symbol_exports.gni b/utils/gn/build/symbol_exports.gni index ed0e7df560e..d81d9ea22cc 100644 --- a/utils/gn/build/symbol_exports.gni +++ b/utils/gn/build/symbol_exports.gni @@ -44,6 +44,7 @@ template("symbol_exports") { } action(target_name) { + forward_variables_from(invoker, [ "deps" ]) script = "//llvm/utils/gn/build/symbol_exports.py" inputs = [ invoker.exports_file ] outputs = [ linker_file ] diff --git a/utils/gn/secondary/clang/test/BUILD.gn b/utils/gn/secondary/clang/test/BUILD.gn index 85ba3cc7679..f819b9552db 100644 --- a/utils/gn/secondary/clang/test/BUILD.gn +++ b/utils/gn/secondary/clang/test/BUILD.gn @@ -105,12 +105,15 @@ write_lit_config("lit_site_cfg") { if (host_os == "win") { extra_values += [ + # See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn + "CMAKE_LIBRARY_OUTPUT_DIRECTORY=" + rebase_path("$root_out_dir/bin", dir), "LLVM_ENABLE_PLUGINS=0", "LLVM_LIT_ERRC_MESSAGES=no such file or directory;is a directory;" + "invalid argument;permission denied", ] } else { extra_values += [ + "CMAKE_LIBRARY_OUTPUT_DIRECTORY=" + rebase_path("$root_out_dir/lib", dir), "LLVM_ENABLE_PLUGINS=0", # FIXME: Analysis/plugins need global -fPIC "LLVM_LIT_ERRC_MESSAGES=", ] diff --git a/utils/gn/secondary/clang/tools/libclang/BUILD.gn b/utils/gn/secondary/clang/tools/libclang/BUILD.gn index e72af8fbc7a..556c8783ba3 100644 --- a/utils/gn/secondary/clang/tools/libclang/BUILD.gn +++ b/utils/gn/secondary/clang/tools/libclang/BUILD.gn @@ -14,10 +14,21 @@ if (host_os != "win" && host_os != "mac") { # ELF targets need -fPIC to build shared libs but they aren't on by default. # For now, make libclang a static lib there. libclang_target_type = "static_library" -} +} else { + 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" + symbol_exports("exports") { + deps = [ ":linker_script_to_exports" ] + exports_file = "$target_gen_dir/libclang.exports" + } } target(libclang_target_type, "libclang") {