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

ld.lld command failed when build the hello_world sample in zephyr using clang6.0

我想使用 clang6.0 构建 samples/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

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

reel_board ARM 对吗?

不幸的是,Clang 尚不支持 ARM。