blob: bc7d1b26ef4ea88dc6d65efc4829f0748dc336ce [file] [log] [blame]
# Copyright 2019 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/zircon/migrated_targets.gni")
source_set("ldso") {
deps = [
":dlstart",
"//zircon/system/ulib/ldmsg",
"//zircon/third_party/ulib/musl:musl_internal",
]
sources = [
"//zircon/third_party/ulib/musl/arch/${toolchain.cpu}/dl-entry.S",
"dynlink-sancov.S",
"dynlink.c",
]
# This is needed by dynlink-sancov.S and dynlink.c for "sancov-stubs.h".
include_dirs = [ "//zircon/system/ulib/c/sanitizers" ]
if (toolchain.libprefix != "") {
# The libprefix always ends with a / but that's not part of the
# "config" string in the loader-service protocol.
ldsvc_config = get_path_info("${toolchain.libprefix}libfoo.so", "dir")
assert(ldsvc_config != "" && ldsvc_config != ".")
defines = [ "DYNLINK_LDSVC_CONFIG=\"$ldsvc_config\"" ]
}
configs -= [ "//build/config/zircon:visibility_hidden" ]
# TODO(fxb/58161): delete the below and fix compiler warnings
configs += [ "//build/config/zircon:Wno-unused-function" ]
# TODO(41901): UBSan has found an instance of undefined behavior in this target.
# Disable UBSan for this target temporarily until it is migrated into CI/CQ.
configs += [ "//build/config/zircon:temporarily_disable_ubsan_do_not_use" ]
}
source_set("dlstart") {
visibility = [ ":*" ]
deps = [ "//zircon/third_party/ulib/musl:musl_internal" ]
sources = [ "dlstart.c" ]
configs += [ "//build/config/zircon:no_sanitizers" ]
}