Hacker News new | past | comments | ask | show | jobs | submit login
Better Firmware with LLVM/Clang (memfault.com)
42 points by signa11 10 hours ago | hide | past | favorite | 4 comments





"Better" is subjective, as an LLVM is not always appropriate for most firmware.

Indeed, note gcc is sometimes intentionally Nerf'ed to suppress optimizations in favor of more repeatable code-motion behavior in real-time systems. Yes this can compile terribly inefficient binaries when inspected, but they are predictable and repeatable builds.

There is sometimes extremely good reasons to be able to inspect exactly what the assembly dump does, and know for sure it won't get randomly permuted in the compilation optimization/abstraction LLVM builds.

This concept is difficult for people who don't understand the subtle difference between guaranteed-latency schedulers, and real-time systems.

Clang is great for a lot of application level things performance wise, but firmware is often not one of those use-cases for really good reasons.

I guess it is true what they say, one day you must become a historian if you are around long enough. lol =3


Most of the benefits here seem to come from being able to use llvm, especially for static analysis; you could do this stuff, still ship binaries from GCC, and come out ahead.

In regular applications, most (serious) companies I’ve worked for used a combo of clang, GCC, and/or MSVC to have the largest list of warnings and bugs.

Companies serious about static analysis end up additionally using Sonar, PVS Studio, Insure++, among others, not plain llvm.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: