1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[gn build] Kind of port c7b3a91017d2 (libclang version script)

libclang is only built as static library in the GN build at the
moment, which means we now generate a .exports file form a version
script and then link.exe and ld64 inputs from the .exports file
but don't use the version script, but hey.
This commit is contained in:
Nico Weber 2021-07-26 22:10:46 -04:00
parent 5997b61680
commit 8a88013900
3 changed files with 18 additions and 3 deletions

View File

@ -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 ]

View File

@ -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=",
]

View File

@ -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"
deps = [ ":linker_script_to_exports" ]
exports_file = "$target_gen_dir/libclang.exports"
}
}
target(libclang_target_type, "libclang") {