Commit eb8fbf5
Automerge: [clang][Driver] Fix crash in --offload-new-driver and -save-temps. (#165606)
`clang -x hip foo.c --offload-arch=amdgcnspirv --offload-new-driver
-save-temps` was crashing with the following error:
```
/usr/bin/ld: input file 'foo-x86_64-unknown-linux-gnu.o' is the same as output file
build/bin/clang-linker-wrapper: error: 'ld' failed
```
The `LinkerWrapperJobAction` [is
created](https://github.com/llvm/llvm-project/blob/957598f71bd8baa029d886e59ed9aed60e6e9bb9/clang/lib/Driver/Driver.cpp#L4888)
with `types::TY_Object` which makes `Driver::GetNamedOutputPath` assign
the same name as the assembler's output and thus causing the crash.File tree
2 files changed
+19
-3
lines changed- clang
- lib/Driver
- test/Driver
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6466 | 6466 | | |
6467 | 6467 | | |
6468 | 6468 | | |
6469 | | - | |
6470 | | - | |
6471 | | - | |
| 6469 | + | |
| 6470 | + | |
| 6471 | + | |
| 6472 | + | |
| 6473 | + | |
| 6474 | + | |
| 6475 | + | |
| 6476 | + | |
| 6477 | + | |
| 6478 | + | |
6472 | 6479 | | |
6473 | 6480 | | |
6474 | 6481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments