This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

BUG: in __atexit.c


Hi.
I'm building newlib version 1.20.0 for cortex-m3 target and found a source
code bug that prevents from building with -D_REENT_SMALL defined.

My configure command is:
../newlib-src/configure --prefix=/c/cortex --target=arm-none-yos
--disable-newlib-supplied-syscalls --with-gnu-ld --with-gnu-as
--disable-shared --enable-lto --with-float=soft --with-libelf=/usr
CFLAGS_FOR_TARGET="-ffunction-sections -fdata-sections
-DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -D_REENT_SMALL -DSMALL_MEMORY
-Os -fomit-frame-pointer -D__BUFSIZ__=256 -msoft-float"
CXXFLAGS_FOR_TARGET="-ffunction-sections -fdata-sections
-DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -Os -fomit-frame-pointer
-D__BUFSIZ__=256 -msoft-float"

I have the following error : 
../../../../../newlib-src/newlib/libc/stdlib/__atexit.c: In function
'__register_exitproc':
../../../../../newlib-src/newlib/libc/stdlib/__atexit.c:77:8: error: 'lock'
undeclared (first use in this function)
../../../../../newlib-src/newlib/libc/stdlib/__atexit.c:77:8: note: each
undeclared identifier is reported only once for each function it appears in

It is easy to fix the issue. I've done it but the same issue was at previous
version too. So I've decided to report a bug to have  the issue fixed.
To fix the issue one has to change line 77 of __atexit.c  from
"__lock_release(lock);"  to "__lock_release(__atexit_lock);".
Best regards,
Slava



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]