[PATCH v2 2/3] newlib: Support --with/without-newlib-tls

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 21 07:09:21 UTC 2022


This RSB option defines if the --enable-newlib-reent-thread-local
(_REENT_THREAD_LOCAL_STORAGE) Newlib configuration option is used or not.

Update #4560.
---
 source-builder/config/checks.cfg       | 9 +++++++++
 source-builder/config/gcc-common-1.cfg | 1 +
 2 files changed, 10 insertions(+)

diff --git a/source-builder/config/checks.cfg b/source-builder/config/checks.cfg
index 93d4c97..da1c1da 100644
--- a/source-builder/config/checks.cfg
+++ b/source-builder/config/checks.cfg
@@ -23,6 +23,8 @@
 %{?without_java:%define enable_java 0}
 %{?with_objc:%define enable_objc 1}
 %{?without_objc:%define enable_objc 0}
+%{?with_newlib_tls:%define enable_newlib_tls 1}
+%{?without_newlib_tls:%define enable_newlib_tls 0}
 
 #
 # Default to C++ on.
@@ -72,3 +74,10 @@
 %ifn %{defined enable_obsolete}
  %define enable_obsolete 0
 %endif
+
+#
+# Default to Newlib thread-local storage instead of struct _reent off.
+#
+%ifn %{defined enable_newlib_tls}
+ %define enable_newlib_tls 0
+%endif
diff --git a/source-builder/config/gcc-common-1.cfg b/source-builder/config/gcc-common-1.cfg
index 694a1f3..0eb032b 100644
--- a/source-builder/config/gcc-common-1.cfg
+++ b/source-builder/config/gcc-common-1.cfg
@@ -192,6 +192,7 @@ URL: 	   http://gcc.gnu.org/
     --enable-version-specific-runtime-libs \
     --enable-newlib-io-c99-formats \
     %{?disable_MAKEINFO:MAKEINFO=missing} \
+    %{?enable_newlib_tls:--enable-newlib-reent-thread-local} \
     %{?with_iconv:--enable-newlib-iconv} \
     %{?with_iconv:--enable-newlib-iconv-encodings=%{_newlib_iconv_encodings}} \
     %{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \
-- 
2.35.3



More information about the devel mailing list