This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Y2038 and C++ ABIs
- From: Ben Hutchings <ben dot hutchings at codethink dot co dot uk>
- To: Albert Aribaud <albert dot aribaud at 3adev dot fr>
- Cc: glibc development <libc-alpha at sourceware dot org>
- Date: Tue, 07 Nov 2017 18:31:32 +0000
- Subject: Y2038 and C++ ABIs
- Authentication-results: sourceware.org; auth=none
Albert, I reviewed the draft at
<https://sourceware.org/glibc/wiki/Y2038ProofnessDesign> and I see a
potential problem with the proposed type changes.
Suppose a C++ library has some function parameters whose types are
based on struct timespec or struct timeval. Those structure names will
be mangled into the function symbol names.
If the library is rebuilt on a 32-bit architecture with the updated
glibc, and it opts in to 64-bit time support, the symbol names change -
and that's good because the function's ABI really is changing.
However, if it's rebuilt and continues to use 32-bit time, it looks
like the symbol names might still change because struct timespec would
be an alias for struct timespec32. That would be very undesirable.
However, I'm not sure how you intended the type aliasing to be done.
Would struct timespec be a structure with identical layout to
timespec32/64 (which avoids this problem), or aliased through a #define
or some other means?
Ben.
--
Ben Hutchings
Software Developer, Codethink Ltd.