Yubico / libfido2

Provides library functionality for FIDO2, including communication with a device over USB or NFC.
Other
592 stars 152 forks source link

libfido2 using version-script which is not supported on Mac OS X #127

Closed mmahut closed 4 years ago

mmahut commented 4 years ago

While trying to build on Max OS X, I get the following error.


[ 12%] Building C object src/CMakeFiles/fido2_shared.dir/__/openbsd-compat/timingsafe_bcmp.c.o
cd /tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/build/src && /nix/store/kwz39fhiv70bpqgzm3phhnpvrghgfypj-clang-wrapper-7.1.0/bin/clang -DHAS_DEV_URANDOM -DHAVE_ARC4RANDOM_BUF -DHAVE_ERR_H -DHAVE_GETENTROPY -DHAVE_GETLINE -DHAVE_GETOPT -DHAVE_GETPAGESIZE -DHAVE_MEMSET_S -DHAVE_READPASSPHRASE -DHAVE_SIGNAL_H -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_SYSCONF -DHAVE_TIMINGSAFE_BCMP -DHAVE_UNISTD_H -DSIGNAL_EXAMPLE -DTLS=__thread -D_FIDO_INTERNAL -D_FIDO_MAJOR=1 -D_FIDO_MINOR=3 -D_FIDO_PATCH=0 -D__STDC_WANT_LIB_EXT1__=1 -Dfido2_shared_EXPORTS -I/tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/src  -Wall -Wextra -Werror -Wshadow -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -pedantic -pedantic-errors -fstack-protector-all -std=c99 -Wshorten-64-to-32 -Wcast-qual -O3 -DNDEBUG -arch x86_64 -fPIC   -o CMakeFiles/fido2_shared.dir/__/openbsd-compat/timingsafe_bcmp.c.o   -c /tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/openbsd-compat/timingsafe_bcmp.c
[ 12%] Linking C shared library libfido2.dylib
cd /tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/build/src && /nix/store/jrq281v2xwbgv1n4kphhg98zxhhhhma5-cmake-3.16.4/bin/cmake -E cmake_link_script CMakeFiles/fido2_shared.dir/link.txt --verbose=1
/nix/store/kwz39fhiv70bpqgzm3phhnpvrghgfypj-clang-wrapper-7.1.0/bin/clang  -Wall -Wextra -Werror -Wshadow -Wwrite-strings -Wmissing-prototypes -Wbad-function-cast -pedantic -pedantic-errors -fstack-protector-all -std=c99 -Wshorten-64-to-32 -Wcast-qual -O3 -DNDEBUG -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names  -Wl,--version-script=/tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/src/export.gnu -Wl,-z,noexecstack -Wl,-z,relro,-z,now -compatibility_version 1.0.0 -current_version 1.3.0 -o libfido2.1.3.0.dylib -install_name libfido2.1.dylib CMakeFiles/fido2_shared.dir/aes256.c.o CMakeFiles/fido2_shared.dir/assert.c.o CMakeFiles/fido2_shared.dir/authkey.c.o CMakeFiles/fido2_shared.dir/bio.c.o CMakeFiles/fido2_shared.dir/blob.c.o CMakeFiles/fido2_shared.dir/buf.c.o CMakeFiles/fido2_shared.dir/cbor.c.o CMakeFiles/fido2_shared.dir/cred.c.o CMakeFiles/fido2_shared.dir/credman.c.o CMakeFiles/fido2_shared.dir/dev.c.o CMakeFiles/fido2_shared.dir/ecdh.c.o CMakeFiles/fido2_shared.dir/eddsa.c.o CMakeFiles/fido2_shared.dir/err.c.o CMakeFiles/fido2_shared.dir/es256.c.o CMakeFiles/fido2_shared.dir/hid.c.o CMakeFiles/fido2_shared.dir/info.c.o CMakeFiles/fido2_shared.dir/io.c.o CMakeFiles/fido2_shared.dir/iso7816.c.o CMakeFiles/fido2_shared.dir/log.c.o CMakeFiles/fido2_shared.dir/pin.c.o CMakeFiles/fido2_shared.dir/reset.c.o CMakeFiles/fido2_shared.dir/rs256.c.o CMakeFiles/fido2_shared.dir/u2f.c.o CMakeFiles/fido2_shared.dir/hid_osx.c.o CMakeFiles/fido2_shared.dir/__/openbsd-compat/bsd-getpagesize.c.o CMakeFiles/fido2_shared.dir/__/openbsd-compat/explicit_bzero.c.o CMakeFiles/fido2_shared.dir/__/openbsd-compat/explicit_bzero_win32.c.o CMakeFiles/fido2_shared.dir/__/openbsd-compat/recallocarray.c.o CMakeFiles/fido2_shared.dir/__/openbsd-compat/timingsafe_bcmp.c.o  -lcbor -lcrypto -framework CoreFoundation -framework IOKit
ld: unknown option: --version-script=/tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/src/export.gnu
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/fido2_shared.dir/build.make:507: src/libfido2.1.3.0.dylib] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/build'
make[1]: *** [CMakeFiles/Makefile2:189: src/CMakeFiles/fido2_shared.dir/all] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-libfido2-1.3.0.drv-0/libfido2-1.3.0/build'
make: *** [Makefile:133: all] Error 2
builder for '/nix/store/afxb6238isbbdh5llk53fd3y39wb8x3d-libfido2-1.3.0.drv' failed with exit code 2
error: build of '/nix/store/afxb6238isbbdh5llk53fd3y39wb8x3d-libfido2-1.3.0.drv' failed```
martelletto commented 4 years ago

Hi,

What is the value of CMAKE_C_COMPILER_ID ~on your system~ in your compilation environment? (It is printed along other variables when cmake is run.)

-p.

(Edit: more accurate question)

mmahut commented 4 years ago

Please see the patch at https://github.com/NixOS/nixpkgs/pull/80909

martelletto commented 4 years ago

Fixed in 916ebd1; thank you!