[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'

オープン
#2,263 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@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 の本文から書いたものです。

説明

bug
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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

android/ndk のほかの issue

android/ndk の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。