| # 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", |
| "$zx/system/ulib/ldmsg", |
| "$zx/third_party/ulib/musl:musl_internal", |
| ] |
| sources = [ |
| "$zx/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 = [ "$zx/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 -= [ "$zx_build_config:visibility_hidden" ] |
| |
| # TODO(fxb/58161): delete the below and fix compiler warnings |
| configs += [ "$zx_build_config: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 += [ "$zx_build_config:temporarily_disable_ubsan_do_not_use" ] |
| } |
| |
| source_set("dlstart") { |
| visibility = [ ":*" ] |
| deps = [ "$zx/third_party/ulib/musl:musl_internal" ] |
| sources = [ "dlstart.c" ] |
| configs += [ "$zx_build_config:no_sanitizers" ] |
| } |