Summary of 2025
Overview
This is a late summary of 2025βthe calendar has turned to February 2026.
In the past year, almost all of my time was devoted to the Bazel build system: a unified build system based on Bazel for projects in all languages. I had originally planned to spend time on Triton, but ended up with none. The LLVM JIT effort was suspended due to business changes, and no effort went into ClangIR.
Bazel cc_shared_library Explained
cc_shared_library is a Bazel rule for building C++ shared libraries (.so/.dll). Unlike the simple cc_binary(linkshared=1), it provides fine-grained dependency management, intelligently deciding which libraries should be statically linked into the shared library and which should be obtained through dynamic dependencies.
This blog provides an in-depth analysis of the cc_shared_library implementation to help you understand its internal workings.
C++ Code Coverage with Bazel
Recently, it was reported that C++20 module interface files generate no code coverage data. Upon investigating, I discovered that this is due to an instrumentation file that only accounts for explicitly instrumented files. If a file is not listed, its coverage data is skipped. For more details, refer to CoverageOutputGenerator–Main.java#L151-L155.
To address this, I’ve created a patch to include module interfaces in the instrumentation file. Below is the fix:
Bazel collect2: fatal error: cannot find 'ld' with build
The issue at hand stems from the linker ld.lld, which is specified by the -fuse-ld=lld option, not being present in the PATH during the binary linking process. The error message “cannot find ’ld’” can be misleading; it does not refer to /usr/bin/ld, but rather indicates a failure to locate ld.lld. The resolution involves adding the directory containing ld.lld to your PATH, either by overriding the PATH variable directly or by using --host_action_env=PATH=xxx.
Summary of 2024
Overview
In 2024, I continued to explore various areas within the compiler field. My focus this year included the Bazel Build System, LLVM JIT integration with our internal database, Sanitizers, and ClangIR. Below is a detailed summary of my work and achievements in each of these areas.
Commemorating the First LLVM Patch
This is my first patch contributed to LLVM project.
[mlir][llvm] Add support for memset.inline

πππ