[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 已经在做这个了。
开始于 2026年11月2日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- android, cmake
- 领域
- build-system
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- 没有语言数据
- 星标
- 2.3k
- 派生
- 311
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
android/ndk 的其他 Issue
-
[BUG] simpleperf associates wrong header file for lambda可能已有人在做 @Jake-The-Human 于 24 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 65/100
-
bug
难度 3/5 1-2 天 新手友好度 68/100
-
bug
难度 3/5 1-2 天 新手友好度 40/100
-
bug
难度 3/5 1-2 天 新手友好度 55/100
-
bug
难度 4/5 3-5 天 新手友好度 47/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
bluesky-social/social-app#12545 ·
维护者通常 1 天内回复
-
refactor topic-architecture topic-ui
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
manjaro-sway/manjaro-sway#1079 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
linux-test-project/lcov#579 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100