There are two preconditions to reproduce the issue,
- Use -save-temps option
- Provide the -o option with name equal to the input file name without the file extension. For e.g. clang a.c -o a
With the -o specified, the AssembleJobAction after OffloadWrapperJobAction
will produce the object file with same name as host code object file.
Due to this clash, the OffloadWrapperAction overwrites the initial host
object file, which results in lld error. This also fixes the multiple definition of __dummy.omp_offloading.entry' issue in D96769 .