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: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "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 10:37:19 -0300
- Subject: Re: [PATCH 2/2] Move shared pthread definitions to common headers
- Authentication-results: sourceware.org; auth=none
- References: <AM5PR0802MB2610B0A4872A58D7AE8F3CBF83ED0@AM5PR0802MB2610.eurprd08.prod.outlook.com>
On 11/05/2017 09:19, Wilco Dijkstra wrote:
> Hi Adhemerval,
>
> This broke ARM builds using new GLIBC:
I will fix it.
>
> 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
>