Match Ada and C timespec on 32-bit big-endian
Ensures consistency between Ada and C `timespec` structures on specific platforms.
This change ensures that the Ada representation of the timespec structure matches its C counterpart on 32-bit big-endian systems, specifically addressing issues on Glibc platforms. A bug in gcc/ada/s-oscons-tmplt.c caused an incorrect size calculation for SIZEOF_tv_nsec when targeting these architectures. This adjustment aligns the structures, preventing potential data corruption or incorrect time handling in Ada programs that interface with C time functions.
In Details
For the Ada front-end, this commit rectifies an issue (PR ada/114065) related to the timespec structure's size on 32-bit big-endian Glibc platforms. The definition of SIZEOF_tv_nsec in gcc/ada/s-oscons-tmplt.c was adjusted to correctly account for the alignment and padding rules on these specific architectures, ensuring that the Ada timespec aggregate accurately reflects the layout of the C struct timespec. This maintains ABI compatibility and correct data interpretation for time-related system calls.
- timespec
- A structure commonly used in POSIX systems to represent time, typically containing seconds and nanoseconds components.
- 32-bit big-endian
- An architecture where data is stored in 32-bit words, and the most significant byte of a word is stored at the lowest memory address.
- ABI
- Application Binary Interface. Defines how low-level code (like compiled C or Ada) interacts with the operating system and hardware, including data structure layouts and calling conventions.