Source code
Revision control
Copy as Markdown
Other Tools
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//chromium/build/config/clang/clang.gni")
import("//chromium/build/config/fuchsia/generate_runner_scripts.gni")
import("//chromium/build/config/fuchsia/gn_configs.gni")
assert(is_fuchsia)
assert(!is_posix, "Fuchsia is not POSIX.")
config("compiler") {
configs = [ "//third_party/fuchsia-gn-sdk/src/config:compiler" ]
# TODO(crbug.com/40513182): The stack defaults to 256k on Fuchsia (see
# but on other platforms it's much higher, so a variety of code assumes more
# will be available. Raise to 8M which matches e.g. macOS.
ldflags = [
"-Wl,-z,stack-size=0x800000",
"-fexperimental-relative-c++-abi-vtables",
]
cflags_cc = [ "-fexperimental-relative-c++-abi-vtables" ]
}
# Files required to run on Fuchsia on isolated swarming clients.
group("deployment_resources") {
data = [
"//chromium/build/fuchsia/",
"//chromium/build/util/lib/",
"//third_party/fuchsia-sdk/sdk/.build-id/",
"//third_party/fuchsia-sdk/sdk/meta/manifest.json",
"//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/",
]
if (fuchsia_additional_boot_images == []) {
data += [ "${boot_image_root}" ]
} else {
# We never need to use both qemu images and device images.
foreach(fuchsia_additional_boot_image, fuchsia_additional_boot_images) {
data += [ "${fuchsia_additional_boot_image}/" ]
}
}
if (test_isolate_uses_emulator) {
# This assumes we are testing on QEMU with (U)EFI emulation only
# if host_cpu == target_cpu, and also that these tests are executed
# on x64 and arm64 only.
if (test_host_cpu == "arm64") {
data += [
"//third_party/fuchsia-sdk/sdk/tools/qemu_uefi_internal/arm64",
"//third_party/fuchsia-sdk/sdk/tools/qemu_uefi_internal/arm64-meta.json",
"//third_party/qemu-${host_os}-${test_host_cpu}/",
]
} else {
data += [
"//third_party/fuchsia-sdk/sdk/tools/qemu_uefi_internal/x64",
"//third_party/fuchsia-sdk/sdk/tools/qemu_uefi_internal/x64-meta.json",
]
}
}
}
# Copy the loader to place it at the expected path in the final package.
copy("sysroot_asan_libs") {
sources = [ "${fuchsia_arch_root}/sysroot/dist/lib/asan/ld.so.1" ]
outputs = [ "${root_out_dir}/lib/asan/{{source_file_part}}" ]
}
# Copy the loader to place it at the expected path in the final package.
copy("sysroot_asan_runtime_libs") {
sources = [ "$clang_base_path/lib/clang/$clang_version/lib/x86_64-unknown-fuchsia/libclang_rt.asan.so" ]
outputs = [ "${root_out_dir}/lib/{{source_file_part}}" ]
}
# This adds the runtime deps for Fuchsia ASAN builds.
group("asan_runtime_library") {
data_deps = [
":sysroot_asan_libs",
":sysroot_asan_runtime_libs",
]
}
# rustc gives the linker (clang++) "-pie" directives. clang++ complains on
# Fuchsia that these don't make any sense. On Fuchsia alone, for Rust-linked
# targets only, disable these warnings.
config("rustc_no_pie_warning") {
ldflags = [ "-Wno-unused-command-line-argument" ]
}