LLVM Embedded Toolchains Working Group sync up

2025-11-06

Agenda

Discussion

Additional includes

  • Petr will review the alternative patch and comment.

Baremetal stdio

  • Petr is prototyping the weak symbols idea - there may be a proof of concept to show soon.

  • Total of 3 tiers are considered, however we can start with focusing on implementation of the first 2, for which there are immediate use cases, then follow up with the 3rd one (full implementation).

  • Daniel: Can the 2nd tier (std streams only) be added unconditionally? Should not have too much impact on code size.

    • Petr: It is less about code size, more how to design the interface correctly.

CMake memory usage in libc

  • Confirmed that memory usage is surprisingly high, however no explanation/ideas how to fix yet. May need to use CMake tracing or even build a debug version of CMake and run with a profiler.

  • The team is aware that libc CMake is heavy on use of abstractions - might be good simplify in general.

libc testing with baremetal Arm

  • Volodymyr confirmed that with adding a linker script file and retargeting of printf() in start.cpp (called semihosting in Arm Toolchain repo, but it is not a full semihosting implementation and full one is not needed) it is possible to:

    • Build compiler_rt builtins, then libc.

    • Run hermetic tests with QEMU.

  • Volodymyr will share the details in either Discourse or a proof of concept pull request.

Dev Meeting recap

Workshop

  • Peter will publish his notes about the workshop on Discourse - others are welcome to add theirs in the thread.

  • Other interesting highlights:

  • Tools to migrate projects from GCC to LLVM, e.g. clang-tidy.

    • There are many differences outside of clang/frontend: C library, boot code and especially linker scripts.

      • It would be great to provide more docs on LLD and linker scripts, especially differences compared to GNU. Adding more output/debug information in LLD itself too.

      • Would it be useful to create an LLD area team in LLVM Community? Petr will run this idea past LLVM committee.

    • Not all of the GCC/LLVM differences are embedded specific - how to organize and name the extra rules? Which clang-tidy module? CUDA also interested in similar migration tools, so a lot can be reused.

Roundtable

  • The roundtable was mostly focused on building libc from source. There was also a relevant talk from Google.

  • Carbon driver has a very similar implementation for building library from source. Code is available in GitHub to get an idea.