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>