# 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:** 38

<div class="post-metadata">

**Author:** ![Shaibi](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@Shaibi](https://community.memfault.com/u/Shaibi)\
**Post date:** [May 26, 2024, 11:12am UTC](https://community.memfault.com/t/better-firmware-with-llvm-clang-interrupt/195/38 "2024-05-26T11:12:01Z")

</div>

Hi @chrisc, i modified makefile generated by stm32cubemx for clang by following this guide. I resolved all the issues and errors. Code compiled successfully using clang and linked all objects by lld. There is no error but when i programmed stm32 and tried to run, controller got stuck. I debugged and found it stuck in hardfault handler called from startupfile.s at bl \_\_libc\_init\_array during stack constructors calls.

Do i missed some flag specific to clang or i need to re write .ld script? I am using default .ld script generated by stm32cubemx for gcc.

---

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