malloc() fails to compile with --enable-newlib-reent-thread-local

H. Peter Anvin hpa@zytor.com
Fri Feb 3 03:51:36 GMT 2023


Hi,

as of newlib-4.3.0 (git 9e09d6ed83cce4777a5950412647ccc603040409) 
malloc() fails to compile with the following options set:

         --disable-newlib-fseek-optimization \
         --disable-newlib-fvwrite-in-streamio \
         --disable-newlib-mb \
         --disable-newlib-reent-check-verify \
         --disable-newlib-register-fini \
         --disable-newlib-supplied-syscalls \
         --disable-newlib-unbuf-stream-opt \
         --disable-newlib-wide-orient \
         --enable-lite-exit \
         --enable-target-optspace \
         --enable-newlib-multithread \
         --enable-newlib-global-atexit \
         --enable-newlib-nano-formatted-io \
         --enable-newlib-io-c99-formats \
         --enable-newlib-reent-thread-local \
         --enable-newlib-nano-malloc

(same effect without --enable-newlib-nano-malloc).

The reason is that the malloc() routines appear to hard-code the use of 
"reent_ptr->_errno" instead of using _REENT_ERRNO(), but if I'm not 
completely out to sea it really shouldn't be using "reent_ptr" at all, 
similar to the !_LIBC case?

	-hpa



More information about the Newlib mailing list