On Aug 1, 2021, at 08:11, Herby G wrote:
> 
> fluent-bit is failing to build on pretty much everything except Big Sur and 
> Catalina: https://ports.macports.org/port/fluent-bit/details/

You should file a bug report in Trac. :) I see you're one of the maintainers of 
the port but that's still the correct place to report build failures, and if 
you need help resolving it you can ask people on the list to view the bug 
report and comment there.


> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/mbedtls-2.26.0/library/cmac.c
> CC        lj_vmevent.o
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:40:5:
>  error: use of undeclared identifier 'clock_serv_t'
>     clock_serv_t cclock;
>     ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:41:5:
>  error: use of undeclared identifier 'mach_timespec_t'
>     mach_timespec_t mts;
>     ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:42:5:
>  warning: implicit declaration of function 'host_get_clock_service' is 
> invalid in C99 [-Wimplicit-function-declaration]
>     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
>     ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:42:28:
>  warning: implicit declaration of function 'mach_host_self' is invalid in C99 
> [-Wimplicit-function-declaration]
>     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
>                            ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:42:46:
>  error: use of undeclared identifier 'CALENDAR_CLOCK'
>     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
>                                              ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:42:63:
>  error: use of undeclared identifier 'cclock'
>     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
>                                                               ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:43:5:
>  warning: implicit declaration of function 'clock_get_time' is invalid in C99 
> [-Wimplicit-function-declaration]
>     clock_get_time(cclock, &mts);
>     ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:43:20:
>  error: use of undeclared identifier 'cclock'
>     clock_get_time(cclock, &mts);
>                    ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent
> -bit-1.8.3/lib/cmetrics/src/cmt_time.c:43:29: error: use of undeclared 
> identifier 'mts'
>     clock_get_time(cclock, &mts);
>                             ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:44:7:
>  error: member reference type 'struct timespec' is not a pointer; did you 
> mean to use '.'?
>     tm->tv_sec = mts.tv_sec;
>     ~~^~
>       .
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:44:18:
>  error: use of undeclared identifier 'mts'
>     tm->tv_sec = mts.tv_sec;
>                  ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:45:7:
>  error: member reference type 'struct timespec' is not a pointer; did you 
> mean to use '.'?
>     tm->tv_nsec = mts.tv_nsec;
>     ~~^~
>       .
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:45:19:
>  error: use of undeclared identifier 'mts'
>     tm->tv_nsec = mts.tv_nsec;
>                   ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:46:5:
>  warning: implicit declaration of function 'mach_port_deallocate' is invalid 
> in C99 [-Wimplicit-function-declaration]
>     mach_port_deallocate(mach_task_self(), cclock);
>     ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:46:26:
>  warning: implicit declaration of function 'mach_task_self' is invalid in C99 
> [-Wimplicit-function-declaration]
>     mach_port_deallocate(mach_task_self(), cclock);
>                          ^
> /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/fluent-bit-1.8.3/lib/cmetrics/src/cmt_time.c:46:44:
>  error: use of undeclared identifier 'cclock'; did you mean 'clock'?
>     mach_port_deallocate(mach_task_self(), cclock);
>                                            ^~~~~~
>                                            clock
> /usr/include/time.h:108:9: note: 'clock' declared here
> clock_t clock(void) __DARWIN_ALIAS(clock);
>         ^
> 5 warnings and 11 errors generated.
> make[2]: *** [lib/cmetrics/src/CMakeFiles/cmetrics-static.dir/cmt_time.c.o] 
> Error 1
> make[2]: Leaving directory 
> `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_sysutils_fluent-bit/fluent-bit/work/build'
> make[1]: *** [lib/cmetrics/src/CMakeFiles/cmetrics-static.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> 
> I think legacysupport was meant to address a lot of these clock definition 
> issues, but not sure why this is all failing now.  Anyone have any 
> suggestions?

legacysupport adds some (but not all) of the clock_gettime-related 
functionality that was added in macOS 10.12. Since you are seeing build 
failures on 10.14 and earlier, this is different.

clock_serv_t for example is defined on my High Sierra system in 
/usr/include/mach/mach_types.h. mach_port_deallocate is declared in 
/usr/include/mach/mach_port.h. mach_task_self is declared in 
/usr/include/mach/mach_init.h. Maybe this code just isn't including those 
headers, or whatever other system header that includes them is the canonical 
one to include to get this functionality. (I can't find Apple manpages for 
these functions, which would usually tell you what header you need to include.) 
Maybe on Catalina and later, coincidentally some other system header is now 
including it, which is why the build succeeds on newer systems.

Reply via email to