-
Notifications
You must be signed in to change notification settings - Fork 116
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
Comments
In a CMake build, if I specify |
I am hitting the same issue on an Intel Mac. I believe this might be an incompatibility with OS X Monterey. |
All of the "pointer not aligned at address" warnings are coming from nanopb-generated files, specifically, the Looking, for example, at the first warning (edited for brevity):
Unmangling the name, it's referring to the following declaration:
and the definition is
I'm not sure why the compiler would emit these "fields" arrays unaligned though. Something for us to dig into though. |
It looks like setting the preprocessor define
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:
EXCEPT, for here
My hypothesis is that adding |
I'm not getting as far as runtime, the compiler says these are warnings but refuses to link with them. If 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. |
@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. |
Hmm. Well, I'm going to roll a custom build of the C++ SDK with the |
firebase/firebase-ios-sdk#8923 removes the warnings and fixes the build for me. |
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. |
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. |
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? |
Will do, although I won't get a chance until Monday. |
@mark-grimes Have you had a chance to see if that custom build from #712 (comment) fixes the build for you? |
Sorry, got caught up with other things. I've tried the commands in the initial post (i.e. building
System: Apple M1 Max (probably not relevant) Happy for you to close this issue unless you want to wait until it's merged and/or released. |
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. |
[REQUIRED] Please fill in the following fields:
[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:
The
warning: direct access in function
I always used to get on Intel Macs too. Thepointer 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)
The text was updated successfully, but these errors were encountered: