blob: 61a223e5816f1145c8b6726a214ebeb2ea8e5d69 [file] [log] [blame]
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/profile/config.gni")
import("//build/toolchain/variant.gni")
variant("profile") {
common_flags = [
"-fprofile-instr-generate",
"-fcoverage-mapping",
]
if (profile_list != "") {
common_flags +=
[ "-fprofile-list=" + rebase_path(profile_list, "", root_build_dir) ]
}
is_kernel = toolchain_variant.tags + [ "kernel" ] - [ "kernel" ] !=
toolchain_variant.tags
if (!is_kernel && is_fuchsia) {
# The statically-linked profiling runtime depends on libzircon.
# TODO(fxbug.dev/61522): Ensure this works with shared_library() instances too!
deps = [ "//src/zircon/lib/zircon" ]
dynamic_linker_flags = "-dynamic-linker=profile/ld.so.1"
ldflags = [ "-Wl,$dynamic_linker_flags" ]
rustflags = [ "-Clink-arg=$dynamic_linker_flags" ]
}
}