# 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("//build/config/clang/clang.gni") import("//build/config/fuchsia/generate_runner_scripts.gni") import("//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 # https://fuchsia.googlesource.com/zircon/+/master/system/private/zircon/stack.h#9), # 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 = [ "//build/fuchsia/", "//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 && test_host_cpu == "arm64") { data += [ "//third_party/qemu-${host_os}-${test_host_cpu}/", "//third_party/edk2/", ] } } # 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" ] }