blob: be115c9bc7032a6dad1ca787ddbdcb1b6039f7e0 [file] [log] [blame]
# Copyright 2020 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.
declare_args() {
# Directory where the GCC toolchain binaries ("gcc", "nm", etc.) are found.
# This directory is expected to contain `aarch64-elf-*` and `x86_64-elf-*`
# tools used to build for the Fuchsia targets. This directory will not be
# used for host tools. If this is "", then a standard prebuilt is used.
gcc_tool_dir = ""
}
# This is a string identifying the particular toolchain version in use. Its
# only purpose is to be unique enough that it changes when switching to a new
# toolchain, so that recompilations with the new compiler can be triggered.
gcc_version_string = gcc_tool_dir
# TODO(https://fxbug.dev/42068125): The `gcc` prebuilt is missing for mac-arm64.
# This is currently not a blocker as Infra does not build with `gcc` on Mac,
# but a developer might want to some day.
if (host_platform != "mac-arm64") {
_prebuilt_gcc_dir = "//prebuilt/third_party/gcc/$host_platform"
_prebuilt_cipd_version =
read_file("$_prebuilt_gcc_dir/.versions/gcc.cipd_version", "json")
if (gcc_tool_dir == "") {
gcc_tool_dir = "$_prebuilt_gcc_dir/bin"
gcc_version_string = _prebuilt_cipd_version.instance_id
}
}
ifs_extra_switches = []
# GNU linkers add these symbols which we want to exclude from abi tracking
# and shared object stub creation.
gnu_linker_synthetic_symbols = [
"__bss_start",
"_edata",
"_end",
]
if (is_gcc) {
foreach(symbol, gnu_linker_synthetic_symbols) {
ifs_extra_switches += [ "--exclude=$symbol" ]
}
}