Sylvestre Ledru: Some clang rebuild results (8.0.1, 9.0.1 & 10rc2)
Raw logs are published on github: https://github.com/opencollab/clang.debian.net/tree/master/logs Since my last blog post on the subject (August 2017), Clang is more and more present in the tech ecosystem. It is now the compiler used to build Firefox and Chrome upstream binaries on all the supported architectures/operating systems. More architectures are supported, it has a new linker (lld), a new hybrid IR (MLIR), a lot of checkers in clang-tidy, cross-language linking with Rust, etc.
Results
Now, about Debian results, we rebuilt using 8.0.1, 9.0.1 and 10.0rc2. Results are pretty similar to what we had with previous versions: between 4 to 5% of packages are failing when gcc is replaced by clang.
Even if most of the software are still using gcc as compiler, we can see that clang has a positive effect on code quality. With many different kinds of errors and warnings found clang over the years, we noticed a steady decline of the number of errors. For example, the number of incorrect C/C++ main declarations has been decreasing years after years:
Errors found
The biggest offender is still the qmake changes which doesn't allow the used workaround (replacing /usr/bin/gcc by /usr/bin/clang) - about 250 errors. Most of these packages would probably compile fine with clang. More on the Qt bug tracker. The workaround proposed in the bug isn't applicable for us as we use the dropped-in replacement of the
The second error is still some differences in symbol generation. Unlike gcc, it seems that clang doesn't generate some symbols (or adds some). As a bunch of Debian packages are checking the list of symbols in the library (for ABI management), the build fails on purpose. For example, with libcec, the symbol _ZN10P8PLATFORM14CConditionImplD1Ev@Base 3.1.0 isn't generated anymore. I am not expecting this to be a big deal: the generated libraries probably works most of the time. More on C++ symbol management in Debian.
Current status
As previously said in a blog post, I don't think there is a strong intensive to go away from gcc for most of the Linux distributions. The big reason for BSD was the license (even if the move to the Apache 2 license wasn't received positively by some of them).
While the LLVM/clang ecosystem clearly won the tooling battle, as a C/C++ compiler, gcc is still an excellent compiler which supports more architecture and more languages.
In term of new warnings and checks, as the clang community moved the efforts in clang-tidy (which requires more complex tooling), out of the box, gcc provides a better experience (as example, see the Firefox meta bug to build with -Werror with the default warnings using gcc 9, gcc 10 and clang trunk for example).
Next steps
I see some potential next steps to decrease the number of failure:
- Workaround the Qt/Qmake issue
- Fix the objective-c header include issues (
echo "#include <objc/objc.h>" > foo.m && clang -c foo.m is currently failing)
- Identify why clang generates more/less symbols that gcc in the library and try to fix that
- Rebuild the archive with clang-7 - Seems that I have some data problem
Many thanks to Lucas Nussbaum for the rebuilds.
The biggest offender is still the qmake changes which doesn't allow the used workaround (replacing /usr/bin/gcc by /usr/bin/clang) - about 250 errors. Most of these packages would probably compile fine with clang. More on the Qt bug tracker. The workaround proposed in the bug isn't applicable for us as we use the dropped-in replacement of the
The second error is still some differences in symbol generation. Unlike gcc, it seems that clang doesn't generate some symbols (or adds some). As a bunch of Debian packages are checking the list of symbols in the library (for ABI management), the build fails on purpose. For example, with libcec, the symbol
_ZN10P8PLATFORM14CConditionImplD1Ev@Base 3.1.0 isn't generated anymore. I am not expecting this to be a big deal: the generated libraries probably works most of the time. More on C++ symbol management in Debian.Current status
As previously said in a blog post, I don't think there is a strong intensive to go away from gcc for most of the Linux distributions. The big reason for BSD was the license (even if the move to the Apache 2 license wasn't received positively by some of them).
While the LLVM/clang ecosystem clearly won the tooling battle, as a C/C++ compiler, gcc is still an excellent compiler which supports more architecture and more languages.
In term of new warnings and checks, as the clang community moved the efforts in clang-tidy (which requires more complex tooling), out of the box, gcc provides a better experience (as example, see the Firefox meta bug to build with -Werror with the default warnings using gcc 9, gcc 10 and clang trunk for example).
Next steps
I see some potential next steps to decrease the number of failure:
- Workaround the Qt/Qmake issue
- Fix the objective-c header include issues (
echo "#include <objc/objc.h>" > foo.m && clang -c foo.m is currently failing)
- Identify why clang generates more/less symbols that gcc in the library and try to fix that
- Rebuild the archive with clang-7 - Seems that I have some data problem
Many thanks to Lucas Nussbaum for the rebuilds.
I see some potential next steps to decrease the number of failure:
- Workaround the Qt/Qmake issue
- Fix the objective-c header include issues (
echo "#include <objc/objc.h>" > foo.m && clang -c foo.mis currently failing) - Identify why clang generates more/less symbols that gcc in the library and try to fix that
- Rebuild the archive with clang-7 - Seems that I have some data problem
Many thanks to Lucas Nussbaum for the rebuilds.
Mini-Disclaimer: I ll be talking about
It has been close to a year now that I've incorporated my new company, 
Example of rule matching returned in GitHub checks
Some people like to make bots talk to each other.
GitHub service status is not always green.
Liberation Mono
Fira Mono
Everywhere I worked in the past, the only feedback that was asked of
employees was during a yearly evaluation meeting. These meetings always felt to me
like talking to Santa Claus and his 










ELTS - Wheezy
Here is my monthly update covering what I have been doing in the free software world during February 2020 (






sbuild is a tool used by those maintaining packages in Debian, and
derived distributions such as Ubuntu. When used correctly, it can
catch a lot of categories of bugs before packages are uploaded. It
does this by building the package in a clean environment, and then
running the package through the Lintian, piuparts, adequate and
autopkgtest tools. However, configuring sbuild so that it makes use
of all of these tools is cumbersome.
In response to this complexity, I wrote