openwrt/tools/fakeroot/patches
Michael Pratt f864b83b1d tools/fakeroot: fix check for whether to wrap time64 functions
Fakeroot uses an egrep configure check to look for the string "time64"
within a preprocessed include of the sys/stat.h header
in order to decide whether or not to create declarations
and internal functions used for wrapping the native functions
stat64_time64 fstat64_time64 lstat64_time64 and fstatat64_time64.

On specific older versions of glibc these functions are not included,
but there are some references to "time64" unrelated to functions,
like aliasing the time64_t typedef to the standard time_t typedef
when the size of a word is 64 bits or defining it if not.

In this case, a grep for "stat64"
of the preprocessed sys/stat.h header matches nothing,
however, the grep for "time64" in the configure check
of the preprocessed sys/stat.h header matches a line
that has nothing to do with the functions
that will be wrapped as a result of successful matching.

  __extension__ typedef __int64_t __time64_t;

This causes the attempt to wrap the functions to occur,
which fails due to some of the corresponding macros being empty
since the native declarations they are based on do not exist,
causing a common error claiming that a part of the syntax is missing.

  error: expected '=', ',', ';', 'asm' or '__attribute__' before ...

Fix this by making the testing regular expression more complex
in order to match actual function names ending in "_time64"
with or without a set of preceding underscores, but none after.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15773
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-22 20:42:45 +02:00
..
000-relocatable.patch tools/fakeroot: update to 1.25.3 2021-01-05 08:59:31 -10:00
200-disable-doc.patch tools/fakeroot: update to 1.33 2024-06-18 23:02:17 +02:00
300-time64-hack.patch tools/fakeroot: fix check for whether to wrap time64 functions 2024-06-22 20:42:45 +02:00
400-alpine-libc.musl-fix.patch tools/fakeroot: update to 1.29 2022-09-07 04:22:40 +01:00
600-macOS.patch tools/fakeroot: update to 1.33 2024-06-18 23:02:17 +02:00