[FR] Support desktop Linux on aarch64/arm (#error Unknown Linux architecture in app_common.cc)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp, linux
- Domain
- build-system, operating-systems
Research direction
Start in app/src/app_common.cc at the Linux kCpuArchitecture branch and inspect how the value is used for library registration and the user-agent. Verify the existing ARM naming in the same file, then build the C++ SDK with aarch64 and 32-bit ARM Linux toolchains. Done means those targets no longer stop at the unknown-architecture error.
Written by the indexing model from the issue text.
Description
Feature proposal
- Firebase Component: Core (App)
Support desktop Linux on aarch64 and 32-bit ARM.
Use case: we run the C++ SDK (Auth, Realtime Database, Remote Config) on an embedded aarch64 Linux board, cross-compiled from x86_64 with a Buildroot GCC toolchain. The SDK builds and runs there with one change. Without it, the build stops in app/src/app_common.cc (v12.8.0, unchanged on main), because the Linux branch that defines kCpuArchitecture only knows x86 and x86_64:
#if __amd64__
const char* kCpuArchitecture = "x86_64";
#elif __i386__
const char* kCpuArchitecture = "x86";
#else
#error Unknown Linux architecture.
#endif // Architecture
The value is only used for the fire-cpp-arch library registration (the user-agent), and the other platforms in the same file already name ARM ("arm64", "arm32"). So ARM Linux is blocked by this one #error, not by anything that depends on the architecture.
Proposed change, matching those names:
#if __amd64__
const char* kCpuArchitecture = "x86_64";
#elif __i386__
const char* kCpuArchitecture = "x86";
#elif __aarch64__
const char* kCpuArchitecture = "arm64";
#elif __arm__
const char* kCpuArchitecture = "arm32";
#else
#error Unknown Linux architecture.
#endif // Architecture
With this change, Auth, Realtime Database and Remote Config build and run on aarch64 Linux for us. Happy to open a PR.
Related: #1508 (Linux cross-compilation / Yocto support).
- Dominant language
- C++
- Stars
- 326
- Forks
- 138
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-cpp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
firebase/firebase-cpp-sdk#1905 · 2 comments ·
Maintainers usually reply within 1 day
-
api: firestore
Difficulty 5/5 Over a week Newbie friendliness 35/100
firebase/firebase-cpp-sdk#1920 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-cpp-sdk#1904 · 1 comment ·
Maintainers usually reply within 1 day
-
new type: question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
firebase/firebase-cpp-sdk#1892 · 1 comment ·
Maintainers usually reply within 1 day
-
nightly-testing
Difficulty 4/5 3-5 days Newbie friendliness 25/100
firebase/firebase-cpp-sdk#1859 ·
Maintainers usually reply within 1 day
All issues in firebase/firebase-cpp-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
CLI jira shell completion
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day