]> git.ipfire.org Git - thirdparty/kmod.git/commit
build: check for __xstat declarations
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 15 Sep 2024 00:40:14 +0000 (01:40 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 17 Sep 2024 03:01:35 +0000 (22:01 -0500)
commit0766f541927f50879599e62fdaa5a2e51b9791d3
treef439fd841b3b6dbaf0d724d271816ec2cbb2961d
parenta2396d385bbd86caaec1302f8ec69e746bd037c8
build: check for __xstat declarations

Currently we check the function is resolved at link time. Although what
we really care is if the headers are silently transposing any of our stat
calls to __xstat{,64}. If so, we'd want to wrap the latter functions.

As the now-removed comment says, glibc 2.33 was the first release to no
longer have static inline wrappers that do the transposition. See the
glibc commit 8ed005daf0ab ("Remove stat wrapper functions, move them to
exported symbols") for more details.

So change the checking to check_decl/has_header_symbol and keep them for
distributions with older glibc.

NOTE: to summarise/contrast this wrt the previous open64, etc
 - here: we had inline wrappers and declarations (as below)
 - others: no inline wrappers and optionally declarations

glibc 2.32
extern ... __xstat(); extern inline stat(...) { return __xstat(...); }

glibc 2.33
extern stat(...);

Note we group the 64 variant as well, since the codepath has been
identical (wrt core logic) to the normal __xstat().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/131
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
configure.ac
meson.build
testsuite/path.c