Opened 4 years ago

Closed 3 years ago

#62067 closed defect (fixed)

libfido2: please provide an implementation of clock_gettime() for your platform

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: trodemaster (Blake Garner)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: libfido2

Description

https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/35408/steps/install-port/logs/stdio

#error "please provide an implementation of clock_gettime() for your platform"
 ^
1 error generated.

This likely affects El Capitan and earlier.

Using the legacysupport portgroup could provide such an implementation, or maybe libfido2 already contains some compatibility implementation that could be used.

Change History (12)

comment:1 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:2 Changed 4 years ago by trodemaster (Blake Garner)

Ok I'll have a look at this one. This is newer software and likely never worked on the older platforms. I'll need to review legacysupport as I'm not yet familiar with it as well.

Thanks, Blake

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

They have a compatibility implementation of clock_gettime in their code:

https://github.com/Yubico/libfido2/blob/master/openbsd-compat/clock_gettime.c

So since they're willing to support older non-clock_gettime-having systems, the best thing would be to fix their build system so that it uses their compatibility implementation on any systems where it's needed.

comment:4 Changed 4 years ago by trodemaster (Blake Garner)

I setup a 10.8 vm today to have a look at this. This build log output also mentions openbsd-compat/clock_gettime.c .

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.6.0/openbsd-compat/clock_gettime.c:29:2: error: "please provide an implementation of clock_gettime() for your platform"
:info:build #error "please provide an implementation of clock_gettime() for your platform"
:info:build  ^
:info:build 1 error generated.
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/build'
:info:build make[1]: *** [examples/CMakeFiles/setpin.dir/all] Error 2
:info:build make[2]: *** [examples/CMakeFiles/reset.dir/__/openbsd-compat/clock_gettime.c.o] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....

I'll open an issue on the libfido2 repo and see if the existing compat options can be reused.

comment:5 Changed 4 years ago by kencu (Ken)

their fallback is for windows, but the one we wrote up for legacysupport is very similar

comment:6 Changed 4 years ago by trodemaster (Blake Garner)

I have submitted an upstream issue. https://github.com/Yubico/libfido2/issues/267

Stopped short of suggesting they import https://github.com/macports/macports-legacy-support/blob/master/src/time.c and build with that for the older targets.

comment:7 Changed 4 years ago by trodemaster (Blake Garner)

Upstream ticket closed with this message "1.6.0 won't work on POSIX-like systems that lack clock_gettime(). The good news is that 1.5.0 should work, and future releases of libfido2 as well." I'll have a look at using legacysupport until their next release.

comment:8 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy removed

comment:9 Changed 3 years ago by trodemaster (Blake Garner)

I have re-tested with the 1.8 version of libfido2 that was just updated. The port is now failing differently on my 10.8.5 test VM.

https://gist.github.com/trodemaster/8a430dfd5874333c79297a96f450fe5c

:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/build/src && /usr/bin/clang -DHAVE_ARC4RANDOM_BUF -DHAVE_CBOR_H -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_OPENSSLV_H -DHAVE_READPASSPHRASE -DHAVE_SIGACTION -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_SYSCONF -DHAVE_UNISTD_H -DSIGNAL_EXAMPLE -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=8 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.8.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -Os -DNDEBUG -I/opt/local/include -arch x86_64 -mmacosx-version-min=10.8 -fPIC -Wall -Wextra -Werror -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -pedantic -pedantic-errors -Wshorten-64-to-32 -fstack-protector-all -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.8.0/openbsd-compat/explicit_bzero.c
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/build'
:info:build make[1]: *** [src/CMakeFiles/fido2_shared.dir/all] Error 2
:info:build make[1]: *** Waiting for unfinished jobs....
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_security_libfido2/libfido2/work/libfido2-1.8.0/openbsd-compat/explicit_bzero.c:34:54: error: use of undeclared identifier 'bzero'
:info:build static void (* volatile ssh_bzero)(void *, size_t) = bzero;
:info:build                                                      ^
:info:build 1 error generated.
:info:build make[2]: *** [src/CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero.c.o] Error 1

Last edited 3 years ago by trodemaster (Blake Garner) (previous) (diff)

comment:11 Changed 3 years ago by trodemaster (Blake Garner)

Thanks for the hint Ken!

On this system I see the file strings.h in a few locations but /opt/local/include/LegacySupport/strings.h looks like the one it should be picking up.

Latest build fail log shows that path is included at build time. https://gist.github.com/trodemaster/c8d7f924092d144568cb09b878b7eb3c#file-libfido_buildfail-log-L36

I also attempted to specify the strings.h that is included with cbor as that is a port requirement without any luck. https://github.com/trodemaster/blakeports/blob/libfido2/security/libfido2/Portfile#L29

comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 355a13f7de12c80124e7ae062c24188dd66d1d01/macports-ports (master):

libfido2: Use legacy support for clock_gettime

Closes: #62067

Note: See TracTickets for help on using tickets.