blob: a81d014f95575a093a8cfc32efcd5665077dbc2e [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("//build/cpp/library_headers.gni")
source_set("code-patching") {
public_deps = [ ":headers" ]
}
library_headers("headers") {
headers = [
"lib/code-patching/asm.h",
"lib/code-patching/code-patching.h",
]
public_deps = [
"//zircon/kernel/lib/ktl:headers",
# code-patching.h includes <lib/arch/nop.h>.
"//zircon/kernel/lib/arch:headers",
# code-patching.h includes <lib/fbl/span.h>.
"//zircon/system/ulib/fbl:headers",
]
}
config("hermetic-leaf.config") {
inputs = [ "hermetic-leaf.ld" ]
# Use a custom linker script rather than the default PIE layout.
ldflags = [ "-Wl,-T," + rebase_path(inputs[0], root_build_dir) ]
# lld defaults to PIE, while the GNU linkers do not.
if (!is_gcc) {
ldflags += [ "-Wl,--no-pie" ]
}
ldflags += [
# Don't add any additional sections or dependencies.
"-nostdlib",
"-Wl,--build-id=none",
"-Wl,--no-dynamic-linker",
]
}