选择得当本身芯片的arm编译工具链,因为我的是arm cortex-a9的芯片,以是我选择如下交叉工具链
Downloads | GNU-A Downloads – Arm DeveloperDownload the The GNU Toolchain for the Cortex-A Family are integrated and validated packages featuring the GCC compiler, libraries and other GNU tools necessary for software development on devices based on the Arm Cortex-A processors or the Arm A-profile architecture.
https://developer.arm.com/downloads/-/gnu-a
2、将工具链放入OpenHarmony目次
2.1、放入prebuilts目次下面
3、配置编译工具链
3.1、在device目次下配置编译工具链
device/board/exynos/fs4412/linux/config.gni
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "cortex-a9"
# Board arch, e.g. "armv7-a", "rv32imac".
board_arch = "armv7"
# Toolchain name used for system compiling.
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toolchain.
board_toolchain = "arm-none-linux-gnueabi-gcc"
# The toolchain path installed, it's not mandatory if you have added toolchain path to your ~/.bashrc.