14 Star 121 Fork 119

OpenHarmony / device_qemu

 / 详情

编译过程中出现compiler type not set!

Done
Bug
Opened this issue  
2021-10-17 22:25

[OHOS INFO] [2991/3447] LLVM LINK test/unittest/kernel/bin/liteos_a_net_resolv_unittest.bin
[OHOS INFO] [2992/3447] LLVM LINK test/unittest/kernel/bin/liteos_a_posix_mem_unittest.bin
[OHOS INFO] [2993/3447] LLVM LINK test/unittest/kernel/bin/liteos_a_posix_mem_unittest_door.bin
[OHOS INFO] [2994/3447] LLVM LINK test/unittest/kernel/bin/liteos_a_net_socket_unittest.bin
[OHOS INFO] [2995/3447] LLVM LINK test/unittest/kernel/bin/liteos_a_net_socket_unittest_door.bin
[OHOS ERROR] [2990/3447] ACTION //kernel/liteos_a:make(//build/lite/toolchain:linux_x86_64_ohos_clang)
[OHOS ERROR] FAILED: obj/kernel/liteos_a/make_build_ext_components.txt
[OHOS ERROR] /usr/bin/python3 ../../../build/lite/build_ext_components.py --path=../../../kernel/liteos_a --command=./build.sh\ "arm_virt"\ "clang"\ "//out/arm_virt/qemu_small_system_demo"\ "debug"\ "false"\ "qemu"\ "/home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo"\ "/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out"\ "OpenHarmony\ 2.3\ beta"\ "/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/sysroot"\ "-mfloat-abi=softfp\ -mfpu=neon-vfpv4\ -mcpu=cortex-a7"\ "/home/wxer/kernel_proj/openharmony/device/qemu/arm_virt/liteos_a"\ "ccache\ /home/wxer/kernel_proj/openharmony/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-"\ "/home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo/kernel_configs/debug.config" --target_dir=/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/build.log --out_dir=/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/error.log
[OHOS ERROR] sh param: arm_virt clang //out/arm_virt/qemu_small_system_demo debug false qemu /home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out OpenHarmony 2.3 beta /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/sysroot -mfloat-abi=softfp -mfpu=neon-vfpv4 -mcpu=cortex-a7 /home/wxer/kernel_proj/openharmony/device/qemu/arm_virt/liteos_a ccache /home/wxer/kernel_proj/openharmony/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm- /home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo/kernel_configs/debug.config
[OHOS ERROR] compiler type not set!
[OHOS ERROR] compiler type not set!
[OHOS ERROR] warning: DRIVERS_HDF_SENSOR_MAGNETIC_LSM303 (defined at ../../drivers/adapter/khdf/liteos/model/sensor/Kconfig:102) has leading or trailing whitespace in its prompt
[OHOS ERROR] warning: DRIVERS_HDF_SENSOR_MAGNETIC_LSM303 (defined at ../../drivers/adapter/khdf/liteos/model/sensor/Kconfig:102) has leading or trailing whitespace in its prompt
[OHOS ERROR] sysroot: /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/sysroot
[OHOS ERROR] make[1]: 进入目录“/home/wxer/kernel_proj/openharmony/kernel/liteos_a/arch/arm/arm”
[OHOS ERROR] make[1]: 进入目录“/home/wxer/kernel_proj/openharmony/kernel/liteos_a/apps”
[OHOS ERROR] make[2]: 进入目录“/home/wxer/kernel_proj/openharmony/kernel/liteos_a/apps/shell”
[OHOS ERROR] CC obj/kernel/liteos_a/arch/arm/arm/src/arm_generic_timer.o
[OHOS ERROR] CC obj/kernel/liteos_a/arch/arm/arm/src/los_arch_mmu.o
[OHOS ERROR] CC obj/kernel/liteos_a/arch/arm/arm/src/los_asid.o
[OHOS ERROR] CC obj/kernel/liteos_a/arch/arm/arm/src/los_exc.o
...

Comments (19)

w512 created缺陷
w512 set related repository to OpenHarmony/device_qemu
Expand operation logs

看一下/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/error.log中是什么错误?你的源码是2.3?怎样获取的?

按这个命令下载的源码

repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'

/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/error.log中错误:
sh param: arm_virt clang //out/arm_virt/qemu_small_system_demo debug false qemu /home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out OpenHarmony 2.3 beta /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/sysroot -mfloat-abi=softfp -mfpu=neon-vfpv4 -mcpu=cortex-a7 /home/wxer/kernel_proj/openharmony/device/qemu/arm_virt/liteos_a ccache /home/wxer/llvm/llvm/bin/llvm- /home/wxer/kernel_proj/openharmony/vendor/ohemu/qemu_small_system_demo/kernel_configs/debug.config
compiler type not set!
compiler type not set!
。。。
。。。

