public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] nptl: Fix pthread_create.c build with clang
Date: Fri, 28 Oct 2022 17:39:07 +0000 (GMT)	[thread overview]
Message-ID: <20221028173908.0060C384B12C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6b64624a6afcfb04fc8d0ccc53a4840301b7983c

commit 6b64624a6afcfb04fc8d0ccc53a4840301b7983c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Oct 25 11:07:59 2022 -0300

    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.

Diff:
---
 nptl/pthread_create.c | 6 ++++--
 1 file 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

                 reply	other threads:[~2022-10-28 17:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221028173908.0060C384B12C@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).