Opened 14 months ago
Last modified 5 months 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: | dazuelos (dan) |
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 (23)
comment:1 follow-up: 9 Changed 14 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' |
comment:2 Changed 14 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 follow-up: 4 Changed 14 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.
comment:4 follow-up: 7 Changed 14 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 14 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 14 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 follow-up: 8 Changed 14 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 Changed 14 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 follow-up: 10 Changed 13 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 follow-up: 14 Changed 13 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 13 months ago by barracuda156
I will update sequentially.
- 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.)
comment:12 Changed 13 months ago by barracuda156
Of these:
IOHIDDeviceGetService
is available on 10.6+ (and apparently not onppc
anyway): https://developer.apple.com/documentation/iokit/1588646-iohiddevicegetservice
So this credibly needs either a fallback or bypass.
Same goes for IORegistryEntryGetRegistryEntryID
: https://developer.apple.com/documentation/iokit/1514719-ioregistryentrygetregistryentryi
And for IORegistryEntryIDMatching
: https://developer.apple.com/documentation/iokit/1514880-ioregistryentryidmatching
kIOHIDManagerOptionNone
is available on 10.12+: https://developer.apple.com/documentation/iokit/1645245-anonymous/kiohidmanageroptionnone
F_SETNOSIGPIPE
is apparently available on 10.7+: https://chromium.googlesource.com/chromium/src/+/fa318207cc7cc3c53f18fd1981ea1bd5ac8cac66/third_party/crashpad/crashpad/util/mach/child_port_handshake.cc
comment:13 Changed 13 months ago by barracuda156
F_SETNOSIGPIPE
was introduced in: https://github.com/Yubico/libfido2/commit/835309b44daf7f863766c827035ba3e2715422d3
- 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 follow-up: 15 Changed 13 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 Changed 13 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 follow-up: 17 Changed 8 months ago by trodemaster (Blake Garner)
Are we able to close this one out as well then barracuda1156?
comment:17 Changed 8 months 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 8 months 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.
comment:19 follow-up: 20 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)
Cc: | dazuelos added |
---|
I really don't see the value in having obviously wrong patches in ports…
Has duplicate #70256.
comment:20 follow-up: 23 Changed 5 months ago by barracuda156
Replying to ryandesign:
I really don't see the value in having obviously wrong patches in ports…
Has duplicate #70256.
Maybe just make it conditional to begin with?
While we certainly have cases where something cannot be made to work on older OS, more often than not something is broken due to wrong defaults and/or lack of rather trivial SDK-related fixes. Maybe this port is that hopeless case; but at least from references above it appears that I did not do anything crazy (no time to review deeply at the moment).
However clearly we should not break one OS for the sake of another. But I do not think it is an optimal approach to mark anything as unfixable when it is not at all established. Do we have strong reasons to believe it cannot work on < 10.7 (or w/e the threshold)? If yes, then set platforms accordingly. If not, make a problematic patch conditional, so that it does not break anything else and only fixes the build of 10.6. (Not being usable right now does not in itself mean it is useless. I can point to multiple cases where the contrary was proven.)
comment:21 Changed 5 months ago by dazuelos (dan)
Same problem on libfido2@1.15.0 on macOS Yosemite 10.10.5 and cc=Apple LLVM version 7.0.2, Xcode=7.2 .
May I be of any help in testing anything on this specific OS+Xcode+cc?
comment:22 Changed 5 months ago by dazuelos (dan)
With this surgical modif. on Portfile:
34 # if {${os.major} < 16} { 35 # patchfiles-append \ 36 # patch-hid_osx.diff 37 # }
libfido2@1.15.0 build without error.
comment:23 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to barracuda156:
it appears that I did not do anything crazy (no time to review deeply at the moment).
Please re-read comment:7 where I explained how your patch is obviously wrong in at least two ways.
Replying to barracuda156:
Weird.
id
is declared on line 173:And it is used on line 181 apparently without complaint:
Why then would it think on line 189 that it's undeclared?
That doesn't seem accurate either.
path
is a pointer to a string:Memory is allocated on the heap (not the stack) by calling
asprintf
and assigned to that pointer:It is not returning the address of stack memory. It is returning the address of the allocated heap memory:
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?