Skip to content
Snippets Groups Projects
Commit 11313c8d authored by Roland McGrath's avatar Roland McGrath Committed by CQ bot account: commit-bot@chromium.org
Browse files

[zircon][gn] Fix $zx/system/ulib/zircon deps from fuzzer environment

The libc++ support changes refactored the GN magic around the vDSO
($zx/system/ulib/zircon) target and broke the semantics for derived
environments of the user environment, i.e. user.fuzzer.  Fix that.

Bug: BLD-430 #comment Fix GN build regression introduced by libc++ support.
Bug: ZX-1751 #comment Fix GN build regression introduced by libc++ support.
Change-Id: I47bd7683e97aedb7b2ab7c8ab05a136cd936ff26
parent 25dde6d4
No related branches found
No related tags found
No related merge requests found
......@@ -8,13 +8,10 @@ import("$zx/public/gn/toolchain/environment_redirect.gni")
# The vDSO can't be built with instrumentation.
exclude_tags = [ "instrumented" ]
if (toolchain.environment != "user") {
# References from other environments only get the headers.
group("zircon") {
public_deps = [
":headers",
]
}
# References from instrumented variants just redirect. This prevents extra
# abigen runs in other toolchains just to get identical generated headers.
if (toolchain.tags + exclude_tags - exclude_tags != toolchain.tags ||
toolchain.environment != "user") {
environment_redirect("headers") {
environment_label = "$zx/public/gn/toolchain:user"
direct = true
......@@ -24,21 +21,26 @@ if (toolchain.environment != "user") {
":headers",
]
}
} else if (toolchain.tags + exclude_tags - exclude_tags != toolchain.tags) {
# References from instrumented variants just redirect. This prevents
# extra abigen runs in other toolchains just to get identical generated
# headers.
foreach(target,
[
"zircon",
"headers",
]) {
environment_redirect(target) {
if (toolchain.base_environment == "user") {
# Instrumented variants, and all variants of derived environments,
# link against the uninstrumented library.
environment_redirect("zircon") {
environment_label = "$zx/public/gn/toolchain:user"
direct = true
shlib = true
exclude_variant_tags = exclude_tags
deps = [
":$target",
":zircon",
]
}
} else {
# References from other environments only get the headers. This
# makes it easy to have "$zx/system/ulib/zircon" deps in common
# libraries that need to link against it in userland but that in
# other contexts like kernel or userboot are just using the headers.
group("zircon") {
public_deps = [
":headers",
]
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment