newlib-cygwin/newlib/libc/stdio
Sebastian Huber b0cb9f85ca Use global stdio streams for all configurations
The _REENT_GLOBAL_STDIO_STREAMS was introduced by commit
668a4c8722 in 2017.  Since then it was enabled by
default for RTEMS.  Recently, the option was enabled for Cygwin which
previously used an alternative implementation to use global stdio streams.

In Newlib, the stdio streams are defined to thread-specific pointers
_reent::_stdin, _reent::_stdout and _reent::_stderr.  If the option is disabled
(the default for most systems), then these pointers are initialized to
thread-specific FILE objects which use file descriptors 0, 1, and 2,
respectively.  There are at least three problems with this:

(1) The thread-specific FILE objects are closed by _reclaim_reent().  This
    leads to problems with language run-time libraries that provide wrappers to
    the C/POSIX stdio streams (for example C++ and Ada), since they use the
    thread-specific FILE objects of the initialization thread.  In case the
    initialization thread is deleted, then they use freed memory.

(2) Since thread-specific FILE objects are used with a common output device via
    file descriptors 0, 1 and 2, the locking at FILE object level cannot ensure
    atomicity of the output, e.g. a call to printf().

(3) There are resource managment issues, see:

    https://sourceware.org/pipermail/newlib/2022/019558.html

    https://bugs.linaro.org/show_bug.cgi?id=5841

This patch enables the _REENT_GLOBAL_STDIO_STREAMS behaviour for all Newlib
configurations and removes the option.  This removes a couple of #ifdef blocks.
2022-06-10 20:13:52 +02:00
..
Makefile.inc newlib: libc: merge build up a directory 2022-03-16 21:18:25 -04:00
asiprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
asniprintf.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
asnprintf.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
asprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
clearerr.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
clearerr_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
diprintf.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
dprintf.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
fclose.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fcloseall.c Use global stdio streams for all configurations 2022-06-10 20:13:52 +02:00
fdopen.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
feof.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
feof_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ferror.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
ferror_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fflush.c Add global __sglue object for all configurations 2022-05-13 12:41:10 +02:00
fflush_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetc.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fgetc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fgetpos.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fgets.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fgets_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fgetwc.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fgetwc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fgetws.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fgetws_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fileno.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fileno_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
findfp.c Use global stdio streams for all configurations 2022-06-10 20:13:52 +02:00
fiprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fiscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
flags.c Typo in license for newlib/libc/stdio/flags.c 2020-02-06 11:58:50 +01:00
floatio.h Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fmemopen.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fopen.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fopencookie.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fpurge.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fputc.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fputc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fputs.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fputs_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fputwc.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fputwc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fputws.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fputws_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fread.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fread_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
freopen.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fseek.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fseeko.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fsetlocking.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fsetpos.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
ftell.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
ftello.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
funopen.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fvwrite.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fvwrite.h Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fwalk.c stdio: Replace _fwalk_reent() with _fwalk_sglue() 2022-05-13 12:40:10 +02:00
fwide.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
fwprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fwrite.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
fwrite_u.c Implement BSD/GNU unlocked stdio extensions. 2014-12-18 14:55:21 +00:00
fwscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getc.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getc_u.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getchar.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getchar_u.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getdelim.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getline.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
gets.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getw.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
getwc.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getwc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getwchar.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
getwchar_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
iprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
iscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
local.h Use global stdio streams for all configurations 2022-06-10 20:13:52 +02:00
makebuf.c Fix bug introduced in previous patch (44b60f0c) 2022-04-01 15:42:32 +02:00
mktemp.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
nano-svfprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
nano-svfscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
nano-vfprintf.c Commit patch from Tobias Burnus <tobias@codesourcery.com> 2022-03-30 15:58:06 -04:00
nano-vfprintf_float.c nano-vfprintf_float.c: Fix check if negative for nans. 2018-12-13 13:15:32 +01:00
nano-vfprintf_i.c ansification: remove _CONST 2018-01-17 11:47:08 -06:00
nano-vfprintf_local.h ansification: remove _PTR 2018-01-17 11:47:16 -06:00
nano-vfscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
nano-vfscanf_float.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
nano-vfscanf_i.c ansification: remove _PARAMS 2018-01-17 11:47:13 -06:00
nano-vfscanf_local.h Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
open_memstream.c Fix warnings when building for msp430-elf 2020-09-03 12:55:32 +02:00
perror.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
printf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putc.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putc_u.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putchar.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putchar_u.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
puts.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putw.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
putwc.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
putwc_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
putwchar.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
putwchar_u.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
refill.c Add global __sglue object for all configurations 2022-05-13 12:41:10 +02:00
remove.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
rename.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
rewind.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
rget.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
scanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sccl.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
setbuf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
setbuffer.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
setlinebuf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
setvbuf.c Make __sdidinit unused 2022-02-22 12:38:46 +01:00
siprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
siscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sniprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
snprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
stdio.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
stdio.tex Fix makedoc markup used in texinfo source 2015-06-23 16:14:39 +01:00
stdio_ext.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
svfiprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfiscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfiwprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfiwscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfwprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
svfwscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
swprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
swscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
tmpfile.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
tmpnam.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ungetc.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
ungetwc.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
vasiprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vasniprintf.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
vasnprintf.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
vasprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vdiprintf.c ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
vdprintf.c ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
vfieeefp.h Add __packed to struct ldieee 2017-04-18 12:25:35 +02:00
vfiprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
vfiscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
vfiwprintf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
vfiwscanf.c newlib: libc: move stdio multiplex logic from build to source files 2022-02-28 19:04:11 -05:00
vfprintf.c Commit patch from Tobias Burnus <tobias@codesourcery.com> 2022-03-30 15:58:06 -04:00
vfscanf.c stdio: Parse 0x0p+00 correctly in scanf 2021-06-18 17:15:37 -04:00
vfwprintf.c stdio: Fix issue of printing "%La" format with large exp part. 2021-11-29 22:51:16 +09:00
vfwscanf.c svfwscanf: Simplify _sungetwc_r to eliminate apparent buffer overflow 2021-08-18 10:37:24 +02:00
viprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
viscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsiprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsiscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsniprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsnprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vsscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vswprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vswscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vwprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
vwscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
wbuf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
wprintf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
wscanf.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
wsetup.c Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00