This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Move shared pthread definitions to common headers
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "adhemerval dot zanella at linaro dot org" <adhemerval dot zanella at linaro dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: "triegel at redhat dot com" <triegel at redhat dot com>, nd <nd at arm dot com>
- Date: Thu, 11 May 2017 12:19:42 +0000
- Subject: Re: [PATCH 2/2] Move shared pthread definitions to common headers
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi Adhemerval,
This broke ARM builds using new GLIBC:
diff --git a/sysdeps/arm/nptl/bits/pthreadtypes-arch.h b/sysdeps/arm/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000..8333acb
--- /dev/null
+++ b/sysdeps/arm/nptl/bits/pthreadtypes-arch.h
+struct __pthread_rwlock_arch_t
+{
+ unsigned int __readers;
+ unsigned int __writers;
+ unsigned int __wrphase_futex;
+ unsigned int __writers_futex;
+ unsigned int __pad3;
+ unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned char __pad1;
+ unsigned char __pad2;
+ unsigned char __shared;
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+#else
+ /* FLAGS must stay at this position in the structure to maintain
+ binary compatibility. */
+ unsigned char __flags;
+ unsigned char __shared;
+ unsigned char __pad1;
+ unsigned char __pad2;
+#endif
+ int __cur_writer;
+} __data;
This defines a global __data whenever this header is included:
native-glibc-arm-none-linux-gnueabihf/build/src/gcc/gcc/read-md.h:315: multiple definition of `__data'
build/genconstants.o:native-glibc-arm-none-linux-gnueabihf/build/src/gcc/gcc/genconstants.c:40: first defined here
I think HPPA has the same issue:
grep __data sysdeps/*/nptl/bits/pthreadtypes-arch.h
sysdeps/arm/nptl/bits/pthreadtypes-arch.h:} __data;
sysdeps/hppa/nptl/bits/pthreadtypes-arch.h:} __data;
Wilco