about summary refs log tree commit diff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-10-25 11:07:59 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-11-01 09:51:10 -0300
commit3d8b5dde879c6e024548118914da5bfcbd5170a7 (patch)
treedb0efd8129788999b833d80a1b798994f76fa9e6 /nptl/pthread_create.c
parent8161978f89c3454e1b70e08efd98923e6a317a56 (diff)
downloadglibc-3d8b5dde879c6e024548118914da5bfcbd5170a7.tar.gz
glibc-3d8b5dde879c6e024548118914da5bfcbd5170a7.tar.xz
glibc-3d8b5dde879c6e024548118914da5bfcbd5170a7.zip
nptl: Fix pthread_create.c build with clang
clang complains that libc_hidden_data_def (__nptl_threads_events)
creates an invalid alias:

  pthread_create.c:50:1: error: alias must point to a defined variable or function
  libc_hidden_data_def (__nptl_threads_events)
  ^
  ../include/libc-symbols.h:621:37: note: expanded from macro
  'libc_hidden_data_def'

It seems that clang requires that a proper prototype is defined prior
the hidden alias creation.

Reviewed-by: Fangrui Song <maskray@google.com>
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 32ae2f4b2f..34a41a0fdf 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -45,13 +45,15 @@
 
 
 /* Globally enabled events.  */
-td_thr_events_t __nptl_threads_events;
+extern td_thr_events_t __nptl_threads_events;
 libc_hidden_proto (__nptl_threads_events)
+td_thr_events_t __nptl_threads_events;
 libc_hidden_data_def (__nptl_threads_events)
 
 /* Pointer to descriptor with the last event.  */
-struct pthread *__nptl_last_event;
+extern struct pthread *__nptl_last_event;
 libc_hidden_proto (__nptl_last_event)
+struct pthread *__nptl_last_event;
 libc_hidden_data_def (__nptl_last_event)
 
 #ifdef SHARED