[RFC v2] Add [v]aprintf(3)

Joseph Myers josmyers@redhat.com
Tue Mar 17 20:52:50 GMT 2026


On Tue, 17 Mar 2026, Alejandro Colomar wrote:

> > There is also the question if we need to nldbl variants for some ABIs
> > (I don't recall in details the issue).
> 
> I don't know what ldbl and nldbl are, so I can't tell.

On platforms with two long double formats (-mlong-double-64 and 
-mlong-double-128), all printf-like functions should have two versions, 
with __nldbl_* ones for the -mlong-double-64 case (with associated symbol 
versions in sysdeps/ieee754/ldbl-opt/Versions and tests enabled through 
sysdeps/ieee754/ldbl-opt/Makefile, and libio/bits/stdio-ldbl.h having a 
call to an appropriate redirection macro).  (There are also wrappers under 
the unprefixed names for libnldbl_nonshared.a, which I think is intended 
for compilers lacking asm redirection support, and probably doesn't work 
very well.)

On powerpc64le, there are three long double formats, so there are also 
__*ieee128 versions using binary128 long double, versions in 
sysdeps/ieee754/ldbl-128ibm-compat/Versions, tests enabled in 
sysdeps/ieee754/ldbl-128ibm-compat/Makefile.

All symbol versions also require corresponding updates to *.abilist.  For 
simple cases of a function at the same version on all supported platforms, 
"make update-all-abi" suffices, but for printf-like functions, platforms 
with __nldbl_* need those added to the relevant .abilist files, and 
likewise for __*ieee128 on powerpc64le.

The effect is that printf-like functions are some of the hardest to add to 
glibc and testing on powerpc64le is essential (and testing with 
build-many-glibcs.py may be useful as well to make sure that all supported 
ABIs build and pass the compilation parts of the testsuite, but takes a 
lot of resources).

> > and the
> > fortification wrapper.
> 
> Okay; I'll try this too.

Of course where functions have fortification wrappers, those need all the 
same long double variants as well.

-- 
Joseph S. Myers
josmyers@redhat.com



More information about the Libc-alpha mailing list