Implemented the ability to build Glibc using the LLVM toolkit

Collabora engineers have published a report on the implementation of a project to ensure the assembly of the GNU C Library (glibc) system library using the LLVM toolkit (Clang, LLD, compiler-rt) instead of GCC. Until recently, Glibc has been one of the significant components of distributions that only support building with GCC.

Difficulties in adapting Glibc for building with LLVM are caused both by the differences in the behavior of GCC and Clang when processing some constructs (for example, expressions with the $ symbol, nested functions, labels in asm blocks, long double and float128 types), and the need to replace runtime with libgcc on compiler-rt.

About 150 patches for the Gentoo environment and 160 for the ChromiumOS environment have been prepared to ensure the Glibc build using LLVM. In its current form, the assembly in ChromiumOS is already successfully passing the test suite, but is not yet enabled by default. The next step is to commit the prepared changes to the Glibc core and LLVM, continue testing, and fix any unusual issues that pop up. Some of the patches have already been accepted into the Glibc 2.37 branch.

Source: opennet.ru

Add a comment