Discussion:
REENTRANT_SYSCALLS_PROVIDED?
Josef Wolf
2018-09-10 14:05:27 UTC
Permalink
Hello,

Where am I supposed to define the REENTRANT_SYSCALLS_PROVIDED macro?

I'm defining it to configure like this:

$ CFLAGS="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure

but I still get the reentrant syscalls in the resulting libc, which causes
link error, since I don't have any syscalls at all in my project.

Any help?

Thanks,
--
Josef Wolf
***@raven.inka.de
j***@beniston.com
2018-09-10 14:20:36 UTC
Permalink
Hi Josef,

Try CFLAGS_FOR_TARGET.

Cheers,
Jon

-----Original Message-----
From: newlib-***@sourceware.org <newlib-***@sourceware.org> On Behalf Of
Josef Wolf
Sent: 10 September 2018 15:05
To: ***@sourceware.org
Subject: REENTRANT_SYSCALLS_PROVIDED?

Hello,

Where am I supposed to define the REENTRANT_SYSCALLS_PROVIDED macro?

I'm defining it to configure like this:

$ CFLAGS="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure

but I still get the reentrant syscalls in the resulting libc, which causes
link error, since I don't have any syscalls at all in my project.

Any help?

Thanks,

--
Josef Wolf
***@raven.inka.de
Josef Wolf
2018-09-11 12:00:06 UTC
Permalink
I also tried with

$ CFLAGS_FOR_TARGET="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure

the reentrant syscalls are still pulled into the library.
Post by j***@beniston.com
Hi Josef,
Try CFLAGS_FOR_TARGET.
Cheers,
Jon
-----Original Message-----
Josef Wolf
Sent: 10 September 2018 15:05
Subject: REENTRANT_SYSCALLS_PROVIDED?
Hello,
Where am I supposed to define the REENTRANT_SYSCALLS_PROVIDED macro?
$ CFLAGS="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure
but I still get the reentrant syscalls in the resulting libc, which causes
link error, since I don't have any syscalls at all in my project.
Any help?
Thanks,
--
Josef Wolf
--
Josef Wolf
***@raven.inka.de
j***@beniston.com
2018-09-11 12:27:09 UTC
Permalink
Hi Josef,

Sorry, I should have made clear to pass that to make. E.g:

make CFLAGS_FOR_TARGET="-O2 -g -D..."

Works for me with other macros, at least.

Cheers,
Jon

-----Original Message-----
From: newlib-***@sourceware.org <newlib-***@sourceware.org> On Behalf Of
Josef Wolf
Sent: 11 September 2018 13:00
To: ***@sourceware.org
Subject: Re: REENTRANT_SYSCALLS_PROVIDED?

I also tried with

$ CFLAGS_FOR_TARGET="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure

the reentrant syscalls are still pulled into the library.
Post by j***@beniston.com
Hi Josef,
Try CFLAGS_FOR_TARGET.
Cheers,
Jon
-----Original Message-----
Behalf Of Josef Wolf
Sent: 10 September 2018 15:05
Subject: REENTRANT_SYSCALLS_PROVIDED?
Hello,
Where am I supposed to define the REENTRANT_SYSCALLS_PROVIDED macro?
$ CFLAGS="$CFLAGS -DREENTRANT_SYSCALLS_PROVIDED" ./configure
but I still get the reentrant syscalls in the resulting libc, which
causes link error, since I don't have any syscalls at all in my project.
Any help?
Thanks,
--
Josef Wolf
--
Josef Wolf
***@raven.inka.de
Josef Wolf
2018-09-12 07:06:31 UTC
Permalink
Post by j***@beniston.com
Hi Josef,
make CFLAGS_FOR_TARGET="-O2 -g -D..."
Works for me with other macros, at least.
I tried this also. But the reentrant functions are still included.

Any other ideas?
--
Josef Wolf
***@raven.inka.de
Josef Wolf
2018-09-12 11:10:59 UTC
Permalink
Hello again,
Post by j***@beniston.com
make CFLAGS_FOR_TARGET="-O2 -g -D..."
Works for me with other macros, at least.
Giving the setting to make, won't have any effect at all. The
REENTRANT_SYSCALLS_PROVIDED is not to be found in the build tree at all.

When I give the setting to configure, the setting at least is recorded in
config.log, config.status and Makefile:

$ grep CFLAGS_FOR_TARGET *
config.log:CFLAGS_FOR_TARGET='-g -O2 -DREENTRANT_SYSCALLS_PROVIDED'
config.log:DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
config.log:SYSROOT_CFLAGS_FOR_TARGET=''
config.status:S["CFLAGS_FOR_TARGET"]="-g -O2 -DREENTRANT_SYSCALLS_PROVIDED"
config.status:S["DEBUG_PREFIX_CFLAGS_FOR_TARGET"]=""
config.status:S["SYSROOT_CFLAGS_FOR_TARGET"]=""
grep: etc: Ist ein Verzeichnis
grep: m68k-unknown-elf: Ist ein Verzeichnis
Makefile: CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
Makefile:CFLAGS_FOR_TARGET = -g -O2 -DREENTRANT_SYSCALLS_PROVIDED
Makefile:LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
Makefile:GOCFLAGS_FOR_TARGET = -O2 -g
Makefile:SYSROOT_CFLAGS_FOR_TARGET =
Makefile:DEBUG_PREFIX_CFLAGS_FOR_TARGET =
Makefile:XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
Makefile: "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
Makefile: "GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \
Makefile: "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
Makefile:# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
Makefile: 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
Makefile: 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
Makefile: 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
$

but the reentrant functions are still there:

$ m68k-unknown-elf-gcc -nostartfiles -Wl,--cref,--section-start=vectors=0 \
-Wl,-Ttext=0x400,--entry=entry -Wl,--oformat,elf32-m68k \
-Wl,--cref,-Map,bestd.map \
-Wl,-T,ldscript.be -ansi -pedantic -Wall -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes -std=c89 -g -O2 \
-fno-toplevel-reorder -mcpu32 -o bestd.elf `cat bestd.objs` -lc \
/m/a/local/crossgcc/bin/../lib64/gcc/m68k-unknown-elf/8.2.0/../../../../m68k-unknown-elf/bin/ld:
/m/a/local/crossgcc/bin/../lib64/gcc/m68k-unknown-elf/8.2.0/../../../../m68k-unknown-elf/lib/mcpu32/libc.a(lib_a-makebuf.o):
in function `__swhatbuf_r':
/var/tmp/builds/crossgcc/src/newlib-3.0.0.20180802/newlib/libc/stdio/makebuf.c:96:
undefined reference to `fstat'
--
Josef Wolf
***@raven.inka.de
Josef Wolf
2018-09-12 16:48:28 UTC
Permalink
[ ... ]
undefined reference to `fstat'
The problem is that the calls to fstat_r() in makebuf.c are not guarded by the
REENTRANT_SYSCALLS_PROVIDED define.

What would be the correct way to guard this?
--
Josef Wolf
***@raven.inka.de
Loading...