boards/LIBCXX: fix compile error.#18271
Closed
wangzhi16 wants to merge 1 commit intoapache:masterfrom
Closed
Conversation
Contributor
|
@wangzhi16 please fix the compilation error |
0cd5934 to
225a78b
Compare
xiaoxiang781216
approved these changes
Feb 2, 2026
225a78b to
78ce83a
Compare
xiaoxiang781216
approved these changes
Feb 2, 2026
CXX: libcxx/libcxx/src/verbose_abort.cpp libcxx/libcxx/src/thread.cpp:123:2: error: #error "Thread.cpp needs to enable config of CONFIG_TLS_TASK_NELEM," " and CONFIG_TLS_TASK_NELEM > 0, please enable it"
123 | #error "Thread.cpp needs to enable config of CONFIG_TLS_TASK_NELEM," \
| ^~~~~
libcxx/libcxx/src/thread.cpp: In function 'void std::__1::__alloc_thread_index()':
libcxx/libcxx/src/thread.cpp:136:24: error: 'task_tls_alloc' was not declared in this scope
136 | __g_thread_index = task_tls_alloc(__free_thread_local_data);
| ^~~~~~~~~~~~~~
libcxx/libcxx/src/thread.cpp: In function 'std::__1::__thread_specific_ptr<std::__1::__thread_struct>& std::__1::__thread_local_data()':
libcxx/libcxx/src/thread.cpp:146:69: error: 'task_tls_get_value' was not declared in this scope
146 | __p = reinterpret_cast<__thread_specific_ptr<__thread_struct>*>(task_tls_get_value(__g_thread_index));
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
78ce83a to
8e95ca8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This patch fixes a libc++ (
libcxx) compile error triggered by missing or incorrect TLS/task-local storage configuration. The compile failure originates fromlibcxx/libcxx/src/thread.cppwhich requiresCONFIG_TLS_TASK_NELEMto be enabled and greater than zero; the patch updates boardLIBCXXconfiguration to satisfy these requirements sothread.cppcan compile and link.Why
libcxxthread support depends on task-local storage (TLS) helpers (task_tls_alloc,task_tls_get_value) and a non-zeroCONFIG_TLS_TASK_NELEMto manage thread-local data.libcxxfails to compile with explicit#errordirectives inthread.cppand missing references to TLS helper symbols.compile error:
Impact
libcxxfor the affected board config. It is a board-level configuration fix and should not alter runtime behavior beyond enabling TLS support for thread-local storage.libcxx.Testing