You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/04/17 11:45:32 UTC

(nuttx) branch master updated: libc.csv: Fix macro guard for TLS related symbols

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4bcb33926e libc.csv: Fix macro guard for TLS related symbols
4bcb33926e is described below

commit 4bcb33926e0d1fe2f7d82532abac528c7485b9ab
Author: Huang Qi <hu...@xiaomi.com>
AuthorDate: Wed Apr 17 10:43:35 2024 +0800

    libc.csv: Fix macro guard for TLS related symbols
    
    The current macro guard for TLS related symbols is
    not enough, only if !defined(CONFIG_DISABLE_PTHREAD)
    and CONFIG_TLS_NELEM > 0, the TLS related symbols
    will enabled.
    
    So if CONFIG_DISABLE_PTHREAD is not defined, but
    TLS is disabled, the reference to TLS related symbols
    will cause build error (undefined reference to xxx).
    
    Signed-off-by: Huang Qi <hu...@xiaomi.com>
---
 libs/libc/libc.csv | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv
index 52be9fd249..2d7c77585d 100644
--- a/libs/libc/libc.csv
+++ b/libs/libc/libc.csv
@@ -213,9 +213,9 @@
 "pthread_condattr_setclock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *","clockid_t"
 "pthread_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_t *","FAR const pthread_attr_t *","pthread_startroutine_t","pthread_addr_t"
 "pthread_getname_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","char *","size_t"
-"pthread_getspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","FAR void *","pthread_key_t"
-"pthread_key_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_key_t *","FAR void (*) (void *)|FAR void *"
-"pthread_key_delete","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t"
+"pthread_getspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && CONFIG_TLS_NELEM > 0","FAR void *","pthread_key_t"
+"pthread_key_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && CONFIG_TLS_NELEM > 0","int","FAR pthread_key_t *","FAR void (*) (void *)|FAR void *"
+"pthread_key_delete","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && CONFIG_TLS_NELEM > 0","int","pthread_key_t"
 "pthread_mutex_lock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutex_t *"
 "pthread_mutexattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *"
 "pthread_mutexattr_getpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *","FAR int *"
@@ -229,7 +229,7 @@
 "pthread_rwlock_rdlock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_rwlock_t *"
 "pthread_rwlock_unlock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_rwlock_t *"
 "pthread_setname_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","const char *"
-"pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void *"
+"pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && CONFIG_TLS_NELEM > 0","int","pthread_key_t","FAR const void *"
 "pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void"
 "puts","stdio.h","defined(CONFIG_FILE_STREAM)","int","FAR const IPTR char *"
 "putwc","wchar.h","defined(CONFIG_FILE_STREAM)","wint_t","wchar_t","FAR FILE *"