AR lib/libsecurity.a
make[1]: 离开目录“/home/wxer/kernel_proj/openharmony/kernel/liteos_a/security”
ccache /home/wxer/llvm/llvm/bin/ld.lld -static --gc-sections -L/home/wxer/kernel_proj/openharmony/kernel/liteos_a/../../device/hisilicon/drivers/libs/ohos/llvm/hi3518ev300 -L/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out/lib -T/home/wxer/kernel_proj/openharmony/kernel/liteos_a/tools/build/liteos_llvm.ld -utask_shellcmd -uvm_shellcmd -ucpup_shellcmd -uhelp_shellcmd -ufree_shellcmd -usem_shellcmd -umutex_shellcmd -uqueue_shellcmd -usysteminfo_shellcmd -uswtmr_shellcmd -uhwi_shellcmd -ufindsym_shellcmd -uzbar_scan_shellcmd -udmesg_shellcmd -udate_shellcmd -ureadExcInfo_shellcmd -uwatch_shellcmd -udeadlock_shellcmd -ukill_shellcmd -upmm_shellcmd -upanic_reset_shellcmd -ushm_shellcmd -uarp_shellcmd -utelnet_shellcmd -uping_shellcmd -unetstat_shellcmd -uifconfig_shellcmd -ucd_shellcmd -uformat_shellcmd -upartition_shellcmd -uwriteproc_shellcmd -upartinfo_shellcmd -uumount_shellcmd -umount_shellcmd -uvirstatfs_shellcmd -ulsfd_shellcmd -usu_shellcmd -uchmod_shellcmd -uchown_shellcmd -uchgrp_shellcmd -uiperf_shellcmd -ulwip_dump_shellcmd -ureset_shellcmd -ustartap_shellcmd -uhiddrs_shellcmd -unand_bad_shellcmd -ui2c_read_shellcmd -ussp_read_shellcmd -uuart_config_shellcmd -uusb_debug_shellcmd -uOsPmInit -uramfs_fsmap -uromfs_fsmap -unfs_fsmap -ufat_fsmap -ujffs_fsmap -uprocfs_fsmap -ug_fsmap -uzpfs_fsmap -ui2c_init -ugpio_init -uregulator_init -uhispi_init -uhifmc100_init -uhisfc350_init -unand_hifmc100_init -uhifmc100_parallel_init -usd_mci_init -uhi_mci_init -upl011_init -uhinfc620_init -uhisnfc100_init -uregulator_machine_init -uhisimeidia_regulator_init -ucpufreq_init -uhisilicon_cpufreq_init -ucpufreq_machine_init -udevfreq_init -umedia_devfreq_init -udevfreq_machine_init -uhieth_machine_init -uhigmac_machine_init -umachine_init -uOsTraceInit -ulos_vfs_init -uProcFsInit -uOsDriverRandomInit -uHieventInit -uOsBsdInit -uShmInit -uOsDmesgInit -uOsLkLoggerInit -uOsCpupInit -uOsFutexInit -uOsSysWorkQueueInit -uOsSyscallHandleInit -upipe_init -uOomTaskInit -uOsCpupGuardCreator -uOsMpInit -uOsResourceFreeTaskCreate -uOsSystemInit -uOsBBoxDriverInit -uOsBBoxSystemAdapterInit -uOsHiDumperDriverInit -Map=/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out/liteos.map -o /home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out/liteos --start-group -lcortex-a7 -lgic -lbsp -lbsp_config -lrootfs -lbase -lcpup -ldynload -ltrace -lhook -lliteipc -lpipes -lpower -lc -lsec -lscrew -lz -lposix -lbsd -llinuxkpi -lvfs -lmulti_partition -lbch -lfat -lvirpart -ldisk -lbcache -lramfs -lnfs -lproc -ljffs2 -llwip --whole-archive -lhdf -lhdf_display -lhdf_input_driver -lhdf_config -lcfiflash -lvirtio -lplatform_char -lhdf_uart -lmtd_common -lspinor_flash --no-whole-archive -lmem -ltrace_dev -lquickstart -lvideo -lhilog -lshell -ltelnet -lsyscall -lsecurity /home/wxer/llvm/llvm/lib/clang/9.0.0/lib/arm-liteos/a7_softfp_neon-vfpv4/libclang_rt.builtins.a --end-group
ld.lld: error: /home/wxer/kernel_proj/openharmony/kernel/liteos_a/../../device/hisilicon/drivers/libs/ohos/llvm/hi3518ev300/libmtd_common.a:1: unknown directive: version

