-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling libfido in macOS bigSur - apple silicon chip. #274
Comments
Hi, The easiest way is to install pkg-config, libcbor, and OpenSSL using Homebrew and set the $ brew install pkg-config libcbor openssl
$ export PKG_CONFIG_PATH="$(brew --prefix openssl@1.1)/lib/pkgconfig"
$ (rm -rf build && mkdir build && cd build && cmake ..) This is the approach currently implemented in .actions/build-osx-clang. According to https://formulae.brew.sh/, the required dependencies are available on Apple Silicon (and so is libfido2 itself). If Homebrew is not an option, you will probably need to install libcbor and OpenSSL by hand. Let me know if that's the case and I will happily help you out. -p. |
Hi @martelletto and thanks for your guidance it resolve my problem. I also prefer, as you suggested, to compile the dependencies manually, completely independent from intermediators like brew - perhaps you can provide me some guidance in this area as well ? Perhaps it can be added to build-osx-clang ? thanks |
Hi, A variation of these steps should work:
$ mkdir -p staging/root staging/src
$ export FAKEROOT="$(realpath staging/root)"
$ cd staging/src
$ git clone --branch OpenSSL_1_1_1i https://github.com/openssl/openssl
$ git clone --branch v0.8.0 https://github.com/pjk/libcbor
$ git clone --branch 1.6.0 https://github.com/yubico/libfido2
$ cd openssl
$ ./Configure darwin64-x86_64-cc --prefix="${FAKEROOT}" --openssldir="${FAKEROOT}/openssl"
$ make install_sw You will probably want to adjust the target from
$ cd ../libcbor
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="${FAKEROOT}" -DCMAKE_INSTALL_NAME_DIR="${FAKEROOT}/lib"
$ make VERBOSE=1 all install
$ cd ../../libfido2
$ mkdir build
$ cd build
$ export CFLAGS="-I${FAKEROOT}/include"
$ export LDFLAGS="-L${FAKEROOT}/lib"
$ cmake -DCMAKE_INSTALL_PREFIX="${FAKEROOT}" ..
$ make
$ make install
$ "${FAKEROOT}/bin/fido2-token" -V
1.6.0 Cheers, -p. |
Thanks @martelletto, it's working great. I was also thinking about building the libraries in FAT format so I can use it on both platforms (x86_64 and arm64). Does libfido2 support this capability (building on both arch from M1 computer) or I should build it separately in each platform and merge them to FAT using lipo? |
No idea. :) In principle it should work. |
Hi, I'm trying to compile the libfido project for macOS environment with apple silicon (arm64)
According to the documentation, it should be performed in the following command, but I think there are some prerequisites that are unmentioned ...
This is my attempt
from cmake source, I fell on the following code :
Not sure where exactly where should I put cbor.h relative to libfido main folder ?
Does it have other pre-requirements besides that ?
The text was updated successfully, but these errors were encountered: