From patchwork Mon Nov 7 13:47:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 81095 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1020501qge; Mon, 7 Nov 2016 05:48:00 -0800 (PST) X-Received: by 10.98.14.82 with SMTP id w79mr13591383pfi.153.1478526480605; Mon, 07 Nov 2016 05:48:00 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m19si26203755pag.320.2016.11.07.05.48.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 05:48:00 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74479-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-74479-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74479-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=sN5EUdKvBbs6ii7rqKbs8jp1QkmpY MDJqilSbtzTT6ijXcyOWjaoWjORksf1abRCg6HPZoNXyRyqcZQZo+Rtz2Cdz1Ig1 XqMBMBOZXVleibiMD5w3s2K4YhiurPBw6JLliVnvc4cFEPGIMYa7gh1LvuhXHC1j BCWDQL5jF7cR2g= 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:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=F2esBTL5WpvmcHxkZPIiD5Wb0ho=; b=Cak abBINWvfrFESyiJHpxl2gJ/OKRN5Fif88dGcbjqlKhyTffYjb7VbpJKAefZAYuKp /pOfv54ka1gcGATZHD4RXKN9EEq09rcikDDkBS7egeiefbeolXWK+3OZPw9Neabl yWSI8pKAukMBgf3zWlCYrGmNEYc09NUWxt0cwAnY= Received: (qmail 38990 invoked by alias); 7 Nov 2016 13:47:30 -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 38817 invoked by uid 89); 7 Nov 2016 13:47:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=importance, exposure, sk:enable_, 877 X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: [PATCH] nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI Message-ID: Date: Mon, 7 Nov 2016 14:47:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 I started composing a lengthy email about why we should align pthread_mutex_t layout on i386 and x86_64 (because cross-process compatibility is of more practical importance these days than LinuxThreads backwards compatibility). But then I realized that we don't have this choice due to the static initializers, which have __kind at different offsets. The attached patch makes this more explicit in the relevant header files. Thanks, Florian nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 Florian Weimer * sysdeps/aarch64/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Document ABI exposure of the __kind offset. * sysdeps/arm/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Mention reason for the __kind offset exposure in the ABI. * sysdeps/hppa/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/ia64/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/m68k/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/microblaze/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/mips/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/nios2/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/s390/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/sh/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/sparc/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/tile/nptl/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. * sysdeps/x86/bits/pthreadtypes.h (struct __pthread_mutex_s): Likewise. diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h index 13984a7..c376e64 100644 --- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h +++ b/sysdeps/aarch64/nptl/bits/pthreadtypes.h @@ -65,6 +65,8 @@ typedef union unsigned int __count; int __owner; unsigned int __nusers; + /* KIND must stay at this position in the structure to maintain + binary compatibility with static initializers. */ int __kind; int __spins; __pthread_list_t __list; diff --git a/sysdeps/arm/nptl/bits/pthreadtypes.h b/sysdeps/arm/nptl/bits/pthreadtypes.h index afb5392..645207b 100644 --- a/sysdeps/arm/nptl/bits/pthreadtypes.h +++ b/sysdeps/arm/nptl/bits/pthreadtypes.h @@ -64,7 +64,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; unsigned int __nusers; __extension__ union diff --git a/sysdeps/hppa/nptl/bits/pthreadtypes.h b/sysdeps/hppa/nptl/bits/pthreadtypes.h index 540802a..d0c1d58 100644 --- a/sysdeps/hppa/nptl/bits/pthreadtypes.h +++ b/sysdeps/hppa/nptl/bits/pthreadtypes.h @@ -71,7 +71,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; /* The old 4-word 16-byte aligned lock. This is initalized to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER. diff --git a/sysdeps/ia64/nptl/bits/pthreadtypes.h b/sysdeps/ia64/nptl/bits/pthreadtypes.h index f2e6dac..0e83883 100644 --- a/sysdeps/ia64/nptl/bits/pthreadtypes.h +++ b/sysdeps/ia64/nptl/bits/pthreadtypes.h @@ -64,7 +64,7 @@ typedef union int __owner; unsigned int __nusers; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; int __spins; __pthread_list_t __list; diff --git a/sysdeps/m68k/nptl/bits/pthreadtypes.h b/sysdeps/m68k/nptl/bits/pthreadtypes.h index d8faa7a..d195492 100644 --- a/sysdeps/m68k/nptl/bits/pthreadtypes.h +++ b/sysdeps/m68k/nptl/bits/pthreadtypes.h @@ -64,7 +64,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; unsigned int __nusers; __extension__ union diff --git a/sysdeps/microblaze/nptl/bits/pthreadtypes.h b/sysdeps/microblaze/nptl/bits/pthreadtypes.h index 9e9e307..2a1ca0a 100644 --- a/sysdeps/microblaze/nptl/bits/pthreadtypes.h +++ b/sysdeps/microblaze/nptl/bits/pthreadtypes.h @@ -63,7 +63,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; unsigned int __nusers; __extension__ union diff --git a/sysdeps/mips/nptl/bits/pthreadtypes.h b/sysdeps/mips/nptl/bits/pthreadtypes.h index 68ed94b..c7533a8 100644 --- a/sysdeps/mips/nptl/bits/pthreadtypes.h +++ b/sysdeps/mips/nptl/bits/pthreadtypes.h @@ -87,7 +87,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #if _MIPS_SIM == _ABI64 int __spins; diff --git a/sysdeps/nios2/nptl/bits/pthreadtypes.h b/sysdeps/nios2/nptl/bits/pthreadtypes.h index 76076d0..ee8b7ba 100644 --- a/sysdeps/nios2/nptl/bits/pthreadtypes.h +++ b/sysdeps/nios2/nptl/bits/pthreadtypes.h @@ -64,7 +64,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; unsigned int __nusers; __extension__ union diff --git a/sysdeps/s390/nptl/bits/pthreadtypes.h b/sysdeps/s390/nptl/bits/pthreadtypes.h index 40d10fe..21d13bd 100644 --- a/sysdeps/s390/nptl/bits/pthreadtypes.h +++ b/sysdeps/s390/nptl/bits/pthreadtypes.h @@ -86,7 +86,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #if __WORDSIZE == 64 # ifdef ENABLE_LOCK_ELISION diff --git a/sysdeps/sh/nptl/bits/pthreadtypes.h b/sysdeps/sh/nptl/bits/pthreadtypes.h index 13fbd73..5354f78 100644 --- a/sysdeps/sh/nptl/bits/pthreadtypes.h +++ b/sysdeps/sh/nptl/bits/pthreadtypes.h @@ -64,7 +64,7 @@ typedef union unsigned int __count; int __owner; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; unsigned int __nusers; __extension__ union diff --git a/sysdeps/sparc/nptl/bits/pthreadtypes.h b/sysdeps/sparc/nptl/bits/pthreadtypes.h index d45cb61..e781a25 100644 --- a/sysdeps/sparc/nptl/bits/pthreadtypes.h +++ b/sysdeps/sparc/nptl/bits/pthreadtypes.h @@ -87,7 +87,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #if __WORDSIZE == 64 int __spins; diff --git a/sysdeps/tile/nptl/bits/pthreadtypes.h b/sysdeps/tile/nptl/bits/pthreadtypes.h index 7d68650..b14b1c6 100644 --- a/sysdeps/tile/nptl/bits/pthreadtypes.h +++ b/sysdeps/tile/nptl/bits/pthreadtypes.h @@ -87,7 +87,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #if __WORDSIZE == 64 int __spins; diff --git a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h index 1a1779b..b7af038 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h @@ -63,7 +63,7 @@ typedef union int __owner; unsigned int __nusers; /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; int __spins; __pthread_list_t __list; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h index 345e79a..d230ac9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h @@ -87,7 +87,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #if __WORDSIZE == 64 short __spins; diff --git a/sysdeps/x86/bits/pthreadtypes.h b/sysdeps/x86/bits/pthreadtypes.h index 16b8f4f..c641a40 100644 --- a/sysdeps/x86/bits/pthreadtypes.h +++ b/sysdeps/x86/bits/pthreadtypes.h @@ -98,7 +98,7 @@ typedef union unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain - binary compatibility. */ + binary compatibility with static initializers. */ int __kind; #ifdef __x86_64__ short __spins;