version https://git-lfs.github.com/spec/v1
^
make: *** [Makefile:165:/home/wxer/kernel_proj/openharmony/out/arm_virt/qemu_small_system_demo/obj/kernel/liteos_a/make_out/liteos] 错误 1
make: *** 正在等待未完成的任务....

/home/wxer/llvm/llvm/lib/clang/9.0.0/lib/arm-liteos/a7_softfp_neon-vfpv4/libclang_rt.builtins.a
现在用clang10了吧。

我单独下载了一个clang版本的,可能不对,我删除试试

./build/prebuilts_download.sh
要用这个自动下载,你的编译环境没配置好,看下官方文档进行配置。

还是有问题,
ramework/model/input/driver/hdf_input_driver.input_config_parser.o obj/device/qemu/arm_virt/liteos_a/board/amba_pl011/bsp_config.amba_pl011.o obj/device/qemu/arm_virt/liteos_a/board/bsp_config.platform.o obj/device/qemu/arm_virt/liteos_a/board/extcmd/bsp_config.reset_shell.o obj/device/qemu/arm_virt/liteos_a/board/os_adapt/bsp_config.os_adapt.o obj/out/arm_virt/qemu_small_system_demo/gen/device/qemu/arm_virt/liteos_a/hdf_config/hdf_config.hdf_hex.o obj/device/qemu/drivers/cfiflash/cfiflash.cfiflash.o obj/device/qemu/drivers/cfiflash/cfiflash.hdf_cfi.o obj/device/qemu/drivers/uart/hdf_uart.uart.o obj/device/qemu/drivers/uart/hdf_uart.uart_pl011.o obj/device/qemu/drivers/virtio/virtio.virtmmio.o obj/device/qemu/drivers/virtio/virtio.virtnet.o obj/device/qemu/drivers/virtio/virtio.virtgpu.o obj/device/qemu/drivers/virtio/virtio.virtinput.o obj/device/qemu/drivers/char/mmz/mmz.mmz.o ../../../prebuilts/clang/ohos/linux-x86_64/llvm/lib/clang/10.0.1/lib/arm-liteos/a7_softfp_neon-vfpv4/libclang_rt.builtins.a ../../../device/hisilicon/drivers/libs/ohos/llvm/hi3518ev300/libmtd_common.a -o obj/kernel/liteos_a/unstripped/bin/liteos && ccache /home/wxer/kernel_proj/openharmony/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-strip --strip-unneeded "obj/kernel/liteos_a/unstripped/bin/liteos" -o "obj/kernel/liteos_a/bin/liteos"
[OHOS ERROR] ld.lld: error: ../../../device/hisilicon/drivers/libs/ohos/llvm/hi3518ev300/libmtd_common.a:1: unknown directive: version
[OHOS ERROR] >>> version https://git-lfs.github.com/spec/v1
[OHOS ERROR] >>> ^
[OHOS ERROR] clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
[OHOS ERROR] [2728/3401] ACTION //kernel/liteos_a:make(//build/lite/toolchain:linux_x86_64_ohos_clang)
[OHOS ERROR] FAILED: obj/kernel/liteos_a/make_build_ext_components.txt

我现在操作步骤如下:

1)下载源码:

repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.0-LTS --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
  1. 执行
./build/prebuilts_download.sh
  1. hb set
wxer@wxer-PC:~/kernel_proj/openharmony$ hb set
[OHOS INFO] hb root path: /home/wxer/kernel_proj/openharmony
OHOS Which product do you need?  qemu_small_system_demo
  1. hb build

配置参考的是:https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup-linux.md

还有哪里配置不对吗?

本地环境:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

看起来没啥问题。hb build之前hb clean一下。。。

hb clean后还是有问题,是不是ubuntu 21.04系统的问题?

ccache -C清除一下编译器缓存再试试吧

laokz member
Reply laokz member

@w512 下载了一份3.0-LTS,在未运行repo forall -c 'git lfs pull'的情况下,编译构建重复出了你说的现象;运行这个命令后编译构建成功。请再核实一下repo forall -c 'git lfs pull'是否运行成功。

如果问题解决了,先手工打入一个遗漏的补丁再编译构建:https://gitee.com/openharmony/drivers_framework/pulls/237,并用qemu-run的-f参数确保重新制作映像

