This is the fifth post in my toolchains adventures series. Please check the previous posts in the toolchains category for more context about this journey.

In Pkgsrc land, I updated mold to the 1.2, 1.2.1, and 1.3 versions, and pax-utils to the 1.3.4 one. I also added a z3 option to our llvm and clang packages to allow building them against the Z3 theorem prover. When both lang/llvm and lang/clang are built with the z3 option enabled, the Z3 constraint solver is activated for the Clang static analyzer. This option is not enabled by default. I wrote a blog post showing how to use Z3 as an external solver and to do refutation to filter out false positives.

While I mention static analysis, I’ve been extremely impressed with the progress of the GCC’s static analysis framework. It was introduced in GCC 10, and a major rewrite occurred in GCC 11. It now generates significantly less false positives, and found some valid memory leaks on error paths in libansilove 1.30, which the Clang static analyzer didn’t catch.

Regarding the NetBSD base system, I started evaluating what it would take to upstream our local binutils patches. The version we have in NetBSD’s src repository is binutils 2.34 (released in February 2020), and diffing our tree with the release tarball results in a 4310 lines diff, touching 163 files with 1404 insertions and 186 deletions.

For each of these changes, we need to dig into version control history to find why they were needed in the first place, verify if they are still needed, and if so potentially rework them to meet upstream coding standards. This requires an understanding of the problem domain to be able to explain the rationale behind the changes while submitting patches and writing relevant commit messages.

While some of those patches are NetBSD specific, we still need to ensure we are not breaking other operating systems. Ultimately, vanilla binutils should be able to produce working binaries on NetBSD without requiring any local patches. Once this goal is reached, we need to ensure it keeps building, investigate test suite failures, and setup buildbots for continuous builds on key architectures.

On the LLVM side, I managed to do a couple of commits as well to add libclang_rt.profile{{.*}}.a tests for both OpenBSD and NetBSD in the Clang driver test suite.

Lastly, I also wrote a couple of blog posts about various topics:

That’s all for now, happy Summer 2022 everyone!

LLVM commits:

2022-06-27 aa89bb3 [Driver][test] Add libclang_rt.profile{{.*}}.a tests for NetBSD
2022-06-26 2ff4fb6 [Driver][test] Add libclang_rt.profile{{.*}}.a tests for OpenBSD
2022-06-24 a129a37 [clang] Update Clang version from 14 to 15 in scan-build.1