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

H. Peter Anvin
Fri Feb 3 03:51:36 GMT 2023


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 \

(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?


More information about the Newlib mailing list