依然有这个问题,
这个是执行的命令流程
2011 hb set
2012 hb build
2013 history
2014 repo forall -c 'git lfs pull'
2015 hb set
2016 hb build
2017 ccache -c
2018 ccache -C
2019 hb clean
2020 rm -rf out/
2021 hb set
2022 hb build
2023 history
wxer@wxer-PC:~/

我重复出来的现象与你描述的一致:compiler type not set,unknown directive: version
https://git-lfs.github.com/spec/v1等,做了git lfs pull后现象消失,由此推断问题出在这个命令上。man git-lfs找找线索吧,实在不行..重装 远程调试...

我的git-lfs版本是2.13.3

@laokz 近期好多人入门者反映编译构建问题 :smile: ,看来你要开专栏普及基础知识了 :sunglasses:

@w512 还有一种可能:检查一下/bin/sh或/usr/bin/sh的符号链接指向,应该指向的是bash,不能是dash

应该是这个问题,
我执行了如下命令后,重新按流程来了一把,就可以了


sudo apt-get update
sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev 
sudo apt-get install gcc- multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev 
sudo apt-get install lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip npm
sudo apt-get install  pkg-config libglib2.0-dev  binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev
sudo apt-get install  virtualenv flex bison bridge-utils uml-utilities

sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh

貌似以前见过这个错误提示,
OHOS ERROR] /usr/bin/python3 ..
OHOS ERROR] compiler type not set!
1.编译测试hisilicon_hispark_taurus一下看是否能过(验证编译环境配置)。
2.repo更新代码再测试。

这个也有问题, Ubuntu 21.04系统的问题?? 只能用Ubuntu18.04或者Ubuntu 20.04??
[OHOS ERROR] [3383/5636] ACTION //kernel/liteos_a:make(//build/lite/toolchain:linux_x86_64_ohos_clang)
[OHOS ERROR] FAILED: obj/kernel/liteos_a/make_build_ext_components.txt
[OHOS ERROR] /usr/bin/python3 ../../../build/lite/build_ext_components.py --path=../../../kernel/liteos_a --command=./build.sh\ "hispark_taurus"\ "clang"\ "//out/hispark_taurus/ipcamera_hispark_taurus"\ "debug"\ "false"\ "hisilicon"\ "/home/wxer/kernel_proj/ohos/vendor/hisilicon/hispark_taurus"\ "/home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/obj/kernel/liteos_a/make_out"\ "OpenHarmony\ 2.3\ beta"\ "/home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/sysroot"\ "-mfloat-abi=softfp\ -mfpu=neon-vfpv4\ -mcpu=cortex-a7"\ "/home/wxer/kernel_proj/ohos/device/hisilicon/hispark_taurus/sdk_liteos"\ "ccache\ /home/wxer/kernel_proj/ohos/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-"\ "/home/wxer/kernel_proj/ohos/vendor/hisilicon/hispark_taurus/kernel_configs/debug.config" --target_dir=/home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/obj/kernel/liteos_a/build.log --out_dir=/home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/error.log
[OHOS ERROR] sh param: hispark_taurus clang //out/hispark_taurus/ipcamera_hispark_taurus debug false hisilicon /home/wxer/kernel_proj/ohos/vendor/hisilicon/hispark_taurus /home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/obj/kernel/liteos_a/make_out OpenHarmony 2.3 beta /home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/sysroot -mfloat-abi=softfp -mfpu=neon-vfpv4 -mcpu=cortex-a7 /home/wxer/kernel_proj/ohos/device/hisilicon/hispark_taurus/sdk_liteos ccache /home/wxer/kernel_proj/ohos/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm- /home/wxer/kernel_proj/ohos/vendor/hisilicon/hispark_taurus/kernel_configs/debug.config
[OHOS ERROR] compiler type not set!
[OHOS ERROR] compiler type not set!
[OHOS ERROR] sysroot: /home/wxer/kernel_proj/ohos/out/hispark_taurus/ipcamera_hispark_taurus/sysroot

与ubuntu版本关系不大,仔细检查编译配置环境,如bash.pip3 .bashrc等,ohos不同版本配置不一样,确实有点麻烦,看是否漏了啥。ohos多个版本共存时,代码更新需重复执行repo int...。

laokz changed issue state from 待办的 to 已完成

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
Confirm
参与者(3)
1
https://git.oschina.net/openharmony/device_qemu.git
git@git.oschina.net:openharmony/device_qemu.git
openharmony
device_qemu
device_qemu

Search