Toolchains adventures - Q2 2022

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....

June 30, 2022 · 3 min

Clang Static Analyzer and the Z3 constraint solver

As far as static analyzers are concerned, one of the most important point to consider is filtering out false positives as much as possible, in order for the reports to be actionable. This is an area on which Coverity did an excellent job, and likely a major reason why they got so popular within the open source community, despite being a closed-source product. LLVM has the LLVM_ENABLE_Z3_SOLVER build option, which allows building LLVM against the Z3 constraint solver....

June 21, 2022 · 3 min

Differences between base and ports LLVM in OpenBSD

LLVM was imported in the OpenBSD ports tree back in 2008, and happily lived there for a long while before being imported in the source tree at the g2k16 hackathon in 2016. I previously wrote about this in “The state of toolchains in OpenBSD” last year. As mentioned in my previous article, we do not use upstream build system to build LLVM in the base system, but hand-written BSD Makefiles. Importing CMake into the base system was not an option, because of the size of the project and the large dependency chain it requires for building....

June 20, 2022 · 3 min

Toolchains adventures - Q1 2022

This is the fourth 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 packaged and imported pax-utils, and updated mold to the 1.0.1, 1.0.2, 1.0.3, 1.1, and 1.1.1 versions. Since version 1.0.2, mold can now link NetBSD object files thanks to work done by pho@. I also committed upstream fix for CVE-2021-45078 in binutils to fix an out-of-bounds write, and imported our NetBSD/aarch64 support patches for ld from the NetBSD’s src repository....

April 1, 2022 · 1 min

Toolchains adventures - Q4 2021

This is the third post in my toolchains adventures series. Please read the introduction and the Q3 2021 report if you want to get more context about this journey. The fourth quarter of 2021 started out in the best possible way, as I’ve been granted commit access to the LLVM project on October 1st. During the first part of October, I did commit a couple of micro-optimizations to several compiler drivers along with small improvements in various places, as highlighted in the commit list at the end of this post....

January 3, 2022 · 5 min

Toolchains adventures - Q3 2021

I’ve been keeping myself busy since I posted the “Diving into toolchains” article at the beginning of June, so here is an update detailing what I’ve been up to during the past couple of months. At the end of June, I went through the FSF copyright assignment process for both Binutils and GDB, which now allows me to contribute larger changes to these codebases. I thus updated the NetBSD system call table in GDB, and added support to readelf for reading OpenBSD ELF core notes....

October 1, 2021 · 4 min

The state of toolchains in OpenBSD

For most of the 2010s, the OpenBSD base system has been stuck with GCC 4.2.1. It was released in July 2007, imported into the OpenBSD source tree in October 2009, and became the default compiler on the amd64, i386, hppa, sparc64, socppc and macppc platforms in OpenBSD 4.8, released in November 2010. As specified in the commit message during import, this is the last version released under the GPLv2 license....

May 19, 2021 · 5 min

Speedbuilding LLVM/Clang in 2 minutes on ARM

This post is the AArch64 counterpart of my “Speedbuilding LLVM/Clang in 5 minutes” article. After publishing and sharing the previous post URL with some friends on IRC, I was asked if I wanted to try doing the same on a 160 cores ARM machine. Finding out what my answer was is left as an exercise to the reader :-) The system I’m using for this experiment is a BM.Standard.A1.160 bare-metal machine from Oracle Cloud, which has a dual-socket motherboard with two 80 cores Ampere Altra CPUs, for a total 160 cores, and 1024 GB of RAM....

May 12, 2021 · 5 min

Speedbuilding LLVM/Clang in 5 minutes

This post is a spiritual successor to my “Building LLVM on OpenBSD/loongson” article, in which I retraced my attempts to build LLVM 3.7.1 on MIPS64 in a RAM constrained environment. After reading the excellent “Make LLVM fast again”, I wanted to revisit the topic, and see how fast I could build a recent version of LLVM and Clang on modern x86 server hardware. The system I’m using for this experiment is a CCX62 instance from Hetzner, which has 48 dedicated vCPUs and 192 GB of RAM....

May 11, 2021 · 4 min

The state of toolchains in NetBSD

While FreeBSD and OpenBSD both switched to using LLVM/Clang as their base system compiler, NetBSD picked a different path and remained with GCC and binutils regardless of the license change to GPLv3. However, it doesn’t mean that the NetBSD project endorses this license, and the NetBSD Foundation’s has issued a statement about its position on the subject. Realistically, NetBSD is more or less tied to GCC, as it supports more architectures than the other BSDs, some of which will likely never be supported in LLVM....

April 9, 2021 · 3 min