title: Zephyr error using llvm, works fine with default toolchain
body: <p>I'm building for board nrf52833_pca10100 and nrf52840_pca10056.</p>
  
  <p>changed toolchain by: 
  export ZEPHYR_TOOLCHAIN_VARIANT=llvm
  I have llvm-8-dev, clang, clang-8 installed through apt.
  for ZEPHYR_TOOLCHAIN_VARIANT=zephyr, sample/basic/blinky can build and make fine. Once swapped to llvm, the following error happens at build:</p>
  
  <pre><code>-- The C compiler identification is Clang 6.0.0
  -- The CXX compiler identification is Clang 6.0.0
  -- The ASM compiler identification is Clang
  -- Found assembler: /usr/bin/clang
  -- Cache files will be written to: /root/.cache/zephyr 
  CMake Error at ../../../cmake/extensions.cmake:1457 (message):   
  Assertion failed: The toolchain is unable to build a dummy C file.  
  See   CMakeError.log. Call Stack (most recent call first):  
      ../../../CMakeLists.txt:42 (assert)
  
  
  -- Configuring incomplete, errors occurred! See also "/home/zephyrproject/zephyr/samples/basic/blinky/test/CMakeFiles/CMakeOutput.log". 
  See also "/home/zephyrproject/zephyr/samples/basic/blinky/test/CMakeFiles/CMakeError.log".
  </code></pre>
  
  <p>I can force this issue to not appear and build by feeding <code>-D CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY</code> when building.
  However, when I try to make, the following errors happen:</p>
  
  <pre><code>In file included from /home/zephyrproject/modules/hal/nordic/nrfx/mdk/nrf.h:164: /home/zephyrproject/modules/hal/nordic/nrfx/mdk/compiler_abstraction.h:154:16: warning:
        variable 'sp' is uninitialized when used here [-Wuninitialized]
          return sp;
                 ^~ /home/zephyrproject/modules/hal/nordic/nrfx/mdk/compiler_abstraction.h:153:29: note:
        initialize the variable 'sp' to silence this warning
          register unsigned sp __ASM("sp");
                              ^
                               = 0 1 warning generated.
  </code></pre>
  
  <p>and at the very end of linking:</p>
  
  <pre><code>clang: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
  clang: error: unable to execute command: Executable "ld.lld" doesn't exist!
  clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
  zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:100: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
  make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
  CMakeFiles/Makefile2:2133: 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
  </code></pre>
  
  <p>Not sure what's wrong with it.</p>
  
  <p>EDIT: more CMakeError.log content</p>
  
  <pre><code>Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":
  clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
  Target: x86_64-pc-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin
  Performing C SOURCE FILE Test check_C__nostartfiles__nostdlib__isystem__usr_lib_llvm_6_0_lib_clang_6_0_0_include__isystem__usr_bin____lib_gcc_x86_64_linux_gnu_7_4_0_include_fixed__Wl___unresolved_symbols_ignore_in_object_files failed with the following output:
  Change Dir: /home/akirakato/Desktop/ncs/zephyr/samples/basic/blinky/bc/CMakeFiles/CMakeTmp
  
  Run Build Command(s):/usr/bin/make cmTC_11778/fast &amp;&amp; /usr/bin/make -f CMakeFiles/cmTC_11778.dir/build.make CMakeFiles/cmTC_11778.dir/build
  make[1]: Entering directory '/home/akirakato/Desktop/ncs/zephyr/samples/basic/blinky/bc/CMakeFiles/CMakeTmp'
  Building C object CMakeFiles/cmTC_11778.dir/src.c.obj/usr/bin/clang --target=arm-none-eabi   -Dcheck_C__nostartfiles__nostdlib__isystem__usr_lib_llvm_6_0_lib_clang_6_0_0_include__isystem__usr_bin____lib_gcc_x86_64_linux_gnu_7_4_0_include_fixed__Wl___unresolved_symbols_ignore_in_object_files -nostartfiles -nostdlib -isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/include-fixed -Wl,--unresolved-symbols=ignore-in-object-files   -o CMakeFiles/cmTC_11778.dir/src.c.obj   -c /home/akirakato/Desktop/ncs/zephyr/samples/basic/blinky/bc/CMakeFiles/CMakeTmp/src.c
  clang: warning: -Wl,--unresolved-symbols=ignore-in-object-files: 'linker' input unused [-Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '-nostartfiles' [-Wunused-command-line-argument]
  Linking C executable cmTC_11778
  /snap/cmake/237/bin/cmake -E cmake_link_script CMakeFiles/cmTC_11778.dir/link.txt --verbose=1
  /usr/bin/clang --target=arm-none-eabi  -Dcheck_C__nostartfiles__nostdlib__isystem__usr_lib_llvm_6_0_lib_clang_6_0_0_include__isystem__usr_bin____lib_gcc_x86_64_linux_gnu_7_4_0_include_fixed__Wl___unresolved_symbols_ignore_in_object_files -nostartfiles -nostdlib -isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/include-fixed -Wl,--unresolved-symbols=ignore-in-object-files  --specs=nosys.specs  CMakeFiles/cmTC_11778.dir/src.c.obj  -o cmTC_11778
  clang: warning: argument unused during compilation: '-nostartfiles' [Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
  clang: error: unable to execute command: Executable "ld.lld" doesn't exist!
  clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
  CMakeFiles/cmTC_11778.dir/build.make:86: recipe for target 'cmTC_11778' failed
  make[1]: \*\*\* [cmTC_11778] Error 1
  make[1]: Leaving directory '/home/akirakato/Desktop/ncs/zephyr/samples/basic/blinky/bc/CMakeFiles/CMakeTmp'
  Makefile:121: recipe for target 'cmTC_11778/fast' failed
  make: *** [cmTC_11778/fast] Error 2
  
  
  Source file was:
  int main(void) { return 0; }
  </code></pre>
  
  <p>I'm starting to suspect it's the clang 6 issue and that I need to use clang 8+, saw a post about clang fixing their issues which was after release date of clang 6. Not sure how to change which clang zephyr picks though. </p>