# Copyright 2014 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. config("compiler_defaults") { if (board_toolchain == "gcc") { cflags = [ "-fPIC", "-pthread", ] } else if (board_toolchain == "riscv-gcc"){ cflags = [ "-mabi=ilp32f", "-march=rv32imafc", "-falign-functions=2", "-fno-optimize-strlen", "-freorder-blocks-algorithm=simple", "-fno-schedule-insns", "-fno-inline-small-functions", "-mtune=size", "-mno-small-data-limit=0", "-fno-aggressive-loop-optimizations", "-Wpointer-arith", "-ffunction-sections", "-fdata-sections", "-fno-exceptions", "-fno-short-enums", "-nostartfiles", "-mstrict-align", "-Wno-error=unused-function", "-Wno-error=unused-but-set-variable", "-ffast-math", "-ffunction-sections", "-fdata-sections", "-fno-common", "-fno-builtin-printf", "-Os", "-msave-restore", ] cflags_cc = cflags ldflags = cflags asmflags = cflags } } config("executable_ldconfig") { if (!is_mac) { ldflags = [ "-Wl,-rpath=\$ORIGIN/", "-Wl,-rpath-link=", ] } }