0

I want to build samples/subsys/power/device_pm using clang6.0 so I do as follows:

  1. export ZEPHYR_TOOLCHAIN_VARIANT=llvm
  2. mkdir build and cd build
  3. cmake -DBOARD=reel_board ..
  4. make

Then, I got some errors:

[ 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

Is there any suggestion? Thanks a lot!

Tuo Li
  • 3
  • 1

1 Answers1

0

reel_board is ARM right?

ARM is not supported for Clang yet unfortunately.

Sebastian Bøe
  • 479
  • 1
  • 3
  • 8
  • Thanks for your answer! It's a pity but is it possible to do this by modifying some cmake files or other related files? Or there is no solution due to clang itself? – Tuo Li Nov 30 '19 at 00:23