-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
‘stat_t’ {aka ‘struct stat’} has no member named ‘st_mtim’; #1872
Comments
Fascinating! POSIX 2008 demands that these fields are present (source). This code is guarded by a macro guard that more or less checks that |
In util.c, I threw in #include <boost/preprocessor/stringize.hpp> and it gives me 200809L |
#include <boost/preprocessor/stringize.hpp> |
Ok, that suggests that either something about your build environment is incorrectly defining |
Yes, tried make and cmake So I tried throwing in |
So @lancethepants, I'm not really sure how best to resolve this issue. It sounds like your environment is straight up lying about complying with POSIX 2008. I'm not opposed to including a workaround that detects this quirk, but I'm not sure what that would be. Is it sufficient for your purposes to just perform the workaround you found manually? Do you want us to include a fix for this? |
I'll just do my manual workaround. |
Sorry to re-open this, @lancethepants where did you add the Thanks. |
@borice
|
@borice, we had another report of this issue in #1897, which resulted in reverting the change that introduced this. So you could build off of the (Going forward, we're working to bring back the use of |
The changes in #1920 worked for me - thank you! |
Hi, I have the original problem when using uclibc-ng on both x86 and amd64. I still see the issue using zstd-1.4.5. My investigation into this leads me to think the root cause (at least for uclibc-ng) is a difference in define used to enable the st_mtim macros in <bits/stat.h>. In glibc it's enough to:
Which in turn defines __USE_XOPEN2K8 However, in uclibc-ng (and this may be a bug/misfeature), we need to define __USE_MISC (or _BSD_SOURCE, which triggers __USE_MISC to be defined as a side effect). The following patch to zstd should resolve compilation under uclibc-ng. I can't see that it will cause issues with other platforms - seems safe? Could you please consider accepting upstream:
|
Sure @ewildgoose , the proposed patch looks safe enough. |
reported and suggested by @ewildgoose (#1872)
Coming on this issue when compiling v1.4.4. Did not experience this issue in v1.4.3.
util.c: In function ‘UTIL_setFileStat’:
util.c:76:31: error: ‘stat_t’ {aka ‘struct stat’} has no member named ‘st_mtim’; did you mean ‘st_mtime’?
76 | timebuf[1] = statbuf->st_mtim;
| ^~~~~~~
| st_mtime
: recipe for target 'util.o' failed
arm architecture
kernel 2.6.36.4
uclibc-ng 1.0.32
The text was updated successfully, but these errors were encountered: