使用clang6.0在zephyr中构建hello_world示例时,ld.lld命令失败

时间:2019-11-28 13:21:43

标签: clang zephyr-rtos

我想使用clang6.0构建示例/ subsys / power / device_pm,所以我按如下操作:

  1. 导出ZEPHYR_TOOLCHAIN_VARIANT = llvm
  2. mkdir构建和cd构建
  3. cmake -DBOARD = reel_board ..
  4. 制作

然后,我遇到了一些错误:

[ 95%] Linking C executable zephyr_prebuilt.elf
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
>>>  _bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
>>>                      ^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:101: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:557: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

有什么建议吗? 非常感谢!

1 个答案:

答案 0 :(得分:0)

reel_board是对的ARM吗?

很不幸,Clang不支持ARM。