Skip to content

Conversation

asheplyakov
Copy link

Before glibc 2.33 the stat family of functions (and mknod) used to be inline wrappers around calls to xstat, fxstat, lxstat, xmknod, which all take a leading version number argument designating the data structure and bits used. Thus with glibc < 2.33 libfakeroot needs to wrap only xstat, fxstat, xmknod only.

In glibc 2.33 inline wrapper functions have been removed. Instead libc.so.6 exports stat, stat64, etc symbols. xstat, fxstat, xmknod still exist (for compatibility reasons). Thus with glibc 2.33 and newer libfakeroot must wrap both stat (fstat, statat, fstatat, etc) and internal xstat (fxstat, etc) functions.

However some new architectures (such as LoongArch lp64d ABI) decided to be 64-bit only since the day 0 and don't use any wrappers. In this case libfakeroot should wrap only stat (statat, fstat, fstatat). A special care should be taken to avoid the double definition (via WRAP_STAT and anotherone under #if __GLIBC_PREREQ(2,33)).

Before glibc 2.33 the stat family of functions (and mknod)
used to be inline wrappers around calls to xstat, fxstat,
lxstat, xmknod, which all take a leading version number
argument designating the data structure and bits used.
Thus with glibc < 2.33 libfakeroot needs to wrap only xstat,
fxstat, xmknod only.

In glibc 2.33 inline wrapper functions have been removed.
Instead libc.so.6 exports stat, stat64, etc symbols.
xstat, fxstat, xmknod still exist (for compatibility reasons).
Thus with glibc 2.33 and newer libfakeroot must wrap both stat
(fstat, statat, fstatat, etc) and internal xstat (fxstat, etc)
functions.

However some new architectures (such as LoongArch lp64d ABI)
decided to be 64-bit only since the day 0 and don't use any wrappers.
In this case libfakeroot should wrap only stat (statat, fstat, fstatat).
A special care should be taken to avoid the double definition
(via WRAP_STAT and anotherone under #if __GLIBC_PREREQ(2,33)).
@yetist
Copy link

yetist commented Apr 25, 2023

I did a test on the LoongArch machine, and the test results are as follows:

$ uname -a
Linux archlinux 6.3.0-rc4-9 #1 SMP Mon, 17 Apr 2023 13:09:53 +0000 loongarch64 GNU/Linux
$ cat test/test-suite.log
========================================
   fakeroot 1.31: test/test-suite.log
========================================

# TOTAL: 13
# PASS:  13
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants