From patchwork Sat Mar 17 22:54:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 887341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-91118-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="e5JjUBf3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 403d1v4Yllz9sSt for ; Sun, 18 Mar 2018 09:54:43 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=FGRZdWQ+Xrzfv90mh3kgFat6UwnmopQX68J5M5ZgX2HA9WNhEXFlv spZFzO9X+cj/KWrLJ6LlNrhVkEhd3zUGJlBuhLU6L8/TjI9VeKwaEFFmLrWXYUvm oFgR0UBAHTmQUV8cKqfCtO2iE8DYL24nkJap+mTRORTaSmt80OcdIE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=/7f5Xis74XfiSC8po6tLgy5a2+8=; b=e5JjUBf36IHWL4uk4/+i9bXMsNfy r/O37sR/J8/ift7cldBXaGegovLrzvfP/TYq8mPd7N09+koqEVS8OnhWR1QcDycP Gqun9Nh+j4tHSYX3KVfwPGlmb7PyauXXrTklfrHCRruE+OoUALAc8QytqLEbZIfL p9vzWdzVlP903MQ= Received: (qmail 88765 invoked by alias); 17 Mar 2018 22:54:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 88411 invoked by uid 89); 17 Mar 2018 22:54:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited] hurd: Fix link cthread/pthread symbol exposition. Date: Sat, 17 Mar 2018 23:54:30 +0100 Message-Id: <20180317225430.15363-1-samuel.thibault@ens-lyon.org> * hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork, cthread_detach, pthread_getattr_np, pthread_attr_getstack, cthread_keycreate, cthread_getspecific, cthread_setspecific to __cthread_fork, __cthread_detach, __pthread_getattr_np, __pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific, __cthread_setspecific. * hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork, __cthread_detach, __pthread_getattr_np, __pthread_attr_getstack, __cthread_t instead of cthread_fork, cthread_detach, pthread_getattr_np, pthread_attr_getstack. * sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to __cthread_keycreate. (cthread_getspecific): Rename to __cthread_getspecific. (cthread_setspecific): Rename to __cthread_setspecific. (__libc_getspecific): Use __cthread_getspecific instead of cthread_getspecific. * sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use __cthread_keycreate instead of cthread_keycreate. (__libc_setspecific): Use __cthread_setspecific instead of cthread_setspecific. * sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific): Likewise. --- ChangeLog | 22 ++++++++++++++++++++++ hurd/Versions | 6 +++--- hurd/hurdsig.c | 24 ++++++++++++------------ sysdeps/mach/hurd/cthreads.c | 8 ++++---- sysdeps/mach/hurd/libc-lock.h | 4 ++-- sysdeps/mach/libc-lock.h | 4 ++-- 6 files changed, 45 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8823b3010..2fe1850e21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -78,6 +78,28 @@ (__mig_dealloc_reply_port): Likewise. (__mig_init): Do not initialize threadvar. * sysdeps/mach/hurd/profil.c: Fix comment. + * hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork, + cthread_detach, pthread_getattr_np, pthread_attr_getstack, + cthread_keycreate, cthread_getspecific, cthread_setspecific to + __cthread_fork, __cthread_detach, __pthread_getattr_np, + __pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific, + __cthread_setspecific. + * hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork, + __cthread_detach, __pthread_getattr_np, __pthread_attr_getstack, + __cthread_t instead of cthread_fork, cthread_detach, + pthread_getattr_np, pthread_attr_getstack. + * sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to + __cthread_keycreate. + (cthread_getspecific): Rename to __cthread_getspecific. + (cthread_setspecific): Rename to __cthread_setspecific. + (__libc_getspecific): Use __cthread_getspecific instead of + cthread_getspecific. + * sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use + __cthread_keycreate instead of cthread_keycreate. + (__libc_setspecific): Use __cthread_setspecific instead of + cthread_setspecific. + * sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific): + Likewise. 2018-03-16 Samuel Thibault diff --git a/hurd/Versions b/hurd/Versions index 164aa64400..602391ca08 100644 --- a/hurd/Versions +++ b/hurd/Versions @@ -139,14 +139,14 @@ libc { HURD_CTHREADS_0.3 { # weak refs to libthreads functions that libc calls iff libthreads in use - cthread_fork; cthread_detach; - pthread_getattr_np; pthread_attr_getstack; + __cthread_fork; __cthread_detach; + __pthread_getattr_np; __pthread_attr_getstack; # variables used for detecting cthreads _cthread_exit_routine; _cthread_init_routine; # cthreads functions with stubs in libc - cthread_keycreate; cthread_getspecific; cthread_setspecific; + __cthread_keycreate; __cthread_getspecific; __cthread_setspecific; __libc_getspecific; } } diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index 8069de391f..ea76be7e32 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -1258,8 +1258,8 @@ _hurdsig_init (const int *intarray, size_t intarraysize) /* Start the signal thread listening on the message port. */ -#pragma weak cthread_fork - if (!cthread_fork) +#pragma weak __cthread_fork + if (!__cthread_fork) { err = __thread_create (__mach_task_self (), &_hurd_msgport_thread); assert_perror (err); @@ -1291,22 +1291,22 @@ _hurdsig_init (const int *intarray, size_t intarraysize) we'll let the signal thread's per-thread variables be found as for any normal cthread, and just leave the magic __hurd_sigthread_* values all zero so they'll be ignored. */ -#pragma weak cthread_detach -#pragma weak pthread_getattr_np -#pragma weak pthread_attr_getstack - cthread_t thread = cthread_fork ((cthread_fn_t) &_hurd_msgport_receive, - 0); - cthread_detach (thread); - - if (pthread_getattr_np) +#pragma weak __cthread_detach +#pragma weak __pthread_getattr_np +#pragma weak __pthread_attr_getstack + __cthread_t thread = __cthread_fork ( + (cthread_fn_t) &_hurd_msgport_receive, 0); + __cthread_detach (thread); + + if (__pthread_getattr_np) { /* Record signal thread stack layout for fork() */ pthread_attr_t attr; void *addr; size_t size; - pthread_getattr_np ((pthread_t) thread, &attr); - pthread_attr_getstack (&attr, &addr, &size); + __pthread_getattr_np ((pthread_t) thread, &attr); + __pthread_attr_getstack (&attr, &addr, &size); __hurd_sigthread_stack_base = (uintptr_t) addr; __hurd_sigthread_stack_end = __hurd_sigthread_stack_base + size; } diff --git a/sysdeps/mach/hurd/cthreads.c b/sysdeps/mach/hurd/cthreads.c index 640c97ec1d..35689307b4 100644 --- a/sysdeps/mach/hurd/cthreads.c +++ b/sysdeps/mach/hurd/cthreads.c @@ -26,7 +26,7 @@ char __libc_lock_self0[0]; /* Placeholder for key creation routine from Hurd cthreads library. */ int weak_function -cthread_keycreate (cthread_key_t *key) +__cthread_keycreate (cthread_key_t *key) { __set_errno (ENOSYS); *key = -1; @@ -36,7 +36,7 @@ cthread_keycreate (cthread_key_t *key) /* Placeholder for key retrieval routine from Hurd cthreads library. */ int weak_function -cthread_getspecific (cthread_key_t key, void **pval) +__cthread_getspecific (cthread_key_t key, void **pval) { *pval = NULL; __set_errno (ENOSYS); @@ -46,7 +46,7 @@ cthread_getspecific (cthread_key_t key, void **pval) /* Placeholder for key setting routine from Hurd cthreads library. */ int weak_function -cthread_setspecific (cthread_key_t key, void *val) +__cthread_setspecific (cthread_key_t key, void *val) { __set_errno (ENOSYS); return -1; @@ -58,6 +58,6 @@ void * __libc_getspecific (cthread_key_t key) { void *val; - cthread_getspecific (key, &val); + __cthread_getspecific (key, &val); return val; } diff --git a/sysdeps/mach/hurd/libc-lock.h b/sysdeps/mach/hurd/libc-lock.h index 2dfade93eb..ed45f076b3 100644 --- a/sysdeps/mach/hurd/libc-lock.h +++ b/sysdeps/mach/hurd/libc-lock.h @@ -201,8 +201,8 @@ struct __libc_once /* Type for key of thread specific data. */ typedef cthread_key_t __libc_key_t; -#define __libc_key_create(KEY,DEST) cthread_keycreate (KEY) -#define __libc_setspecific(KEY,VAL) cthread_setspecific (KEY, VAL) +#define __libc_key_create(KEY,DEST) __cthread_keycreate (KEY) +#define __libc_setspecific(KEY,VAL) __cthread_setspecific (KEY, VAL) void *__libc_getspecific (__libc_key_t key); #endif /* _CTHREADS_ */ diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h index caeba47a3a..89e5715341 100644 --- a/sysdeps/mach/libc-lock.h +++ b/sysdeps/mach/libc-lock.h @@ -124,8 +124,8 @@ struct __libc_once #define __libc_mutex_unlock __mutex_unlock #endif -#define __libc_key_create(KEY,DEST) cthread_keycreate (KEY) -#define __libc_setspecific(KEY,VAL) cthread_setspecific (KEY, VAL) +#define __libc_key_create(KEY,DEST) __cthread_keycreate (KEY) +#define __libc_setspecific(KEY,VAL) __cthread_setspecific (KEY, VAL) void *__libc_getspecific (__libc_key_t key); /* XXX until cthreads supports recursive locks */