1.4K Star 7.3K Fork 7.6K

OpenHarmony/docs

 / 详情

3861编译失败,报错[OHOS ERROR] Fatal error: invalid -march= option: `rv32imac'

已完成
缺陷
创建于  
2021-04-08 11:15

该问题是怎么引起的?

按照指导书完成3861编译环境配置,执行编译命令失败
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Hi3861搭建环境.md

重现步骤

hb build

报错信息

OHOS ERROR] [3/293] gcc cross compiler obj/base/hiviewdfx/hievent_lite/frameworks/libhievent_lite.hiview_event.o
[OHOS ERROR] FAILED: obj/base/hiviewdfx/hievent_lite/frameworks/libhievent_lite.hiview_event.o
[OHOS ERROR] riscv32-unknown-elf-gcc -D_XOPEN_SOURCE=700 -DOHOS_DEBUG -D__LITEOS__ -D__LITEOS_M__ -I../../../base/hiviewdfx/hievent_lite/interfaces/native/innerkits -I../../../base/hiviewdfx/hiview_lite -I../../../foundation/distributedschedule/samgr_lite/interfaces/kits/samgr -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/system/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/config -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/config/nv -I../../../utils/native/lite/include -I../../../kernel/liteos_m/kal/cmsis -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/base/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/arch/risc-v/rv32im -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libm/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libsec/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/net/wpa_supplicant-2.7/src/common -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/plat/riscv -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/kernel/extended/runstop -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/posix/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/linux/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/third_party/lwip_sack/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/arch/generic -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/musl/arch/riscv32 -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/hw/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/nuttx/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libsec/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/config -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/user -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/plat -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/targets/hi3861v100/extend/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/arch -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/components/lib/libc/bionic/libm -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/shell/include -I../../../device/hisilicon/hispark_pegasus/sdk_liteos/platform/os/Huawei_LiteOS/net/telnet/include -Wall -Os -mabi=ilp32 -falign-functions=2 -msave-restore -fno-optimize-strlen -freorder-blocks-algorithm=simple -fno-schedule-insns -fno-inline-small-functions -fno-inline-functions-called-once -mtune=size -mno-small-data-limit=0 -fno-aggressive-loop-optimizations -std=c99 -Wpointer-arith -Wstrict-prototypes -ffunction-sections -fdata-sections -fno-exceptions -fno-short-enums -Wextra -Wundef -U PRODUCT_CFG_BUILD_TIME -DLOS_COMPILE_LDM -DPRODUCT_USR_SOFT_VER_STR=None -DCYGPKG_POSIX_SIGNALS -D__ECOS__ -D__RTOS_ -DPRODUCT_CFG_HAVE_FEATURE_SYS_ERR_INFO -D__LITEOS__ -DLIB_CONFIGURABLE -DLOSCFG_SHELL -DLOSCFG_CACHE_STATICS -DCUSTOM_AT_COMMAND -DLOS_COMPILE_LDM -DLOS_CONFIG_IPERF3 -DCMSIS_OS_VER=2 -DSECUREC_ENABLE_SCANF_FILE=0 -DCONFIG_AT_COMMAND -DPRODUCT_CFG_CHIP_VER_STR=Hi3861V100 -DCHIP_VER_Hi3861 -DPRODUCT_CFG_SOFT_VER_STR=Hi3861 -DHI_BOARD_ASIC -DHI_ON_FLASH -DLITEOS_WIFI_IOT_VERSION -march=rv32imac -nostdlib -fno-common -fno-builtin -fno-strict-aliasing -Wall -fsigned-char -fstack-protector-all -std=c99 -c ../../../base/hiviewdfx/hievent_lite/frameworks/hiview_event.c -o obj/base/hiviewdfx/hievent_lite/frameworks/libhievent_lite.hiview_event.o
[OHOS ERROR] Assembler messages:
[OHOS ERROR] Fatal error: invalid -march= option: `rv32imac'

评论 (4)

白国栋 创建了缺陷 4年前
白国栋 关联仓库设置为OpenHarmony/docs 4年前
白国栋 负责人设置为NEEN 4年前
NEEN 添加协作者NEEN 4年前
NEEN 负责人NEEN 修改为peitaiyi 4年前
NEEN 取消协作者NEEN 4年前
NEEN 添加协作者仟辰 4年前
展开全部操作日志

请在编译终端输入:riscv32-unknown-elf-gcc -v, 检查riscv32 gcc安装是否正常,正常的的如下:Configured with: ../riscv-gcc/configure --prefix=/data/d00434757/tools/riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' CXXFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' LDFLAGS=-Wl,-z,relro,-z,now,-z,noexecstack 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' --with-headers=/data/xxx/tools/riscv32/riscv32-unknown-elf/include --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2
Thread model: single
gcc version 7.3.0 (GCC)

确认已包含“--with-arch=rv32imc”

查询结果:
DESKTOP-ULE9GNV:~/OpenHarmony$ riscv32-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv32-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/opt/gcc_riscv32/libexec/gcc/riscv32-unknown-elf/7.3.0/lto-wrapper
Target: riscv32-unknown-elf
Configured with: ../riscv-gcc/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' CXXFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' LDFLAGS=-Wl,-z,relro,-z,now,-z,noexecstack 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' --with-headers=/opt/gcc-riscv32/riscv32-unknown-elf/include --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2 : (reconfigured) ../riscv-gcc/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' CXXFLAGS='-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE' LDFLAGS=-Wl,-z,relro,-z,now,-z,noexecstack 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar' --with-headers=/opt/gcc-riscv32/riscv32-unknown-elf/include --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2
Thread model: single
gcc version 7.3.0 (GCC)

报错是rv32imac,不是rv32imc,不一样

从华为云镜像重新下载安装编译器后,问题解决了
编译器下载地址:
https://mirrors.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/

aiyongfu 任务状态待办的 修改为已完成 4年前
aiyongfu 负责人peitaiyi 修改为白国栋 4年前
aiyongfu 添加协作者peitaiyi 4年前
aiyongfu 添加了
 
Integration_Test
标签
4年前
aiyongfu 负责人白国栋 修改为聂欣 4年前
aiyongfu 添加协作者白国栋 4年前

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(4)
peitaiyi-taiyipei 白国栋-bai-guodong aiyongfu-aiyongfu 7744398 qianchenya 1657193371
其他
1
https://gitee.com/openharmony/docs.git
git@gitee.com:openharmony/docs.git
openharmony
docs
docs

搜索帮助