The integrated assembler does not support the obsoleted .tls_common directive % clang -c -x assembler =(printf '.tls_common x,4,4\n') /tmp/zsh5QvAWt:1:1: error: unknown directive .tls_common x,4,4 ^ ld.lld doesn't support it (there is no point supporting the obsoleted feature) % clang -c -x assembler -fno-integrated-as =(printf '.tls_common x,4,4\n') -o a.o && ld.lld a.o ld.lld: warning: cannot find entry symbol _start; defaulting to 0x201158 ld.lld: error: a.o has an STT_TLS symbol but doesn't have an SHF_TLS section elf/tls-macros.h COMMON_INT_DEF uses .tls_common and therefore some tests can be built/linked with clang or ld.lld Testing assembling and linking of .tls_common is binutils gas/ld's responsibility, not glibc's. https://sourceware.org/pipermail/libc-alpha/2021-July/129451.html (elf: Replace .tls_common with .tbss definition) can make the tests buildable with clang and ld.lld (There is a long way for clang to build glibc itself. https://sourceware.org/bugzilla/show_bug.cgi?id=27220 (nested functions in elf/) is the main one.)
> can be built/linked with clang or ld.lld can => cannot .tls_common and .tbss definition are almost identical after linking. So glibc tests can just use .tbss
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=33c50ef42878b07ee6ead8b3f1a81d8c2c74697c (elf: Drop elf/tls-macros.h in favor of __thread and tls_model attributes [BZ #28152] [BZ #28205]) Fixed for 2.35.