I got this minimal system whare I build glibc with USE=-static-libs but I still got libnldbl_nonshared.a/libc_nonshared.s libs. Are those just legacy or still needed for building apps?
*_nonshared.a libraries contain things which are only in static libraries and cannot be included in shared libraries. https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-2.33.ebuild?id=12657ee8e74ae494ec94e054b157b1bf2c729e80#n1408
Yes, they are needed for code that has to be included into final binaries directly without library indirection. As a learning exercise I suggest creating a chroot and trying to find out what breaks if you move these files away. My guess is that you will first hit the: $ cat /usr/lib64/libc.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) And later if you amend that you will get linker error for missing individual symbols that should get you a clue what is not implemented in crt*.o. You can also inspect contents of the archives and try to find out if these symbols are still needed. For example: $ nm /usr/lib64/libc_nonshared.a elf-init.oS: 0000000000000060 T __libc_csu_fini 0000000000000000 T __libc_csu_init ...
questions like this are better handled on upstream's libc-help list: https://www.gnu.org/software/libc/involved.html