Skip to content
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

[Bug] Firestore fails to link for desktop on macOS Monterey because of unaligned pointers #712

Closed
mark-grimes opened this issue Oct 28, 2021 · 15 comments

Comments

@mark-grimes
Copy link

mark-grimes commented Oct 28, 2021

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: website
  • Firebase C++ SDK version: 8.6.0
  • Problematic Firebase Component: Firestore (Auth, Database, etc.)
  • Other Firebase Components in use: n/a (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Mac M1 Max (Mac, Windows, or Linux)
  • Platform you are targeting: desktop (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Firebase 8.6.0 now comes with arm64 universal libraries for Apple Silicon (which is great, thanks). Building for desktop under most circumstances fails to link with "warnings" of unaligned pointers. We have different products that build with slightly different settings, and some fail but some don't. I'm not sure yet whether this is due to using GNU makefile or xcodebuild build systems, or when building our code as static versus dynamic libraries.

Importantly the quickstarts fail.

Googling the error comes up with a lot of results for iOS Firebase, most of which seem to say it was something about the way the Firebase libraries were built.

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts ? Yes
What's the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Building the firestore quickstart (exact shell commands below under "Relevant Code") results in:

Consolidate compiler generated dependencies of target desktop_testapp
[ 33%] Linking CXX executable desktop_testapp
ld: warning: direct access in function '_f_b_sk_X509_NAME_deep_copy' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_deep_copy' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_pop_free' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_pop_free' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: pointer not aligned at address 0x10066FB4A (__ZN8firebase9firestore29firestore_BundledQuery_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FBDB (__ZN8firebase9firestore27firestore_NamedQuery_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FBBE (__ZN8firebase9firestore27firestore_NamedQuery_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FC32 (__ZN8firebase9firestore40firestore_BundledDocumentMetadata_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FCC3 (__ZN8firebase9firestore31firestore_BundleMetadata_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FDAB (__ZN8firebase9firestore30firestore_BundleElement_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FD8E (__ZN8firebase9firestore30firestore_BundleElement_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FD71 (__ZN8firebase9firestore30firestore_BundleElement_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_bundle.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FE02 (__ZN8firebase9firestore39google_firestore_v1_Precondition_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_common.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FE93 (__ZN8firebase9firestore45google_firestore_v1_TransactionOptions_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_common.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FE76 (__ZN8firebase9firestore45google_firestore_v1_TransactionOptions_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_common.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FEEA (__ZN8firebase9firestore47google_firestore_v1_Document_FieldsEntry_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FF7B (__ZN8firebase9firestore35google_firestore_v1_Document_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FF5E (__ZN8firebase9firestore35google_firestore_v1_Document_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10066FF41 (__ZN8firebase9firestore35google_firestore_v1_Document_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670063 (__ZN8firebase9firestore32google_firestore_v1_Value_fieldsE + 195 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670046 (__ZN8firebase9firestore32google_firestore_v1_Value_fieldsE + 166 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670029 (__ZN8firebase9firestore32google_firestore_v1_Value_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670111 (__ZN8firebase9firestore35google_firestore_v1_MapValue_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067014B (__ZN8firebase9firestore37google_firestore_v1_ArrayValue_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006701A2 (__ZN8firebase9firestore47google_firestore_v1_MapValue_FieldsEntry_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006701FA (__ZN8firebase9firestore45google_firestore_v1_GetDocumentRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670339 (__ZN8firebase9firestore47google_firestore_v1_ListDocumentsRequest_fieldsE + 224 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006702FF (__ZN8firebase9firestore47google_firestore_v1_ListDocumentsRequest_fieldsE + 166 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067045B (__ZN8firebase9firestore48google_firestore_v1_CreateDocumentRequest_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067043E (__ZN8firebase9firestore48google_firestore_v1_CreateDocumentRequest_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006704CF (__ZN8firebase9firestore48google_firestore_v1_UpdateDocumentRequest_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006704B2 (__ZN8firebase9firestore48google_firestore_v1_UpdateDocumentRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670495 (__ZN8firebase9firestore48google_firestore_v1_UpdateDocumentRequest_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670543 (__ZN8firebase9firestore48google_firestore_v1_DeleteDocumentRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067060E (__ZN8firebase9firestore51google_firestore_v1_BatchGetDocumentsRequest_fieldsE + 166 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006705F1 (__ZN8firebase9firestore51google_firestore_v1_BatchGetDocumentsRequest_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006705B7 (__ZN8firebase9firestore51google_firestore_v1_BatchGetDocumentsRequest_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067069F (__ZN8firebase9firestore52google_firestore_v1_BatchGetDocumentsResponse_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006706F6 (__ZN8firebase9firestore50google_firestore_v1_BeginTransactionRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067074D (__ZN8firebase9firestore40google_firestore_v1_CommitRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006707C1 (__ZN8firebase9firestore41google_firestore_v1_CommitResponse_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067086F (__ZN8firebase9firestore42google_firestore_v1_RunQueryRequest_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670852 (__ZN8firebase9firestore42google_firestore_v1_RunQueryRequest_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006708E3 (__ZN8firebase9firestore43google_firestore_v1_RunQueryResponse_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006708A9 (__ZN8firebase9firestore43google_firestore_v1_RunQueryResponse_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006709AE (__ZN8firebase9firestore39google_firestore_v1_WriteRequest_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670A3F (__ZN8firebase9firestore40google_firestore_v1_WriteResponse_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670A22 (__ZN8firebase9firestore40google_firestore_v1_WriteResponse_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670A96 (__ZN8firebase9firestore33google_firestore_v1_Target_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670A79 (__ZN8firebase9firestore33google_firestore_v1_Target_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670B9B (__ZN8firebase9firestore40google_firestore_v1_ListenRequest_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670B61 (__ZN8firebase9firestore40google_firestore_v1_ListenRequest_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670C49 (__ZN8firebase9firestore39google_firestore_v1_TargetChange_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670C0F (__ZN8firebase9firestore39google_firestore_v1_TargetChange_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670CF7 (__ZN8firebase9firestore41google_firestore_v1_ListenResponse_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670CDA (__ZN8firebase9firestore41google_firestore_v1_ListenResponse_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670CBD (__ZN8firebase9firestore41google_firestore_v1_ListenResponse_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670C83 (__ZN8firebase9firestore41google_firestore_v1_ListenResponse_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670D4E (__ZN8firebase9firestore45google_firestore_v1_Target_QueryTarget_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_firestore.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670DD2 (__ZN8firebase9firestore34firestore_client_NoDocument_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_maybe_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670E29 (__ZN8firebase9firestore39firestore_client_UnknownDocument_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_maybe_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670E9D (__ZN8firebase9firestore37firestore_client_MaybeDocument_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_maybe_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670E63 (__ZN8firebase9firestore37firestore_client_MaybeDocument_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_maybe_document.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670F4B (__ZN8firebase9firestore34firestore_client_WriteBatch_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_mutation.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670F2E (__ZN8firebase9firestore34firestore_client_WriteBatch_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_mutation.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670F11 (__ZN8firebase9firestore34firestore_client_WriteBatch_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_mutation.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670F85 (__ZN8firebase9firestore53google_firestore_v1_StructuredQuery_Projection_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670FF9 (__ZN8firebase9firestore49google_firestore_v1_StructuredQuery_Filter_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100670FBF (__ZN8firebase9firestore49google_firestore_v1_StructuredQuery_Filter_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671033 (__ZN8firebase9firestore48google_firestore_v1_StructuredQuery_Order_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067108A (__ZN8firebase9firestore33google_firestore_v1_Cursor_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067118F (__ZN8firebase9firestore42google_firestore_v1_StructuredQuery_fieldsE + 195 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671155 (__ZN8firebase9firestore42google_firestore_v1_StructuredQuery_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067111B (__ZN8firebase9firestore42google_firestore_v1_StructuredQuery_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006710FE (__ZN8firebase9firestore42google_firestore_v1_StructuredQuery_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006710E1 (__ZN8firebase9firestore42google_firestore_v1_StructuredQuery_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671203 (__ZN8firebase9firestore58google_firestore_v1_StructuredQuery_CompositeFilter_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671277 (__ZN8firebase9firestore54google_firestore_v1_StructuredQuery_FieldFilter_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067123D (__ZN8firebase9firestore54google_firestore_v1_StructuredQuery_FieldFilter_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006712CE (__ZN8firebase9firestore54google_firestore_v1_StructuredQuery_UnaryFilter_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_query.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006713E7 (__ZN8firebase9firestore24google_rpc_Status_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_status.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067143E (__ZN8firebase9firestore41google_protobuf_Struct_FieldsEntry_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_struct.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671543 (__ZN8firebase9firestore28google_protobuf_Value_fieldsE + 166 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_struct.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671526 (__ZN8firebase9firestore28google_protobuf_Value_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_struct.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067157D (__ZN8firebase9firestore32google_protobuf_ListValue_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_struct.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671665 (__ZN8firebase9firestore30firestore_client_Target_fieldsE + 195 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_target.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067162B (__ZN8firebase9firestore30firestore_client_Target_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_target.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006716D9 (__ZN8firebase9firestore36firestore_client_TargetGlobal_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_target.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067174D (__ZN8firebase9firestore44google_firestore_v1_DocumentTransform_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671835 (__ZN8firebase9firestore59google_firestore_v1_DocumentTransform_FieldTransform_fieldsE + 195 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006717FB (__ZN8firebase9firestore59google_firestore_v1_DocumentTransform_FieldTransform_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006717DE (__ZN8firebase9firestore59google_firestore_v1_DocumentTransform_FieldTransform_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006717C1 (__ZN8firebase9firestore59google_firestore_v1_DocumentTransform_FieldTransform_fieldsE + 79 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067191D (__ZN8firebase9firestore32google_firestore_v1_Write_fieldsE + 195 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006718E3 (__ZN8firebase9firestore32google_firestore_v1_Write_fieldsE + 137 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006718C6 (__ZN8firebase9firestore32google_firestore_v1_Write_fieldsE + 108 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x10067186F (__ZN8firebase9firestore32google_firestore_v1_Write_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671957 (__ZN8firebase9firestore38google_firestore_v1_WriteResult_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x1006719AE (__ZN8firebase9firestore41google_firestore_v1_DocumentChange_fieldsE + 21 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: warning: pointer not aligned at address 0x100671A3F (__ZN8firebase9firestore41google_firestore_v1_DocumentDelete_fieldsE + 50 from /Users/myusername/Documents/dependencies/firebase_cpp_sdk/latest/libs/darwin/universal/libfirebase_firestore.a(35d977e33fa52a2d694735fe9d685b60_write.nanopb.cc.o))
ld: unaligned pointer(s) for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [desktop_testapp] Error 1
make[1]: *** [CMakeFiles/desktop_testapp.dir/all] Error 2
make: *** [all] Error 2

The warning: direct access in function I always used to get on Intel Macs too. The pointer not aligned are new since switching.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

On an Apple Silicon Mac (tested on Apple M1 Max based MacBook Pro)

git clone https://github.com/firebase/quickstart-cpp.git
mkdir -p quickstart-cpp/builds/firestore
cd quickstart-cpp/builds/firestore
/Applications/CMake.app/Contents/bin/cmake -DFIREBASE_CPP_SDK_DIR=<install directory> ../../firestore/testapp/
make
@mark-grimes
Copy link
Author

In a CMake build, if I specify -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" it works. If I don't, it doesn't. So I'm not sure if this actually is because of Apple silicon.

@schmidt-sebastian
Copy link
Contributor

I am hitting the same issue on an Intel Mac. I believe this might be an incompatibility with OS X Monterey.

@dconeybe
Copy link
Contributor

dconeybe commented Nov 3, 2021

All of the "pointer not aligned at address" warnings are coming from nanopb-generated files, specifically, the fields arrays. I'd hazard to guess that these warnings started in version 8.4.0 when its dependency on the iOS SDK was upgraded to include firebase/firebase-ios-sdk#8124 (Migrate FieldValue to Protobuf).

Looking, for example, at the first warning (edited for brevity):

ld: warning: pointer not aligned at address 0x10066FB4A (__ZN8firebase9firestore29firestore_BundledQuery_fieldsE + 50 from libfirebase_firestore.a(bundle.nanopb.cc.o))

Unmangling the name, it's referring to the following declaration:

extern const pb_field_t firestore_BundledQuery_fields[4];

here: https://github.com/firebase/firebase-ios-sdk/blob/04b7555228b537a6cbebbc432f1f45d28336ba3d/Firestore/Protos/nanopb/firestore/bundle.nanopb.h#L143

and the definition is

const pb_field_t firestore_BundledQuery_fields[4] = {
    PB_FIELD(  1, BYTES   , SINGULAR, POINTER , FIRST, firestore_BundledQuery, parent, parent, 0),
    PB_ANONYMOUS_ONEOF_FIELD(query_type,   2, MESSAGE , ONEOF, STATIC  , OTHER, firestore_BundledQuery, structured_query, parent, &google_firestore_v1_StructuredQuery_fields),
    PB_FIELD(  3, UENUM   , SINGULAR, STATIC  , OTHER, firestore_BundledQuery, limit_type, structured_query, 0),
    PB_LAST_FIELD
};

here: https://github.com/firebase/firebase-ios-sdk/blob/04b7555228b537a6cbebbc432f1f45d28336ba3d/Firestore/Protos/nanopb/firestore/bundle.nanopb.cc#L40-L45

I'm not sure why the compiler would emit these "fields" arrays unaligned though. Something for us to dig into though.

@dconeybe
Copy link
Contributor

dconeybe commented Nov 3, 2021

It looks like setting the preprocessor define PB_NO_PACKED_STRUCTS will fix this:

/* Define this if your CPU / compiler combination does not support
 * unaligned memory access to packed structures. Note that packed
 * structures are only used when requested in .proto options. */
/* #define PB_NO_PACKED_STRUCTS 1 */

https://github.com/nanopb/nanopb/blob/ab19ecbe1b9f377ab4ee8e762bfe16c39068ad68/pb.h#L16-L19

Looking through this GitHub repository and https://github.com/firebase/firebase-ios-sdk it looks like the nanopb preprocessor defines always come in this group of 3:

PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1

e.g. https://github.com/firebase/firebase-ios-sdk/blob/0e15427fce0c6039d58d6b2ed634df4350599500/FirebaseFirestore.podspec#L118

EXCEPT, for here

target_compile_definitions(
  protobuf-nanopb-static PUBLIC
  -DPB_FIELD_32BIT -DPB_ENABLE_MALLOC
)

in https://github.com/firebase/firebase-ios-sdk/blob/04b7555228b537a6cbebbc432f1f45d28336ba3d/CMakeLists.txt#L243-L246

My hypothesis is that adding -DPB_NO_PACKED_STRUCTS=1 at that spot would fix this. But this begs the question: if two compiler invocations are using different values for PB_NO_PACKED_STRUCTS then we should be seeing horrible, unexplainable crashes and other weird undefined behavior at runtime since DPB_NO_PACKED_STRUCTS affects the memory layout of the protos. But, maybe we're just getting lucky? I'll look into it.

@mark-grimes
Copy link
Author

...then we should be seeing horrible, unexplainable crashes and other weird undefined behavior at runtime...

I'm not getting as far as runtime, the compiler says these are warnings but refuses to link with them. If -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" fixes the memory layout rather than just hiding the warnings it'd be fine.

I also tried targeting x86_64 (on Apple silicon) and got the same. In changing to Apple silicon I also went from Big Sur to Monterey, so I agree this is probably a Monterey issue. I'll change the title.

@mark-grimes mark-grimes changed the title [Bug] Firestore fails to link for desktop on Apple silicon macs because of unaligned pointers [Bug] Firestore fails to link for desktop on macOS Moneterey because of unaligned pointers Nov 3, 2021
@mark-grimes mark-grimes changed the title [Bug] Firestore fails to link for desktop on macOS Moneterey because of unaligned pointers [Bug] Firestore fails to link for desktop on macOS Monterey because of unaligned pointers Nov 3, 2021
@schmidt-sebastian
Copy link
Contributor

@dconeybe There are hundreds of warnings about unaligned pointers. We would have seen them much earlier if these were caused by a change to Firestore.

@dconeybe
Copy link
Contributor

dconeybe commented Nov 3, 2021

Hmm. Well, I'm going to roll a custom build of the C++ SDK with the -DPB_NO_PACKED_STRUCTS=1 fix from firebase/firebase-ios-sdk#8923 and get you two to test it out to see if it fixes the warnings. If it does, it's a super easy fix.

@schmidt-sebastian
Copy link
Contributor

firebase/firebase-ios-sdk#8923 removes the warnings and fixes the build for me.

@dconeybe
Copy link
Contributor

dconeybe commented Nov 3, 2021

The fix has been merged into the iOS SDK: firebase/firebase-ios-sdk#8923. Unfortunately, it won't get picked up by the next C++ SDK release, but it will get picked up by the one after that. Once I get a custom build working (it's having issues at the moment) I'll post it here for you to try out and/or use in the interim.

@mark-grimes
Copy link
Author

To be honest, targeting macOS 10.15 is fine for us in the medium term so I'm in no rush as long as it gets in eventually. I'm happy to test a build if it helps you out though.

@dconeybe
Copy link
Contributor

dconeybe commented Nov 5, 2021

I have a custom build of the C++ SDK that incorporates firebase/firebase-ios-sdk#8923:

https://github.com/firebase/firebase-cpp-sdk/actions/runs/1426820775

Could you try it out and reply back?

@mark-grimes
Copy link
Author

Will do, although I won't get a chance until Monday.

@dconeybe
Copy link
Contributor

@mark-grimes Have you had a chance to see if that custom build from #712 (comment) fixes the build for you?

@mark-grimes
Copy link
Author

Sorry, got caught up with other things. I've tried the commands in the initial post (i.e. building firebase-quickstart-cpp/firestore/testapp) and it builds fine where it didn't before. I still get the following warnings but I've had these for ages and had no problems running in production:

ld: warning: direct access in function '_f_b_sk_X509_NAME_deep_copy' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_deep_copy' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_pop_free' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function '_f_b_sk_X509_NAME_pop_free' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_app.a(93f69bbf5771d4a5b72056dec59d993b_ssl_x509.cc.o)' to global weak symbol '_f_b_sk_X509_NAME_call_free_func' from file '/Users/myusername/Documents/dependencies/firebase_cpp_sdk/firebase_cpp_sdk_custom/libs/darwin/universal/libfirebase_firestore.a(61bdfe207469be13490cee4a1c4bfec5_1_ssl_transport_security.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

System: Apple M1 Max (probably not relevant)
OS: macOS Monterey 12.0.1

Happy for you to close this issue unless you want to wait until it's merged and/or released.

@dconeybe
Copy link
Contributor

Thanks for confirming, @mark-grimes. I'll close this issue then as this build error will be fixed in the next release of the C++ SDK.

@firebase firebase locked and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants