[HIP] Fix -fgpu-rdc for Windows
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Thu, 2 Dec 2021 22:49:36 +0000 (17:49 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Mon, 6 Dec 2021 21:42:23 +0000 (16:42 -0500)
commit3b172f60c6926b43f87de1eaa3fa4c873bdb6de4
treea57fbfa7482bce197fb9ce11471e53ed3447e3e6
parent6622c1411339488aa086704ac3fad3b040604dff
[HIP] Fix -fgpu-rdc for Windows

This patch fixes issues for -fgpu-rdc for Windows MSVC
toolchain:

Fix COFF specific section flags and remove section types
in llvm-mc input file for Windows.

Escape fatbin path in llvm-mc input file.

Add -triple option to llvm-mc.

Put __hip_gpubin_handle in comdat when it has linkonce_odr
linkage.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D115039
clang/lib/CodeGen/CGCUDANV.cpp
clang/lib/Driver/ToolChains/HIP.cpp
clang/test/CodeGenCUDA/device-stub.cu
clang/test/Driver/hip-toolchain-rdc.hip