-
Notifications
You must be signed in to change notification settings - Fork 1.8k
MUSL can not compiles OpenZFS 2.3.2 because of S_IFMT
#17293
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
Comments
My PR propose: 0001-fix-musl-S_IFMT.patch: diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c
index 89939f6ef..0abb26d83 100644
--- a/tests/zfs-tests/cmd/statx.c
+++ b/tests/zfs-tests/cmd/statx.c
@@ -109,6 +109,9 @@ _statx(int fd, const char *path, int flags, unsigned int mask, void *stx)
#ifndef STATX_DIOALIGN
#define STATX_DIOALIGN (1<<13)
#endif
+#ifndef S_IFMT
+#define S_IFMT 0170000
+#endif
typedef struct {
int64_t tv_sec; I verified that this patch fix the MUSL compilation. Thoughts? |
Better way might be to define (afaict, |
Hello @robn , I can not find any GLIBC definition for |
No I mean: diff --git tests/zfs-tests/cmd/statx.c tests/zfs-tests/cmd/statx.c
index 89939f6efb..2917ea3997 100644
--- tests/zfs-tests/cmd/statx.c
+++ tests/zfs-tests/cmd/statx.c
@@ -22,6 +22,7 @@
* IN THE SOFTWARE.
*/
+#define _XOPEN_SOURCE
#include <stdint.h>
#include <stdio.h>
#include <string.h> |
Same error:
|
For the next patch, I got this another error (redefined statx with different arg types):
|
Yeah, your patch is the way to do it then. We can't include Would you like me to do a PR for this, or would you prefer to? |
Done at #17294 |
Nice, thank you for that :) |
Hello!
It's me again; that's means that a compiler does not compiles OpenZFS anymore. This time is MUSL compiling a test cmd from the commit 6503f8c (that was added to the
zfs-2.3.2
branch.zfs-2.3.1
works correctly for GLIBC, MUSL, and UCLIBC).Ps: UCLIBC is broken for another reason, I have no idea yet why.System information
Describe the problem you're observing
I saw that the test cmd (tests/zfs-tests/cmd/statx.c) includes some definitions safeguards, but it does not includes
S_IFMT
. From my view point there are two alternatives:#ifndef S_IFMT
as the others.#include <stat.h>
.Can someone propose a better solution?
Describe how to reproduce the problem
Try to compile openzfs-2.3.2 with musl.
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: