Presentation

Rebuild results

Detailed results

Status

Annexes

Rebuild

Configuration of the chroot

a chroot has been created with a minimal build environment

gcc and g++ have been put on hold to make sure then are not changed during the installation of the dependencies

(echo "gcc hold"|dpkg --set-selections)

(echo "gcc hold"|dpkg --set-selections) clang 3.0-5 has been installed (no changes from the version available in the

Debian archive has been made)

Debian archive has been made) /usr/bin/gcc, /usr/bin/g++ and /usr/bin/cpp symlinks has been changed to point to clang

g++-4.6, gcc-4.6 and cpp-4.6 have been removed to make sure they are not used.

VERSION=4.6 cd /usr/bin rm g++-$VERSION gcc-$VERSION cpp-$VERSION ln -s clang++ g++-$VERSION ln -s clang gcc-$VERSION ln -s clang cpp-$VERSION cd -

apt-get update echo "Install of clang" apt-get update apt-get install --yes --no-install-recommends clang -t unstable echo "Replace gcc, g++ & cpp by clang" cd /usr/bin VERSIONS="4.8 4.7 4.6" for VERSION in $VERSIONS; do rm g++-$VERSION gcc-$VERSION cpp-$VERSION ln -s clang++ g++-$VERSION ln -s clang gcc-$VERSION ln -s clang cpp-$VERSION done echo "Block the installation of new gcc version" echo "gcc-4.6 hold"|dpkg --set-selections echo "cpp-4.6 hold"|dpkg --set-selections echo "g++-4.6 hold"|dpkg --set-selections echo "gcc-4.7 hold"|dpkg --set-selections echo "cpp-4.7 hold"|dpkg --set-selections echo "g++-4.7 hold"|dpkg --set-selections echo "Check if gcc, g++ & cpp are actually clang" gcc --version|grep clang > /dev/null || exit 1

Acknowledgments

By Sylvestre Ledru IRILL ).This document presents the result of the rebuild of the Debian archive (the distribution) with clang, a C/C++ compiler.clang is now ready to build software for production (either for C, C++ or Objective-C). This compiler is providing many more warnings and interesting errors than the gcc suite while not carrying the same legacy as gcc.This rebuild has several goals. The first one is to prove (or not) that clang is a viable alternative. Second, building a software with different compilers improves the overall quality of code by providing different checks and alerts.The detailed list of errors with clang 10:31014 packages have been rebuild. Among them, 1110 (3.6 %) failed.Most of the errors are explained with test cases. maintainer view is also available. This shows per developers which packages should be fixed.Errors can be caused by several reasons:Of course, a bug can hide other bugs.Bugs (with patches) will be reported in the Debian bug tracker. They will be tagged as wishlist.The full list of all the results with logs are available at the following URL:The Debian archive is regularly rebuilt against the latest version of clang. This to achieve three goals:1) See which packages get fixed2) See the impact of new clang releases3) Find bugs or gcc-compatibility issues in gcc itselfThe 2.9 and 3.0 rebuild itself have been done on a cluster called Grid 5000.3.1, 3.2 and later rebuilds have been done on AWS, the Amazon cloud, sponsoring Debian.Each packages in the Debian archive has been rebuild with the chroot described further.For each packages failing to build from the source with clang, the package has been rebuild with a "normal" Debian sid chroot. If working, we considered that it was due to a clang bug. Otherwise, the package is not listed in this list.The procedure for 2.9 & 3.0 was the following:All packages of the archive (15658 sources packages) have been rebuild this chroot (even the one without any C or C++ code). Build dependencies used are the same as Debian. For example, that means that the libxml2 used to build a package will be the one from Debian, not the one built with clang.From clang 3.1, with the EC2 Amazon cloud, anis used for each sbuild to setup the environnement.The init code is the following:The same procedure has been used for the 3.2 rebuild except that the clang packages have been rebuild for unstable (instead of the experimental packages).Many thanks to Lucas Nussbaum for his time and patience. Stefano Zacchiroli for the review (among other things).Thanks also to Grid 5000 for their infrastructure and Amazon for their credit to use AWS.