[Openmp-commits] [PATCH] D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script

Sergey Dmitriev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 7 11:37:21 PDT 2019


sdmitriev marked 3 inline comments as done.
sdmitriev added inline comments.


================
Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:226
+    // Add this function to global destructors.
+    appendToGlobalDtors(M, Func, 0);
+  }
----------------
vzakhari wrote:
> FYI, llvm.global_dtors does not work on Windows.  The symbol will be placed into .CRT$XC[A-Z] portion of .CRT in TargetLoweringObjectFileImpl.cpp, so, basically, __tgt_unregister_lib will be called right after __tgt_register_lib.  We can either use a trick from ASAN, i.e. put llvm.global_dtors into .CRT$XT[A-Z] (I am not sure how solid this solution is) or call atexit() inside __tgt_register_lib to register __tgt_unregister_lib terminator.
It works as expected on Linux, so I guess this is just a bug in lowering code for Windows that need to be fixed.


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

https://reviews.llvm.org/D64943





More information about the Openmp-commits mailing list