Build mbuffer on Monterey?

All your general support questions for OpenZFS on OS X.

Build mbuffer on Monterey?

Postby zandr » Mon Jan 31, 2022 9:04 pm

I just tried building mbuffer from lundman's tarball, and am having difficulty.
I'm running on Monterey (12.1), on an M1 Mini.

configure looked fine aside from not finding mt and not finding an MD5 library.

Code: Select all
 % make
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I.   -c -o log.o log.c
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I.   -c -o network.o network.c
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I.   -c -o mbuffer.o mbuffer.c
mbuffer.c:65:3: warning: sendfile is unable to send from buffers [-W#warnings]
        #warning sendfile is unable to send from buffers
         ^
In file included from mbuffer.c:211:
./mbuffer_darwin.h:22:10: warning: incompatible pointer to integer conversion assigning to 'sem_t' (aka 'int') from 'sem_t *' (aka 'int *'); dereference with * [-Wint-conversion]
    *sem = sem_open(fname, O_CREAT, 0600, value);
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           *
./mbuffer_darwin.h:36:21: warning: incompatible integer to pointer conversion passing 'sem_t' (aka 'int') to parameter of type 'sem_t *' (aka 'int *'); remove * [-Wint-conversion]
    return sem_wait(*sem);
                    ^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:60:21: note: passing argument to parameter here
int sem_wait(sem_t *) __DARWIN_ALIAS_C(sem_wait);
                    ^
In file included from mbuffer.c:211:
./mbuffer_darwin.h:41:21: warning: incompatible integer to pointer conversion passing 'sem_t' (aka 'int') to parameter of type 'sem_t *' (aka 'int *'); remove * [-Wint-conversion]
    return sem_post(*sem);
                    ^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:57:21: note: passing argument to parameter here
int sem_post(sem_t *);
                    ^
In file included from mbuffer.c:211:
./mbuffer_darwin.h:54:19: error: static declaration of 'clock_gettime' follows non-static declaration
static inline int clock_gettime(unsigned long int id, struct timespec *ts)
                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:178:5: note: previous declaration is here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
    ^
In file included from mbuffer.c:211:
./mbuffer_darwin.h:70:23: error: typedef redefinition with different types ('unsigned long' vs 'enum clockid_t')
typedef unsigned long clockid_t;
                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:172:3: note: previous definition is here
} clockid_t;
  ^
In file included from mbuffer.c:211:
./mbuffer_darwin.h:71:9: warning: 'CLOCK_REALTIME' macro redefined [-Wmacro-redefined]
#define CLOCK_REALTIME 0
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:155:9: note: previous definition is here
#define CLOCK_REALTIME _CLOCK_REALTIME
        ^
mbuffer.c:356:15: warning: cast to smaller integer type 'unsigned int' from 'void *' [-Wvoid-pointer-to-int-cast]
        unsigned t = (unsigned) timeout;
                     ^~~~~~~~~~~~~~~~~~
mbuffer.c:760:19: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
                                        pthread_exit((void *) in);
                                                     ^~~~~~~~~~~
mbuffer.c:761:12: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
                                return (void *) in;
                                       ^~~~~~~~~~~
mbuffer.c:858:15: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        pthread_exit((void *) ret);
                     ^~~~~~~~~~~~
mbuffer.c:1165:15: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        pthread_exit((void *)status);
                     ^~~~~~~~~~~~~~
mbuffer.c:2100:19: warning: incompatible function pointer types assigning to 'void (*)(int, struct __siginfo *, void *)' from 'void (*)(int)' [-Wincompatible-function-pointer-types]
        sig.sa_sigaction = SIG_IGN;
                         ^ ~~~~~~~
11 warnings and 2 errors generated.
make: *** [mbuffer.o] Error 1


Any suggestions would be appreciated.

Thanks!
zandr
 
Posts: 10
Joined: Thu Mar 19, 2020 6:19 am

Re: Build mbuffer on Monterey?

Postby lundman » Tue Feb 01, 2022 2:34 am

The first error is:

./mbuffer_darwin.h:54:19: error: static declaration of 'clock_gettime' follows non-static declaration


in monterey and newer, has clock_gettime() built in now, so it doesnt need that extra work.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Build mbuffer on Monterey?

Postby _max_ » Sun Feb 12, 2023 8:57 pm

Just following up on this post.

Zandar...any success with the mbuffer compile on M1? Was looking to also utilize w/ zfs-autobackup. Not many mbuffer posts out there in general in recent history re MacOS.
_max_
 
Posts: 5
Joined: Fri Feb 10, 2023 4:24 am


Return to General Help

Who is online

Users browsing this forum: No registered users and 17 guests