From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 63D0C3857415; Tue, 1 Nov 2022 13:09:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63D0C3857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667308150; bh=gW3b7o2GZe9aCRFrb6Rcx9ijnNIuGDm9nvExQgVbcqM=; h=From:To:Subject:Date:From; b=ez9bwmdW66nmjjZd9PLXxnymetoRqH5AFy6Uvo6GRvKnPAniYR1wm4RLkPQv2bGux qnNJOVMEWAHoGzV2WxTPlzmOZIKciO9fGZz4W/nSdrUB/jGNtyQnZwVkfTg6uSwT+u 1z/e6rO9jhwOZfqxmzJf6YlTTTxHTcucEqpDQ1Y4= 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] nptl: Fix pthread_create.c build with clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 8161978f89c3454e1b70e08efd98923e6a317a56 X-Git-Newrev: 3d8b5dde879c6e024548118914da5bfcbd5170a7 Message-Id: <20221101130910.63D0C3857415@sourceware.org> Date: Tue, 1 Nov 2022 13:09:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3d8b5dde879c6e024548118914da5bfcbd5170a7 commit 3d8b5dde879c6e024548118914da5bfcbd5170a7 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. Reviewed-by: Fangrui Song 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