diff options
author | Matt Joyce <matthew.joyce@embedded-brains.de> | 2022-05-16 12:51:54 +0300 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-13 07:55:46 +0300 |
commit | ea99f21ce6c8a332845439ea87f792dbaf679d42 (patch) | |
tree | 94cfcaf461882955f7461b09d6c4c0e2f321e66e /newlib/configure.ac | |
parent | 1a0908203606527b6ac0ed438669b5bcd247a5f9 (diff) |
Add --enable-newlib-reent-thread-local option
By default, Newlib uses a huge object of type struct _reent to store
thread-specific data. This object is returned by __getreent() if the
__DYNAMIC_REENT__ Newlib configuration option is defined.
The reentrancy structure contains for example errno and the standard input,
output, and error file streams. This means that if an application only uses
errno it has a dependency on the file stream support even if it does not use
it. This is an issue for lower end targets and applications which need to
qualify the software according to safety standards (for example ECSS-E-ST-40C,
ECSS-Q-ST-80C, IEC 61508, ISO 26262, DO-178, DO-330, DO-333).
If the new _REENT_THREAD_LOCAL configuration option is enabled, then struct
_reent is replaced by dedicated thread-local objects for each struct _reent
member. The thread-local objects are defined in translation units which use
the corresponding object.
Diffstat (limited to 'newlib/configure.ac')
-rw-r--r-- | newlib/configure.ac | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/newlib/configure.ac b/newlib/configure.ac index 1951aab0c..bed444db0 100644 --- a/newlib/configure.ac +++ b/newlib/configure.ac @@ -173,6 +173,17 @@ AC_ARG_ENABLE(newlib-reent-binary-compat, esac fi], [newlib_reent_binary_compat=no])dnl +dnl Support --enable-newlib-reent-thread-local +AC_ARG_ENABLE(newlib-reent-thread-local, +[ --enable-newlib-reent-thread-local enable thread-local storage objects as a replacment for struct _reent members], +[if test "${newlib_reent_thread_local+set}" != set; then + case "${enableval}" in + yes) newlib_reent_thread_local=yes ;; + no) newlib_reent_thread_local=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-enable-reent-thread-local option) ;; + esac + fi], [newlib_reent_thread_local=no])dnl + dnl Support --enable-newlib-global-stdio-streams dnl This is no longer optional. It is enabled in all Newlib configurations. AC_ARG_ENABLE(newlib-global-stdio-streams, @@ -435,6 +446,10 @@ if test "${newlib_reent_binary_compat}" = "yes"; then AC_DEFINE(_WANT_REENT_BACKWARD_BINARY_COMPAT, 1, [Define to enable backward binary compatibility for struct _reent.]) fi +if test "${newlib_reent_thread_local}" = "yes"; then + AC_DEFINE(_WANT_REENT_THREAD_LOCAL, 1, [Define to enable thread-local storage objects as a replacment for struct _reent members.]) +fi + _mb_len_max=1 if test "${newlib_mb}" = "yes"; then AC_DEFINE(_MB_CAPABLE, 1, [Multibyte supported.]) |