diff options
author | Zack Weinberg <zackw@panix.com> | 2019-02-19 08:45:22 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-01-08 12:52:49 -0500 |
commit | 9d8ecbbf117a1f3ddeb6b80a4e242d43a1f6d390 (patch) | |
tree | c5f0bfa9f64c2a880e7f08e477bcab55be6edd4c /sysdeps/powerpc/nofpu | |
parent | 6de42c53304928eb43ac2153a7b2bc6596e5ffdf (diff) | |
download | glibc-9d8ecbbf117a1f3ddeb6b80a4e242d43a1f6d390.tar.gz glibc-9d8ecbbf117a1f3ddeb6b80a4e242d43a1f6d390.tar.xz glibc-9d8ecbbf117a1f3ddeb6b80a4e242d43a1f6d390.zip |
Define register_t using bits/typesizes.h macros.
Currently register_t is, unlike all other types in sys/types.h, defined using a GCC extension (__attribute__((mode(word)))), falling back to ‘int’ if the extension is unavailable. This is a potential ABI compatibility hazard for people using non-GNU compilers with glibc. It’s also unnecessary; the bits/typesizes.h mechanism can handle all of the existing variation in the definition. In most cases, defining __REGISTER_T_TYPE as __SWORD_TYPE is sufficient. Special handling is necessary for MIPS n32 and x86-64 x32, where __SWORD_TYPE is ‘int’ and the appropriate type for register_t is ‘long long’. Unfortunately, this means we need to create a new bits/typesizes.h variant for linux/mips. This variant is based on the top-level bits/typesizes.h, not linux/generic/bits/typesizes.h, to match the existing MIPS ABIs. Tested using build-many-glibcs. The c++-types test confirms that the physical type of register_t does not change on any supported platform. * posix/sys/types.h: Typedef register_t as __register_t. * posix/bits/types.h: Typedef __register_t using __REGISTER_T_TYPE. * bits/typesizes.h * sysdeps/mach/hurd/bits/typesizes.h * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h * sysdeps/unix/sysv/linux/generic/bits/typesizes.h * sysdeps/unix/sysv/linux/s390/bits/typesizes.h * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: Define __REGISTER_T_TYPE as __SWORD_TYPE. * sysdeps/unix/sysv/linux/mips/bits/typesizes.h: New file (copied from bits/typesizes.h). Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and n64 ABIs. Define __REGISTER_T_TYPE as __SQUAD_TYPE for n32. * sysdeps/unix/sysv/linux/x86/bits/typesizes.h: Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and 64-bit ABIs. Define __REGISTER_T_TYPE as __SQUAD_TYPE for x32.
Diffstat (limited to 'sysdeps/powerpc/nofpu')
0 files changed, 0 insertions, 0 deletions