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

Assembly instructions distribution

In my article about running FreeBSD on the Vortex86DX CPU, I mentioned using objdump to disassemble kernels in order to check whether they were using CMOV instructions or not. One thing leading to another, I thought it would be fun to calculate the distribution of assembly instructions in ELF binaries. It turns out it can be done rather easily with a bit of Shell foo. For the purpose of this article, I used SQLite 3....

June 13, 2022 · 5 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

Diving into toolchains

I’ve been wanting to learn more about compilers and toolchains in general for a while now. In June 2016, I asked about recommended readings on lexers and parsers on Twitter. However, I have to confess that I didn’t go forward with reading the Dragon Book. Instead, I got involved as a developer in the OpenBSD and NetBSD projects, and witnessing the evolution of toolchains within those systems played a big role in maintaining my interest and fascination in the topic....

June 8, 2021 · 3 min

Playing with DJGPP and GCC 10 on DOS

I was recently amazed to discover that DJGPP was still being maintained, and had very recent versions of GCC and binutils available. I have not been doing any C programming on DOS in a very long time now, so I think the timing is right. There is an installation program with an interface very similar to the good old Turbo Vision, which could be helpful in case one wants to install the full environment....

May 23, 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