1#Copyright (c) 2022 HPMicro. 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#board_toolchain = "riscv-nuclei-elf" 31 32# The path which toolchain installed, it's not mandatory if toolchain path has been added to your ~/.bashrc. 33board_toolchain_path = "" 34 35# Compiler prefix. 36board_toolchain_prefix = "riscv32-unknown-elf-" 37#board_toolchain_prefix = "riscv-nuclei-elf-" 38 39# Compiler type, "gcc" or "clang". 40board_toolchain_type = "gcc" 41 42# config.json parse 43if (product_path != "") { 44 product_conf = read_file("${product_path}/config.json", "json") 45 force_link_libs = product_conf.force_link_libs 46} 47 48#Debug compiler optimization level options 49board_opt_flags = [] 50 51# Board related common compile flags. 52board_cflags = [ 53 "-mabi=ilp32", 54 "-falign-functions=2", 55 "-msave-restore", 56 "-fno-optimize-strlen", 57 "-freorder-blocks-algorithm=simple", 58 "-fno-schedule-insns", 59 "-fno-inline-small-functions", 60 "-fno-inline-functions-called-once", 61 "-mtune=size", 62 "-mno-small-data-limit=0", 63 "-fno-aggressive-loop-optimizations", 64 "-Wpointer-arith", 65 "-ffunction-sections", 66 "-fdata-sections", 67 "-fno-short-enums", 68 "-fno-builtin", 69 "-O2", 70 "-static", 71 "-fno-common", 72 "-fno-stack-protector", 73 "-fno-omit-frame-pointer", 74 "-Wno-format-truncation", 75 "-D__RISC_V__", 76 "-D__LITEOS_M__", 77 "-DLWIP_SUPPORT_CUSTOM_PBUF=1", 78 "-D_BSD_SOURCE", 79 "-Wformat=0", 80 "-DLOSCFG_BASE_CORE_HILOG", 81 "-U_FORTIFY_SOURCE" 82] 83 84board_cflags += board_opt_flags 85 86board_asmflags = [ 87 "-march=rv32imac", 88 "-mabi=ilp32", 89 "-static", 90 "-O2", 91] 92board_asmflags += board_opt_flags 93board_cxx_flags = board_cflags 94board_ld_flags = [ "" ] 95board_ld_flags += [ 96 "-Wl,--wrap=_free_r", 97 "-Wl,--wrap,_malloc_usable_size_r", 98 "-Wl,--wrap,_malloc_r", 99 "-Wl,--wrap,_memalign_r", 100 "-Wl,--wrap,_realloc_r", 101 "-Wl,--wrap,_calloc_r", 102 "-Wl,--wrap=printf", 103 "-Wl,--whole-archive", 104] 105 106# Board related headfiles search path. 107board_include_dirs = [ 108 "//utils/native/lite/include", 109 "//commonlibrary/utils_lite/include", 110 "//third_party/mbedtls/include", 111 "//third_party/bounds_checking_function/include", ] 112 113# Board adapter dir for OHOS components. 114board_adapter_dir = "" 115 116# Sysroot path. 117board_configed_sysroot = "" 118 119# Board storage type, it used for file system generation. 120storage_type = "" 121