vzakhari added inline comments.
================ Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:226 + // Add this function to global destructors. + appendToGlobalDtors(M, Func, 0); + } ---------------- 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. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64943/new/ https://reviews.llvm.org/D64943 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits