[OpenMP] Add `-Xoffload-linker` to forward input to the device linker
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 23 May 2022 21:51:30 +0000 (17:51 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 24 May 2022 13:11:02 +0000 (09:11 -0400)
commitf37101983fc9fabbbde4b10f613ed248a424d71a
treed44c3e2e0d969e1ed9253e72fb86bdaf24207d08
parentf9c806ae5c53c990a935c46ba351cdcfb1271c58
[OpenMP] Add `-Xoffload-linker` to forward input to the device linker

We use the clang-linker-wrapper to perform device linking of embedded
offloading object files. This is done by generating those jobs inside of
the linker-wrapper itself. This patch adds an argument in Clang and the
linker-wrapper that allows users to forward input to the device linking
phase. This can either be done for every device linker, or for a
specific target triple. We use the `-Xoffload-linker <arg>` and the
`-Xoffload-linker-<triple> <arg>` syntax to accomplish this.

Reviewed By: markdewing, tra

Differential Revision: https://reviews.llvm.org/D126226
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/linker-wrapper.c
clang/test/Driver/openmp-offload-gpu-new.c
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp