blob: de0a6eb3cfb534b51c13333187f755c9651add99 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
import("$zx/kernel/lib/vdso/rodso.gni")
source_set("userboot") {
sources = [
"userboot.cpp",
]
include_dirs = [ target_gen_dir ]
deps = [
":gen-userboot-code-header",
":image",
"$zx/kernel/lib/console",
"$zx/kernel/lib/vdso",
]
}
# The userboot-code.h generated header file tells the userboot.cpp code
# where the segment boundaries and entry points are.
rodso_code_header("gen-userboot-code-header") {
visibility = [ ":*" ]
name = "USERBOOT"
outputs = [
"$target_gen_dir/userboot-code.h",
]
deps = [
# TODO(mcgrathr): mv //system/core/userboot ./user
"$zx/system/core/userboot",
]
}
# The generated header is also needed to tell .incbin how much of the
# image file to embed (see $zx/kernel/lib/vdso/include/lib/rodso-asm.h).
source_set("image") {
visibility = [ ":*" ]
sources = [
"userboot-image.S",
]
include_dirs = [ target_gen_dir ]
deps = [
":gen-userboot-code-header",
"$zx/kernel/lib/vdso",
]
# userboot-image.S includes the userboot contents and so must be
# reassembled when that changes. We can't express that in $inputs
# here because we don't know the exact name of the file since that
# depends on the toolchain selected. Fortunately, we already depend
# on the generated userboot-code.h header, which is always
# regenerated whenever the userboot binary itself changes. So this
# indirect dependency is sufficient.
}