Opened 7 months ago

Last modified 3 weeks ago

#68333 assigned defect

libfido2 @1.13.0: error: use of undeclared identifier 'id'

Reported by: barracuda156 Owned by: trodemaster (Blake Garner)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: snowleopard lion mountainlion mavericks yosemite elcapitan Cc:
Port: libfido2

Description

[ 32%] Generating fido_cbor_info_new.3.lint
cd /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_libfido2/libfido2/work/build/man && mandoc -T lint -W warning fido_cbor_info_new.3 > fido_cbor_info_new.3.lint
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:189:59: error: use of undeclared identifier 'id'
        if (asprintf(&path, "%s%llu", IOREG, (unsigned long long)id) == -1) {
                                                                 ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:195:10: error: address of stack memory associated with local variable 'path' returned [-Werror,-Wreturn-stack-address]
        return (path);
                ^~~~
2 errors generated.
make[2]: *** [src/CMakeFiles/fido2_shared.dir/hid_osx.c.o] Error 1

See: https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/233997/steps/install-port/logs/stdio https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/169298/steps/install-port/logs/stdio

Change History (18)

comment:1 in reply to:  description ; Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: snowleopard lion mountainlion mavericks yosemite elcapitan added
Summary: libfido2 fails to build with clang on 10.11 and earlier: error: use of undeclared identifier 'id'libfido2 @1.13.0: error: use of undeclared identifier 'id'

Replying to barracuda156:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:189:59: error: use of undeclared identifier 'id'
        if (asprintf(&path, "%s%llu", IOREG, (unsigned long long)id) == -1) {
                                                                 ^

Weird. id is declared on line 173:

        uint64_t         id;

And it is used on line 181 apparently without complaint:

        if (IORegistryEntryGetRegistryEntryID(s, &id) != KERN_SUCCESS) {

Why then would it think on line 189 that it's undeclared?

        if (asprintf(&path, "%s%llu", IOREG, (unsigned long long)id) == -1) {
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:195:10: error: address of stack memory associated with local variable 'path' returned [-Werror,-Wreturn-stack-address]
        return (path);
                ^~~~

That doesn't seem accurate either. path is a pointer to a string:

        char            *path;

Memory is allocated on the heap (not the stack) by calling asprintf and assigned to that pointer:

        if (asprintf(&path, "%s%llu", IOREG, (unsigned long long)id) == -1) {

It is not returning the address of stack memory. It is returning the address of the allocated heap memory:

        return (path);

Since it builds fine on macOS 10.12 (clang 900) and later and is failing on OS X 10.11 (clang 800) and earlier, maybe earlier clangs had some bug that's being exposed here. Try using a newer MacPorts clang compiler. If that works, maybe we'll just have to blacklist Apple clang < 900.

You said in comment:ticket:64833:5 that you got it to compile on PowerPC but that you had to comment out some functions in this file, but you didn't mention which functions. Was it these same functions?

comment:2 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Oh, on 10.6 it's already using MacPorts clang 11, which is much newer than Apple clang 900. So maybe the problem is somehow caused by older macOS SDKs. We do have newer SDKs available in the subports of the MacOSX.sdk port if you want to try that.

comment:3 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Wait! I was looking at the code as shipped from its developers. The problems are being caused by changes you made to a port patchfile in [4a07ecdbb1289bb241d36f264f0825697d9f7fdf/macports-ports] that's only applied on 10.11 and earlier.

Last edited 7 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 in reply to:  3 ; Changed 7 months ago by barracuda156

Replying to ryandesign:

Wait! I was looking at the code as shipped from its developers. The problems are being caused by changes you made to a port patchfile in [4a07ecdbb1289bb241d36f264f0825697d9f7fdf/macports-ports] that's only applied on 10.11 and earlier.

I certainly did not intend to break Intel systems and should have made changes conditional. Have you spotted the error? Does it build fine without the patch on systems where it presently fails?

comment:5 Changed 7 months ago by barracuda156

I do not recall what was the reason for 10.11 threshold. We can make the patch powerpc-only.

comment:6 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

The patch doesn't look correct on any system. The only reason why it doesn't prevent building on PowerPC is that only on PowerPC you're disabling -Werror but I suspect that on PowerPC you would still see warnings that what you're doing in that patch is not proper.

comment:7 in reply to:  4 ; Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

Have you spotted the error?

Well, there are several obvious errors. The code uses id but you removed its definition, which caused the first error. And the function wants to return a char * and you changed it into an io_string_t which caused the second error.

Does it build fine without the patch on systems where it presently fails?

I have not tested. Since you're reporting the problem I expected you might test possible fixes.

comment:8 in reply to:  7 Changed 7 months ago by barracuda156

Replying to ryandesign:

I have not tested. Since you're reporting the problem I expected you might test possible fixes.

Sure, give me a few days, I will fix that. I am pretty sure that the reason for changes were actual failures of existing code (I won’t patch just for fun, lol), and perhaps I used an earlier code as a source. But something went wrong, obviously, and should be fixed.

comment:9 in reply to:  1 ; Changed 7 months ago by jasperweiss (Jasper Weiss)

Replying to ryandesign:

Since it builds fine on macOS 10.12 (clang 900) and later and is failing on OS X 10.11 (clang 800) and earlier, maybe earlier clangs had some bug that's being exposed here. Try using a newer MacPorts clang compiler. If that works, maybe we'll just have to blacklist Apple clang < 900.

I just ran into this (I think). You mentioned it should be working on MacOS 10.12 and later but I'm on 10.14 and it's failing. I do have mp-clang-17 selected for clang but I'm not sure if it's really using that. How do I check? (I have clang_select installed too, in case that matters).

I'm getting an error related to an undeclared identifier 'kIOMainPortDefault' rather than 'id', is this a different issue?

: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.13.0/src/hid_osx.c:384:35: 
error: use of undeclared identifier 'kIOMainPortDefault'
:info:build                 return (IORegistryEntryFromPath(kIOMainPortDefault, path));
:info:build Exit code: 2

comment:10 in reply to:  9 ; Changed 7 months ago by barracuda156

Replying to jasperweiss:

Replying to ryandesign:

Since it builds fine on macOS 10.12 (clang 900) and later and is failing on OS X 10.11 (clang 800) and earlier, maybe earlier clangs had some bug that's being exposed here. Try using a newer MacPorts clang compiler. If that works, maybe we'll just have to blacklist Apple clang < 900.

I just ran into this (I think). You mentioned it should be working on MacOS 10.12 and later but I'm on 10.14 and it's failing. I do have mp-clang-17 selected for clang but I'm not sure if it's really using that. How do I check? (I have clang_select installed too, in case that matters).

I'm getting an error related to an undeclared identifier 'kIOMainPortDefault' rather than 'id', is this a different issue?

: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.13.0/src/hid_osx.c:384:35: 
error: use of undeclared identifier 'kIOMainPortDefault'
:info:build                 return (IORegistryEntryFromPath(kIOMainPortDefault, path));
:info:build Exit code: 2

Well, if it is on a system where my patch is not applied, it cannot possibly be the same issue :) If we are to believe buildbots (which are supposed to use standard Macports set-up), all systems 10.12 up were good at the time of last port update: https://ports.macports.org/port/libfido2/details

comment:11 Changed 7 months ago by barracuda156

I will update sequentially.

  1. If I just drop the hid_osx patch, build fails on:
    :info:build [  8%] Building C object src/CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero_win32.c.o
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/src && /opt/local/bin/gcc-mp-13 -DHAVE_ARC4RANDOM_BUF -DHAVE_ASPRINTF -DHAVE_CBOR_H -DHAVE_CLOCK_GETTIME -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_OPENSSLV_H -DHAVE_POSIX_IOCTL -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRSEP -DHAVE_SYSCONF -DHAVE_UNISTD_H -DOPENSSL_API_COMPAT=0x10100000L -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=13 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -Wimplicit-fallthrough -pedantic -pedantic-errors -fstack-protector-all -Wno-unused-result -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero_win32.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero_win32.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/explicit_bzero_win32.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/openbsd-compat/explicit_bzero_win32.c
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c: In function 'get_path':
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:176:18: error: implicit declaration of function 'IOHIDDeviceGetService'; did you mean 'IOHIDDeviceGetReport'? [-Wimplicit-function-declaration]
    :info:build   176 |         if ((s = IOHIDDeviceGetService(dev)) == MACH_PORT_NULL) {
    :info:build       |                  ^~~~~~~~~~~~~~~~~~~~~
    :info:build       |                  IOHIDDeviceGetReport
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:176:18: warning: conversion to 'io_service_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion]
    :info:build [  8%] Building C object src/CMakeFiles/fido2.dir/__/openbsd-compat/freezero.c.o
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/src && /opt/local/bin/gcc-mp-13 -DHAVE_ARC4RANDOM_BUF -DHAVE_ASPRINTF -DHAVE_CBOR_H -DHAVE_CLOCK_GETTIME -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_OPENSSLV_H -DHAVE_POSIX_IOCTL -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRSEP -DHAVE_SYSCONF -DHAVE_UNISTD_H -DOPENSSL_API_COMPAT=0x10100000L -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=13 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -Wimplicit-fallthrough -pedantic -pedantic-errors -fstack-protector-all -Wno-unused-result -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/freezero.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/freezero.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/freezero.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/openbsd-compat/freezero.c
    :info:build [  8%] Generating fido_assert_blob_len.3
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/man && ln -sf fido_assert_new.3 fido_assert_blob_len.3
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:181:13: error: implicit declaration of function 'IORegistryEntryGetRegistryEntryID'; did you mean 'IORegistryEntryGetParentEntry'? [-Wimplicit-function-declaration]
    :info:build   181 |         if (IORegistryEntryGetRegistryEntryID(s, &id) != KERN_SUCCESS) {
    :info:build       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    :info:build       |             IORegistryEntryGetParentEntry
    :info:build [  8%] Building C object src/CMakeFiles/fido2.dir/__/openbsd-compat/recallocarray.c.o
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/src && /opt/local/bin/gcc-mp-13 -DHAVE_ARC4RANDOM_BUF -DHAVE_ASPRINTF -DHAVE_CBOR_H -DHAVE_CLOCK_GETTIME -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_OPENSSLV_H -DHAVE_POSIX_IOCTL -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRSEP -DHAVE_SYSCONF -DHAVE_UNISTD_H -DOPENSSL_API_COMPAT=0x10100000L -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=13 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -Wimplicit-fallthrough -pedantic -pedantic-errors -fstack-protector-all -Wno-unused-result -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/recallocarray.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/recallocarray.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/recallocarray.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/openbsd-compat/recallocarray.c
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c: In function 'fido_hid_manifest':
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:260:13: error: 'kIOHIDManagerOptionNone' undeclared (first use in this function); did you mean 'IOHIDManagerOpen'?
    :info:build   260 |             kIOHIDManagerOptionNone)) == NULL) {
    :info:build       |             ^~~~~~~~~~~~~~~~~~~~~~~
    :info:build       |             IOHIDManagerOpen
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:260:13: note: each undeclared identifier is reported only once for each function it appears in
    :info:build [  8%] Generating fido_assert_blob_ptr.3
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/man && ln -sf fido_assert_new.3 fido_assert_blob_ptr.3
    :info:build [  8%] Building C object src/CMakeFiles/fido2.dir/__/openbsd-compat/strlcat.c.o
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/src && /opt/local/bin/gcc-mp-13 -DHAVE_ARC4RANDOM_BUF -DHAVE_ASPRINTF -DHAVE_CBOR_H -DHAVE_CLOCK_GETTIME -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_OPENSSLV_H -DHAVE_POSIX_IOCTL -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRSEP -DHAVE_SYSCONF -DHAVE_UNISTD_H -DOPENSSL_API_COMPAT=0x10100000L -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=13 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -Wimplicit-fallthrough -pedantic -pedantic-errors -fstack-protector-all -Wno-unused-result -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/strlcat.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/strlcat.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/strlcat.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/openbsd-compat/strlcat.c
    :info:build [  8%] Building C object src/CMakeFiles/fido2.dir/__/openbsd-compat/timingsafe_bcmp.c.o
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/src && /opt/local/bin/gcc-mp-13 -DHAVE_ARC4RANDOM_BUF -DHAVE_ASPRINTF -DHAVE_CBOR_H -DHAVE_CLOCK_GETTIME -DHAVE_DEV_URANDOM -DHAVE_ERR_H -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_OPENSSLV_H -DHAVE_POSIX_IOCTL -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRSEP -DHAVE_SYSCONF -DHAVE_UNISTD_H -DOPENSSL_API_COMPAT=0x10100000L -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=13 -D_FIDO_PATCH=0 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DARWIN_C_SOURCE -D__STDC_WANT_LIB_EXT1__=1 -std=c99 -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -arch ppc -mmacosx-version-min=10.6 -fPIC -Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -Wimplicit-fallthrough -pedantic -pedantic-errors -fstack-protector-all -Wno-unused-result -MD -MT src/CMakeFiles/fido2.dir/__/openbsd-compat/timingsafe_bcmp.c.o -MF CMakeFiles/fido2.dir/__/openbsd-compat/timingsafe_bcmp.c.o.d -o CMakeFiles/fido2.dir/__/openbsd-compat/timingsafe_bcmp.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/openbsd-compat/timingsafe_bcmp.c
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c: In function 'disable_sigpipe':
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:370:23: error: 'F_SETNOSIGPIPE' undeclared (first use in this function)
    :info:build   370 |         if (fcntl(fd, F_SETNOSIGPIPE, &disabled) == -1) {
    :info:build       |                       ^~~~~~~~~~~~~~
    :info:build [  8%] Generating fido_assert_clientdata_hash_len.3
    :info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build/man && ln -sf fido_assert_new.3 fido_assert_clientdata_hash_len.3
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c: In function 'get_ioreg_entry':
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:392:13: error: implicit declaration of function 'IORegistryEntryIDMatching'; did you mean 'IORegistryEntryInPlane'? [-Wimplicit-function-declaration]
    :info:build   392 |             IORegistryEntryIDMatching(id)));
    :info:build       |             ^~~~~~~~~~~~~~~~~~~~~~~~~
    :info:build       |             IORegistryEntryInPlane
    :info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:392:13: error: passing argument 2 of 'IOServiceGetMatchingService' makes pointer from integer without a cast [-Wint-conversion]
    :info:build   392 |             IORegistryEntryIDMatching(id)));
    :info:build       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    :info:build       |             |
    :info:build       |             int
    :info:build In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/libfido2-1.13.0/src/hid_osx.c:17:
    :info:build /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:335:25: note: expected 'CFDictionaryRef' {aka 'const struct __CFDictionary *'} but argument is of type 'int'
    :info:build   335 |         CFDictionaryRef matching );
    :info:build       |         ~~~~~~~~~~~~~~~~^~~~~~~~
    :info:build make[2]: *** [src/CMakeFiles/fido2.dir/hid_osx.c.o] Error 1
    :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_security_libfido2/libfido2/work/build'
    :info:build make[1]: *** [src/CMakeFiles/fido2.dir/all] Error 2
    :info:build make[1]: *** Waiting for unfinished jobs....
    

