[GH-ISSUE #276] Compile for OS X 10.10 using clang 7.0 fails #141

Closed
opened 2026-03-04 01:42:33 +03:00 by kerem · 3 comments
Owner

Originally created by @tildeleb on GitHub (Oct 4, 2015).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/276

Has anyone compiled this on OS X recently? I tried using clang 7.0 from Xcode 7.0 running under 10.10 and got the following errors.

  1. In fuse.c OS X has no <sys/statfs.h> for struct statfs. That structure is located in <sys/mount.h>.

  2. After updating some fields in struct statfs don't exist and the errors are:

    fuse.c:1535:29: error: no member named 'f_namelen' in 'struct statfs'
            stbuf->f_namemax = oldbuf->f_namelen;
                               ~~~~~~  ^
    fuse.c:2439:9: error: unknown type name 'clockid_t'; did you mean 'clock_t'?
            static clockid_t clockid = CLOCK_MONOTONIC;
                   ^~~~~~~~~
                   clock_t
    /usr/include/sys/_types/_clock_t.h:30:33: note: 'clock_t' declared here
    typedef __darwin_clock_t        clock_t;
                                    ^
    fuse.c:2439:29: error: use of undeclared identifier 'CLOCK_REALTIME'
            static clockid_t clockid = CLOCK_MONOTONIC;
                                       ^
    fuse.c:2434:25: note: expanded from macro 'CLOCK_MONOTONIC'
    #define CLOCK_MONOTONIC CLOCK_REALTIME
                            ^
    fuse.c:2440:12: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
            int res = clock_gettime(clockid, now);
                      ^
    fuse.c:2442:13: error: use of undeclared identifier 'CLOCK_REALTIME'
                    clockid = CLOCK_REALTIME;
    
Originally created by @tildeleb on GitHub (Oct 4, 2015). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/276 Has anyone compiled this on OS X recently? I tried using clang 7.0 from Xcode 7.0 running under 10.10 and got the following errors. 1. In `fuse.c` OS X has no `<sys/statfs.h>` for `struct statfs`. That structure is located in `<sys/mount.h>`. 2. After updating some fields in `struct statfs` don't exist and the errors are: ``` fuse.c:1535:29: error: no member named 'f_namelen' in 'struct statfs' stbuf->f_namemax = oldbuf->f_namelen; ~~~~~~ ^ fuse.c:2439:9: error: unknown type name 'clockid_t'; did you mean 'clock_t'? static clockid_t clockid = CLOCK_MONOTONIC; ^~~~~~~~~ clock_t /usr/include/sys/_types/_clock_t.h:30:33: note: 'clock_t' declared here typedef __darwin_clock_t clock_t; ^ fuse.c:2439:29: error: use of undeclared identifier 'CLOCK_REALTIME' static clockid_t clockid = CLOCK_MONOTONIC; ^ fuse.c:2434:25: note: expanded from macro 'CLOCK_MONOTONIC' #define CLOCK_MONOTONIC CLOCK_REALTIME ^ fuse.c:2440:12: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] int res = clock_gettime(clockid, now); ^ fuse.c:2442:13: error: use of undeclared identifier 'CLOCK_REALTIME' clockid = CLOCK_REALTIME; ```
kerem closed this issue 2026-03-04 01:42:33 +03:00
Author
Owner

@gaul commented on GitHub (Oct 4, 2015):

@flandr Could you look at this?

<!-- gh-comment-id:145320708 --> @gaul commented on GitHub (Oct 4, 2015): @flandr Could you look at this?
Author
Owner

@RobbKistler commented on GitHub (Oct 4, 2015):

@tildeleb Those compiler errors are from fuse, not s3fs-fuse. I've been able to build s3fs-fuse on OS X 10.11, but haven't tested yet because of the signed kext issue

I installed osxfuse with Homebrew, along with the other s3fs-fuse build dependencies:

brew install Caskroom/cask/osxfuse
brew install libxml2 openssl auotmake curl  pkg-config 
brew link libxml2 openssl 
<!-- gh-comment-id:145369044 --> @RobbKistler commented on GitHub (Oct 4, 2015): @tildeleb Those compiler errors are from fuse, not s3fs-fuse. I've been able to build s3fs-fuse on OS X 10.11, but haven't tested yet because of the [signed kext issue](https://github.com/osxfuse/osxfuse/issues/150) I installed osxfuse with [Homebrew](http://brew.sh), along with the other s3fs-fuse build dependencies: ``` brew install Caskroom/cask/osxfuse brew install libxml2 openssl auotmake curl pkg-config brew link libxml2 openssl ```
Author
Owner

@tildeleb commented on GitHub (Oct 4, 2015):

Sorry, the dependency pushdown list got me and I posted to the wrong place. I do try to compile everything from source and not depend on projects like brew and macports.

<!-- gh-comment-id:145380493 --> @tildeleb commented on GitHub (Oct 4, 2015): Sorry, the dependency pushdown list got me and I posted to the wrong place. I do try to compile everything from source and not depend on projects like brew and macports.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#141
No description provided.