blob: fbc3185c17512dfd0c9005d62ad650d565f6fa93 [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/fuchsia/config.gni")
import("//build/config/sysroot.gni")
assert(is_fuchsia)
assert(is_posix)
config("compiler") {
sdk_version_file = rebase_path("$fuchsia_sdk/.hash")
sdk_version = read_file(sdk_version_file, "trim string")
defines = [
# To force full builds after SDK updates in case of ABI changes.
"FUCHSIA_SDK_VERSION=$sdk_version",
]
cflags = []
ldflags = []
if (current_cpu == "arm64") {
cflags += [ "--target=aarch64-fuchsia" ]
ldflags += [ "--target=aarch64-fuchsia" ]
} else if (current_cpu == "x64") {
cflags += [ "--target=x86_64-fuchsia" ]
ldflags += [ "--target=x86_64-fuchsia" ]
} else {
assert(false, "Unsupported architecture")
}
asmflags = cflags
ldflags += [
# The stack defaults to 256k on Fuchsia (see
# https://fuchsia.googlesource.com/magenta/+/master/system/private/magenta/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.
"-Wl,-z,stack-size=0x800000",
]
libs = [
"mxio",
"magenta",
]
}