glibc/sysdeps
Adhemerval Zanella 5febe6a38f linux: Consolidate fxstat{64}
The LFS support is implemented on fxstat64.c, instead of fxstat.c for
64-bit architectures.  The fxstat.c implements the non-LFS and it is
a no-op for !XSTAT_IS_XSTAT64.

The generic non-LFS implementation handles two cases:

  1. New kABIs which uses generic pre 64-bit time Linux ABI (csky and
     nios): it issuess __NR_fstat64 plus handle the overflow on st_ino,
     st_size, or st_blocks.  It only handles _STAT_VER_KERNEL.

  2. Old KABIs with old non-LFS support (arm, i386, hppa, m68k,
     microblaze, s390, sh, powerpc, and sparc32).  For _STAT_VER_KERNEL
     it issues __NR_fstat, otherwise it calls __NR_fstat64 and convert
     to non-LFS stat struct and handle possible overflows on st_ino,
     st_size, or st_blocks.

Also non-LFS mips is an outlier and it has its own implementation since
_STAT_VER_LINUX requires a different conversion function (it uses the
kernel_stat as the sysissues argument since its exported ABI is
different than the kernel one for both non-LFS and LFS implementation).

The generic LFS implementation handles multiple cases:

  1. XSTAT_IS_XSTAT64 being 1:

    1.1. 64-bit kABI (aarch64, ia64, powerpc64*, s390x, riscv64, and
	 x86_64): it issuess __NR_fstat for _STAT_VER_KERNEL or
	 _STAT_VER_LINUX.

    1.2. Old 64-bit kABI with defines __NR_fstat64 instead of __NR_fstat
         (sparc64): it issues __NR_fstat for _STAT_VER_KERNEL or
         __NR_fstat64 and convert to struct stat64.

    1.3. New 32-bit kABIs with only 64-bit time_t support (arc and
	 riscv32): it issuess __NR_statx and covert to struct stat64.

  2. Old ABIs with XSTAT_IS_XSTAT64 being 0 (arm, csky, i386, hppa,
     m68k, microblaze, mips32, nios2, sh, powerpc32, and sparc32): it
     issues __NR_fstat64.

Also, two special cases requires specific implementations:

  1. alpha: it requires to handle _STAT_VER_KERNEL64 to issues
     __NR_fstat64 and use the kernel_stat with __NR_fstat otherwise.

  2. mips64: as for non-LFS implementation its ABIs differ from
     glibc exported one, which requires an specific conversion
     function to handle the kernel_stat.

Checked with a build for all affected ABIs. I also checked on x86_64,
i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-09-11 14:35:20 -03:00
..
aarch64 AArch64: Improve backwards memmove performance 2020-08-28 17:51:40 +01:00
alpha alpha: Use builtin sqrt{f} 2020-06-22 11:09:49 -03:00
arc ARC: Build Infrastructure 2020-07-10 16:08:45 -07:00
arm arm: remove string/tst-memmove-overflow XFAIL 2020-07-16 06:56:52 +02:00
csky semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
generic Linux: Remove rseq support 2020-07-16 17:55:35 +02:00
gnu signal: Move sys_errlist to a compat symbol 2020-07-07 14:10:58 -03:00
hppa dl-runtime: reloc_{offset,index} now functions arch overide'able 2020-06-05 13:45:46 -07:00
htl htl: Move cleanup handling to non-private libc-lock 2020-06-28 00:13:57 +00:00
hurd hurd: Fix build-many-glibcs.py 2020-07-13 14:25:03 -03:00
i386 Update i686 ulps. 2020-09-02 10:00:29 -04:00
ia64 ia64: Use generic exp10f 2020-06-19 12:08:52 -03:00
ieee754 math: Fix inaccuracy of j0f for x >= 2^127 when sin(x)+cos(x) is tiny 2020-08-07 16:33:13 -03:00
m68k m68k: Use sqrt{f} builtin for coldfire 2020-06-22 11:09:50 -03:00
mach hurd: define BSD 4.3 ioctls only under __USE_MISC 2020-08-27 13:36:32 +02:00
microblaze semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
mips mips: Use sqrt{f} builtin 2020-06-22 11:09:49 -03:00
nios2 Update Nios II libm-test-ulps file. 2020-08-03 01:42:48 -07:00
nptl nptl: futex: Provide correct indentation for part of __futex_abstimed_wait_cancelable64 2020-09-09 09:23:43 +02:00
posix Use LFS readdir in generic POSIX getcwd [BZ# 22899] 2020-09-02 09:16:05 -03:00
powerpc Update powerpc libm-test-ulps 2020-09-10 15:52:01 -03:00
pthread C11 threads: Fix inaccuracies in testsuite 2020-09-07 11:42:52 +02:00
riscv RISC-V: Build infrastructure for 32-bit port 2020-08-27 08:17:43 -07:00
s390 S390: Sync HWCAP names with kernel by adding aliases [BZ #25971] 2020-08-21 11:23:17 +02:00
sh semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
sparc sparc: Use sqrt{f} builtin 2020-06-22 11:09:49 -03:00
unix linux: Consolidate fxstat{64} 2020-09-11 14:35:20 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
x86 x86: Set CPU usable feature bits conservatively [BZ #26552] 2020-09-03 04:36:20 -07:00
x86_64 x86-64: Fix FMA4 detection in ifunc [BZ #26534] 2020-09-02 05:07:37 -07:00