diff options
author | Игорь Веневцев <igor.venevtsev@gmail.com> | 2016-01-29 18:19:57 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-02-08 10:33:07 +0100 |
commit | 352cdbb0125fafdf61977bfa299a7214ac885838 (patch) | |
tree | 1de48075629b4b317393f1c5561aa28e4c973ebf /libgloss/iq2000/stat.c | |
parent | 7c9651e3ccea4f8bbc5fe50d0ed266f8976a3328 (diff) | |
download | cygnal-352cdbb0125fafdf61977bfa299a7214ac885838.tar.gz cygnal-352cdbb0125fafdf61977bfa299a7214ac885838.tar.bz2 cygnal-352cdbb0125fafdf61977bfa299a7214ac885838.zip |
Newlib build is broken if configured with nano-malloc and non-reentrant system calls
Non-reentrant system calls version implies both MISSING_SYSCALL_NAMES
and REENTRANT_SYSCALL_PROVIDED macros to be defined.
Being coupled with --enable-newlib-nano-malloc knob it breaks the build:
bash-4.3$ ../newlib-2.3.0.20160104/configure CC_FOR_TARGET=gcc
AR_FOR_TARGET=ar RANLIB_FOR_TARGET=ranlib CFLAGS_FOR_TARGET="-m32
-DMISSING_SYSCALL_NAMES -DREENTRANT_SYSCALLS_PROVIDED"
--target=i386-elf --enable-newlib-nano-malloc && make
<...omitted output...>
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:
In function ‘_mallinfo_r’:
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:35:
error: macro "_sbrk_r" requires 2 arguments, but only 1 given
sbrk_now = _sbrk_r(RCALL 0);
^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
error: ‘_sbrk_r’ undeclared (first use in this function)
sbrk_now = _sbrk_r(RCALL 0);
^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
note: each undeclared identifier is reported only once for each
function it appears in
Makefile:1512: recipe for target 'lib_a-nano-mallinfor.o' failed
make[8]: *** [lib_a-nano-mallinfor.o] Error 1
In case of non-reentrant system calls _sbrk_r became a macro with TWO
args (defined in reent.h):
#define _sbrk_r(__reent, __incr) sbrk(__incr)
But in our case only one argument is present. (RCALL 0) is considered
as a single argument despite RCALL itself is a macro:)
So intermediate one-arg macro will be enough to expand args before
final _sbrk_r expansion:
#define _SBRK_R(X) _sbrk_r(X)
Here is a patch:
Diffstat (limited to 'libgloss/iq2000/stat.c')
0 files changed, 0 insertions, 0 deletions