[HIP] Fix -mllvm option for device lld linker
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Thu, 29 Jun 2023 20:02:13 +0000 (16:02 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Fri, 30 Jun 2023 16:54:38 +0000 (12:54 -0400)
commitaa964f157f9b50fab3895afbfda6e0915cf6bb4a
tree61693f6983e9146308733a9a1d9c220c828b27ec
parent40bb302c451ec1a8f6a2b8238e0a56448b8e1a12
[HIP] Fix -mllvm option for device lld linker

currently clang passes -mllvm options to the device lld linker plugin
when compiling HIP. This is against default clang behavior
which is only passing -mllvm options to linker plugin specified through -Wl
options. This patch lets clang only pass -Xoffload-linker -mllvm= options
to device lld linker plugin.

Fixes: https://github.com/llvm/llvm-project/issues/63604

Reviewed by: Joseph Huber, Matt Arsenault

Differential Revision: https://reviews.llvm.org/D154145
clang/lib/Driver/ToolChains/HIPAMD.cpp
clang/test/Driver/hip-toolchain-mllvm.hip