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

Aperta
#2,263 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@Sharjeel-Khan ci sta già lavorando.

Dal 2/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, cmake
Ambito
build-system

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Nessun dato sulla lingua
Stelle
2.3k
Fork
311
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di android/ndk

Tutte le issue di android/ndk

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.