[all-commits] [llvm/llvm-project] 99951a: OpenMP: Fix object clobbering issue when using sav...

pdhaliwal-amd via All-commits all-commits at lists.llvm.org
Wed Feb 24 21:51:15 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99951aa68da3c85ba03edf977cd9b22458aae6ca
      https://github.com/llvm/llvm-project/commit/99951aa68da3c85ba03edf977cd9b22458aae6ca
  Author: Pushpinder Singh <Pushpinder.Singh at amd.com>
  Date:   2021-02-25 (Thu, 25 Feb 2021)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/openmp-offload-gpu.c

  Log Message:
  -----------
  OpenMP: Fix object clobbering issue when using save-temps

There are two preconditions to reproduce the issue,
 1. Use -save-temps option
 2. 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 .

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97273




More information about the All-commits mailing list