-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
It seems like there are issues statically linking to libmongocrypt on OSX due to an inability to determine the architecture of the library. I get the following error message trying to link to it:
c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++ -o Release/mongocrypt.node Release/obj.target/mongocrypt/src/mongocrypt.o /Users/mbroadst/Development/mongo/libmongocrypt/bindings/node/deps/libmongocrypt/lib64/libmongocrypt-static.a ld: warning: ignoring file /Users/mbroadst/Development/mongo/libmongocrypt/bindings/node/deps/libmongocrypt/lib64/libmongocrypt-static.a, file was built for archive which is not the architecture being linked (x86_64): /Users/mbroadst/Development/mongo/libmongocrypt/bindings/node/deps/libmongocrypt/lib64/libmongocrypt-static.a
the contents of the archive are:
[mbroadst@gorgor node (node-bindings ✗)]$ ar -t deps/libmongocrypt/lib64/libmongocrypt-static.a / // /0 /23 /46 /68 /99 /125 /152 /175 /203 /231 /259 /279 /299 /326 /350 /370 /394 /415 /438 mongocrypt.c.o/ os_mutex.c.o/ os_once.c.o/ openssl.c.o/ kms_b64.c.o/ hexlify.c.o/ /468 /493 kms_kv_list.c.o/ kms_message.c.o/ kms_request.c.o/ /518 /539 /560 /578 sort.c.o/ /603
on linux things look as expected:
mbroadst@simulated-cell:~/test/lib$ ar -t libmongocrypt-static.a
mongocrypt-binary.c.o
mongocrypt-buffer.c.o
mongocrypt-cache.c.o
mongocrypt-cache-collinfo.c.o
mongocrypt-cache-key.c.o
mongocrypt-ciphertext.c.o
mongocrypt-crypto.c.o
mongocrypt-ctx-datakey.c.o
mongocrypt-ctx-decrypt.c.o
mongocrypt-ctx-encrypt.c.o
mongocrypt-ctx.c.o
mongocrypt-key.c.o
mongocrypt-key-broker.c.o
mongocrypt-kms-ctx.c.o
mongocrypt-log.c.o
mongocrypt-marking.c.o
mongocrypt-opts.c.o
mongocrypt-status.c.o
mongocrypt-traverse-util.c.o
mongocrypt.c.o
os_mutex.c.o
os_once.c.o
openssl.c.o
kms_b64.c.o
hexlify.c.o
kms_decrypt_request.c.o
kms_encrypt_request.c.o
kms_kv_list.c.o
kms_message.c.o
kms_request.c.o
kms_request_opt.c.o
kms_request_str.c.o
kms_response.c.o
kms_response_parser.c.o
sort.c.o
kms_crypto_openssl.c.o