1#Copyright (c) 2020-2021 Huawei Device Co., Ltd. 2#Licensed under the Apache License, Version 2.0 (the "License"); 3#you may not use this file except in compliance with the License. 4#You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8#Unless required by applicable law or agreed to in writing, software 9#distributed under the License is distributed on an "AS IS" BASIS, 10#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11#See the License for the specific language governing permissions and 12#limitations under the License. 13 14# Kernel type, e.g. "linux", "liteos_a", "liteos_m". 15kernel_type = "liteos_m" 16 17# Kernel version. 18kernel_version = "3.0.0" 19 20# Board CPU type, for example: "cortex-a7", "riscv32". 21board_cpu = "" 22 23# Board arch, for example: "armv7-a", "rv32imc". 24board_arch = "rv32imac" 25 26# Toolchain used for system compiling. 27# For example: gcc-arm-none-eabi, arm-linux-ohoseabi-gcc, ohos-clang, riscv32-unknown-elf. 28# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toolchain. 29board_toolchain = "riscv32-unknown-elf" 30 31#board_toolchain = "riscv-none-embed" 32 33# The path which toolchain installed, it's not mandatory if toolchain path has been added to your ~/.bashrc. 34board_toolchain_path = "" 35 36# Compiler prefix. 37board_toolchain_prefix = "riscv32-unknown-elf-" 38 39#board_toolchain_prefix = "riscv-none-embed-" 40 41# Compiler type, "gcc" or "clang". 42board_toolchain_type = "gcc" 43 44# config.json parse 45if (product_path != "") { 46 product_conf = read_file("${product_path}/config.json", "json") 47 force_link_libs = product_conf.force_link_libs 48} 49 50#Debug compiler optimization level options 51board_opt_flags = [] 52 53# Board related common compile flags. 54board_cflags = [ 55 "-mabi=ilp32", 56 "-falign-functions=2", 57 "-msave-restore", 58 "-fno-optimize-strlen", 59 "-freorder-blocks-algorithm=simple", 60 "-fno-schedule-insns", 61 "-fno-inline-small-functions", 62 "-fno-inline-functions-called-once", 63 "-mtune=size", 64 "-mno-small-data-limit=0", 65 "-fno-aggressive-loop-optimizations", 66 "-Wpointer-arith", 67 "-ffunction-sections", 68 "-fdata-sections", 69 "-fno-short-enums", 70 "-fno-builtin", 71 "-O2", 72 "-static", 73 "-fno-common", 74 "-fno-stack-protector", 75 "-fno-omit-frame-pointer", 76 "-Wno-format-truncation", 77 "-D__RISC_V__", 78 "-D__LITEOS_M__", 79 "-DLWIP_SUPPORT_CUSTOM_PBUF=1", 80 "-D_BSD_SOURCE", 81 "-Wformat=0", 82 "-DLOSCFG_BASE_CORE_HILOG", 83] 84 85board_cflags += board_opt_flags 86 87board_asmflags = [ 88 "-march=rv32imac", 89 "-mabi=ilp32", 90 "-static", 91 "-O2", 92] 93board_asmflags += board_opt_flags 94board_cxx_flags = board_cflags 95board_ld_flags = [] 96board_ld_flags += [ 97 "-Wl,--wrap=_free_r", 98 "-Wl,--wrap,_malloc_usable_size_r", 99 "-Wl,--wrap,_malloc_r", 100 "-Wl,--wrap,_memalign_r", 101 "-Wl,--wrap,_realloc_r", 102 "-Wl,--wrap,_calloc_r", 103 "-Wl,--wrap=printf", 104] 105 106# Board related headfiles search path. 107board_include_dirs = [ "//commonlibrary/utils_lite/include" ] 108 109# Board adapter dir for OHOS components. 110board_adapter_dir = "//device/qemu/riscv32_virt/driver" 111 112# Sysroot path. 113board_configed_sysroot = "" 114 115# Board storage type, it used for file system generation. 116storage_type = "" 117