Engineers from Collabora have published a report on the implementation of the project to enable the building of the GNU C Library (glibc) system library using the LLVM toolchain (Clang, LLD, compiler-rt) instead of GCC. Until recently, glibc had remained one of the significant components of distributions that only supported building with GCC.
The difficulties in adapting glibc for building with LLVM are caused both by the differences in behavior between GCC and Clang when processing certain constructs (for example, expressions with the $ symbol, nested functions, labels in asm blocks, long double and float128 types), and by the need to replace the runtime from libgcc to compiler-rt.
To ensure the building of glibc using LLVM, approximately 150 patches have been prepared for the Gentoo environment and 160 for the ChromiumOS-based environment. Currently, the build in ChromiumOS successfully passes the test suite, but it is not enabled by default yet. The next step will be to submit the prepared changes to the main branch of glibc and LLVM, continue testing, and correct any emerging atypical issues. Some of the patches have already been accepted into the glibc 2.37 branch.
Source: opennet.ru
