[PATCH] D117263: [CMake] Support runtimes targets without specifying triple

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 18:50:36 PST 2022


phosek added a comment.

Another point I'd also add is that using `CMAKE_{ASM,C,CXX}_COMPILER_TARGET` as we do today isn't always sufficient. We ran into this recently on Windows. The problem is that CMake only processes `CMAKE_{ASM,C,CXX}_COMPILER_TARGET` after it does compiler detection, but in the case of Clang, `--target=` option changes the compiler behavior which can throw CMake compiler detection off. Specifically on Windows, CMake would detect Clang as "clang-cl in GNU compatibility mode" and to workaround it, we had to start passing `--target=` manually via `CMAKE_{ASM,C,CXX}_FLAGS` so the target triple handling runtimes build does right now looses some of its value. I'd more inclined to just deprecate it and require users to set those flags manually, but I'm not sure if that's feasible at this point since it'd be a breaking change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117263/new/

https://reviews.llvm.org/D117263



More information about the llvm-commits mailing list