blob: d4562dc345c21f8b6931627431ead531939f0a35 [file] [edit]
# Copyright 2024 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/components.gni")
import("//build/dist/component_manifest_resources.gni")
import("//build/toolchain/ifs_shared_library.gni")
import("//build/toolchain/zircon/user_basic_redirect.gni")
user_basic_redirect("modules.basic") {
testonly = true
public_deps = [ ":modules" ]
}
group("modules") {
visibility = [ ":*" ]
testonly = true
deps = [
":fake_compat_driver",
":fake_driver",
":fake_driver_host",
":fake_driver_host_with_bootstrap",
":fake_root_driver",
":fake_v1_driver",
]
}
static_library("entry_point") {
visibility = [ ":*" ]
testonly = true
public = [ "entry_point.h" ]
sources = [ "entry_point.cc" ]
public_deps = [
"//src/zircon/lib/zircon",
"//zircon/system/public",
]
}
executable("fake_driver_host") {
visibility = [ ":*" ]
testonly = true
output_name = "fake_driver_host"
sources = [ "fake_driver_host.cc" ]
deps = [
":dh-deps-a",
":entry_point",
]
# The user.basic environment doesn't use toolchain-provided instrumentation
# runtimes that wouldn't be compatible. But it supports variants like ubsan
# that require plumbing a custom runtime, which isn't handled for this
# experimental test stub binary.
exclude_toolchain_tags = [ "custom-runtime" ]
}
shared_library("dh-deps-a") {
visibility = [ ":*" ]
testonly = true
sources = [ "dh-deps-a.cc" ]
deps = [
":dh-deps-b",
":dh-deps-c",
"//zircon/system/public",
]
}
shared_library("dh-deps-b") {
visibility = [ ":*" ]
testonly = true
sources = [ "dh-deps-b.cc" ]
deps = [ "//zircon/system/public" ]
}
shared_library("dh-deps-c") {
visibility = [ ":*" ]
testonly = true
sources = [ "dh-deps-c.cc" ]
deps = [ "//zircon/system/public" ]
}
loadable_module("fake_root_driver") {
visibility = [ ":*" ]
testonly = true
sources = [ "fake_root_driver.cc" ]
public = [ "driver_entry_point.h" ]
deps = [
":fake_root_driver_deps",
":fake_runtime.lib",
]
}
loadable_module("fake_compat_driver") {
visibility = [ ":*" ]
testonly = true
sources = [ "fake_compat_driver.cc" ]
public = [
"driver_entry_point.h",
"v1_driver_entry_point.h",
]
}
loadable_module("fake_v1_driver") {
visibility = [ ":*" ]
testonly = true
sources = [ "fake_v1_driver.cc" ]
public = [ "v1_driver_entry_point.h" ]
}
shared_library("fake_root_driver_deps") {
visibility = [ ":*" ]
testonly = true
sources = [ "fake_root_driver_deps.cc" ]
deps = [ "//zircon/system/public" ]
}
loadable_module("fake_driver") {
visibility = [ ":*" ]
testonly = true
sources = [ "fake_driver.cc" ]
public = [ "driver_entry_point.h" ]
}
ifs_shared_library("fake_runtime.lib") {
visibility = [ ":*" ]
testonly = true
public = [ "fake_runtime.h" ]
abi = "fake_runtime.ifs"
}
executable("fake_driver_host_with_bootstrap") {
visibility = [ ":*" ]
testonly = true
output_name = "fake_driver_host_with_bootstrap"
sources = [ "fake_driver_host_with_bootstrap.cc" ]
# Though this is an executable, it has a DT_SONAME and the linker is told to
# export all its STV_DEFAULT symbols as a shared_library() would by default.
ldflags = [
"-Wl,-soname,libruntime_test.so.1",
"-rdynamic",
]
deps = [
":dh-deps-a",
":entry_point",
"//sdk/lib/ld",
"//sdk/lib/ld:standalone",
"//src/zircon/lib/zircon",
"//zircon/system/public",
"//zircon/system/ulib/zx",
]
# The user.basic environment doesn't use toolchain-provided instrumentation
# runtimes that wouldn't be compatible. But it supports variants like ubsan
# that require plumbing a custom runtime, which isn't handled for this
# experimental test stub binary.
exclude_toolchain_tags = [ "custom-runtime" ]
}