I already know how to build the new version of Glibc (e.g. 2.3) beside the older version (e.g. 2.19).
I followed the instructions in https://www.tldp.org/HOWTO/html_single/Glibc-Install-HOWTO/
But rather compiling whole libraries in Glibc, I only want to build math libraries (libm.so).
How can I only recompile libm.so in ubuntu?
The second question is that possible to recompile that specific part (maths) in glibc using the clang compiler? I found that I cannot recompile the whole Glibc using clang because of standards compliance and etc.
libmdepends on internals in the dynamic loader andlibc, for example for IFUNC resolvers. You cannot simply takelibmfrom a newer version and use install it on a system with an older glibc version. A while back, a few patches were proposed to optionally enables this:--enable-math-noprivatestrto_*nanfunction innan*forCONFIG_MATH_NOPRIVATEstrtod_nam_*.hintomath-type-macros-*.h(This one was actually merged.)Even with those patches, it was still necessary to build glibc with
--disable-multi-arch, incurring a significant performance loss for some math functions.