[clang] [Driver][HIP] Do not pass -dependency-file flag for HIP Device offloading (PR #125646)

Rainer Orth via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 08:08:23 PST 2025


rorth wrote:

When comparing the `clang` invocations between Solaris/amd64 (test `PASS`es) and Solaris/sparcv9 (test `FAIL`s), I find this crucial difference:
```
-"-funwind-tables=2"
-"-target-cpu"
-"x86-64"
-"-tune-cpu"
-"generic"
+"-mfloat-abi"
+"hard"
```
Looking closer, `-target-cpu` is only printed in `clang/lib/Driver/ToolChains/Clang.cpp` (`Clang::RenderTargetOptions`) iff `!CPU.empty()`.  However, in `clang/lib/Driver/ToolChains/Arch/Sparc.cpp` (`sparc::getSparcTargetCPU`) returns the empty string for a default SPARC V9 compilation.

So expecting `-target-cpu` to always be present is a fallacy if not specifying a specific target.  If doing so (and this should be some `x86_64` target obviously), the tests needs to ascertain that the `clang` under test is built with `x86_64` support using `REQUIRES: x86-registered-target`.

https://github.com/llvm/llvm-project/pull/125646


More information about the cfe-commits mailing list