| # Copyright 2023 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. |
| |
| import("riscv64.gni") |
| |
| # Platform baseline. |
| # This tracks the minimum hardware requirements for Fuchsia on RISC-V. |
| riscv64_abi_config("abi") { |
| } |
| |
| config("riscv64") { |
| # TODO(https://fxbug.dev/42076645): Clang should do this everywhere for Fuchsia |
| # targets. When it does, put this under `if (is_gcc)`. |
| # |
| # Don't use .sdata/.sbss sections. Even though linker gp relaxation is |
| # separately disabled (gp is reserved for the shadow-call-stack in the |
| # Fuchsia Compiler ABI), we still don't want to use these sections |
| # because the compiler will place read-only (or RELRO) data in .sdata, |
| # which is suboptimal for security and sharing as well as creating |
| # problems for pure code. |
| # |
| # This is the default for -fPIC and Clang warns about specifying it. |
| if (!toolchain_variant.is_pic_default) { |
| cflags = [ "-msmall-data-limit=0" ] |
| } |
| configs = [ ":abi" ] |
| } |
| |
| riscv64_abi_config("no-vector") { |
| exclude_letters = [ "v" ] |
| } |