So just throwing it away does not work, at least on old systems. (I have no environment to test every OS in between.)

Last edited 7 months ago by barracuda156 (previous) (diff)

comment:12 Changed 7 months ago by barracuda156

comment:13 Changed 7 months ago by barracuda156

  1. F_SETNOSIGPIPE was introduced in: https://github.com/Yubico/libfido2/commit/835309b44daf7f863766c827035ba3e2715422d3
  1. My patch seems to revert, for the most part, the following commit: https://github.com/Yubico/libfido2/commit/0d0b2af2414df4a70bb943fadef8e2925d68e693

Perhaps I made some error(s) in the process. I will review that, and perhaps make it via replacing the code rather than via tweaking macros.

comment:14 in reply to:  10 ; Changed 7 months ago by jasperweiss (Jasper Weiss)

Replying to barracuda156:

Well, if it is on a system where my patch is not applied, it cannot possibly be the same issue :) If we are to believe buildbots (which are supposed to use standard Macports set-up), all systems 10.12 up were good at the time of last port update: https://ports.macports.org/port/libfido2/details

Ok thank you. I will open a new ticket. Just so I understand correctly, if the build depends on clang-15, port will install and use that regardless of my installed and selected clang version right?

comment:15 in reply to:  14 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to jasperweiss:

if the build depends on clang-15, port will install and use that regardless of my installed and selected clang version right?

Yes. But libfido2 does not require clang-15 or any specific compiler; it should build fine with the one from Xcode. The ports web site erroneously claims that it requires clang-15 because its information is generated on Linux where I guess MacPorts has different compiler requirements (perhaps intentionally or just accidentally).

comment:16 Changed 4 weeks ago by trodemaster (Blake Garner)

Are we able to close this one out as well then barracuda1156?

comment:17 in reply to:  16 Changed 4 weeks ago by barracuda156

Replying to trodemaster:

Are we able to close this one out as well then barracuda1156?

Perhaps in week, if it is not too pressing to close? I will try finding time for this. Admittedly, this is not high on priorities, and there is more urgent stuff to do, but I realize this was postponed beyond reasonable time limits :)

comment:18 Changed 3 weeks ago by trodemaster (Blake Garner)

I really don't see the value in making this port functional on older systems. Are you able to test a Yubikey on a 10.6 system with a current version of SSH to confirm functionality? I'm also concerned about maintaining macports specific patches longer term. It seems unlikely that changes here would be accepted upstream.

I can appreciate keeping stuff working on the older systems but let's focus that effort on ports that are worth using on them.

Note: See TracTickets for help on using tickets.