From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 0060C384B12C; Fri, 28 Oct 2022 17:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0060C384B12C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666978748; bh=2Mtd1T3hHy++XG3LTaFg5gztsl2Ly3kkxgdpDJAJyUs=; h=From:To:Subject:Date:From; b=eHw/pdirIzBaJl/G86QL+j3nkdYTAUB3r+jG9HtDVPFbwx8qk6X2BCPhBbCVFSsai O8asKX4btTW5AzOLo8Z0irDIdP7vejq0BhENTxpt/SdrIDnaWHlGX+rppsh+MJkEmN KU1AxrgTRqGlqitwFoEGNl5ySBPJWFX3VS743TEw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] nptl: Fix pthread_create.c build with clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: de79b7f7a525e6084379a98710a1b82b2c3367eb X-Git-Newrev: 6b64624a6afcfb04fc8d0ccc53a4840301b7983c Message-Id: <20221028173908.0060C384B12C@sourceware.org> Date: Fri, 28 Oct 2022 17:39:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6b64624a6afcfb04fc8d0ccc53a4840301b7983c commit 6b64624a6afcfb04fc8d0ccc53a4840301b7983c Author: Adhemerval Zanella 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