# Better Firmware with LLVM/Clang | Interrupt

**URL:** <https://community.memfault.com/t/better-firmware-with-llvm-clang-interrupt/195>\
**Category:** Blog\
**Created:** [May 20, 2020, 5:59am UTC](https://community.memfault.com/t/better-firmware-with-llvm-clang-interrupt/195 "2020-05-20T05:59:25Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![mcrajah](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.memfault.com/mcrajah/32/64_2.png) [@mcrajah](https://community.memfault.com/u/mcrajah)\
**Post date:** [May 29, 2020, 7:42pm UTC](https://community.memfault.com/t/better-firmware-with-llvm-clang-interrupt/195/17 "2020-05-29T19:42:46Z")

</div>

Hi Chris,  
Thank you very much for the prompt response!!  
I was able to get it working (mostly) with the `-use-cc` switch. After compile, I got a linker error.

`Compiling freertos_kernel/portable/GCC/ARM_CM4F/port.c`  
`Compiling freertos_kernel/portable/MemMang/heap_1.c`  
`Linking library`  
`clang-10: error: unable to execute command: Executable "ld.lld" doesn't exist!`  
`clang-10: error: ld.lld command failed with exit code 1 (use -v to see invocation)`

I got around this error by installing the the linker package (lld on arch). Once I installed this, I got a library related error:

`Compiling freertos_kernel/portable/MemMang/heap_1.c`  
`Linking library`  
`ld.lld: error: unable to find library -lgcc`  
`clang-10: error: ld.lld command failed with exit code 1 (use -v to see invocation)`  
`make: *** [Makefile:148: /home/rajah/workspace/interrupt/example/freertos-example-``llvm/build/nrf52.elf] Error 1`  
When I just run `make` instead of `scan-build make`, an elf output is generated. However, even with this error, I can still run `scan-view` as all the errors have been captured as part of the compile process. I am very impressed with how the errors are presented. I will continue with rest of the blog post as `scan-build` is working now. Any idea why `scan-build` its not able to find the `gcc` library?

---

_[View the full topic](https://community.memfault.com/t/better-firmware-with-llvm-clang-interrupt/195)._
