[BUG] error: PCH file was compiled for the target 'aarch64-unknown-linux-android21' but the current translation unit is being compiled for target 'aarch64-none-linux-android21'
@Sharjeel-Khan is already working on this.
Since Nov 2, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- android, cmake
- Domain
- build-system
Research direction
Start by reproducing the reported target mismatch with the Android NDK CMake toolchain and clang-scan-deps, comparing the injected aarch64-none-linux-android target with the user-supplied aarch64-linux-android21 target. The report does not identify a source file or test, so first locate how the toolchain passes target flags and how dependency scanning consumes them. Done means the supported NDK builds successfully in this setup without the PCH target error.
Written by the indexing model from the issue text.
Description
Description
Android NDK Toolchain cmake has set:
set(ANDROID_LLVM_TRIPLE aarch64-none-linux-android)
set(ANDROID_LLVM_TRIPLE x86_64-none-linux-android)
I don't known why use -none- rather than -unknown-
CMake will automatically inject the --taregt=$ANDROID_LLVM_TRIPLE parameter to clang.
If user also pass --taregt=aarch64-linux-android21 and use with clang-scan-deps, it will report this error.
clang treat --taregt=aarch64-linux-android21 as --taregt=aarch64-unknown-linux-android21 rather than --taregt=aarch64-none-linux-android21
I am using a supported NDK
- I have checked and the NDK I'm using is currently supported
Affected versions
r27, r29, r28, r30
- Dominant language
- No language data
- Stars
- 2.3k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 android/ndk
-
[BUG] simpleperf associates wrong header file for lambdaPossibly taken @Jake-The-Human claimed this 24 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 40/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 47/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bluesky-social/social-app#12545 ·
Maintainers usually reply within 1 day
-
refactor topic-architecture topic-ui
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
XCSoar/XCSoar#3547 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manjaro-sway/manjaro-sway#1079 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linux-test-project/lcov#579 ·
Maintainers usually reply within 1 day
-
compiler: the island_chunks_not_emitted report gives a count but not which islands were skippedOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100