[OpenMP] Add support for extracting device code in linker wrapper
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 3 Jan 2022 17:31:52 +0000 (12:31 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 1 Feb 2022 04:11:41 +0000 (23:11 -0500)
commitb8239af0eeedfa67d9fac28d20685b7a09e2935a
tree3da41c38b437ae6fa1d45764f5bbf96e02eabc2f
parent5b2c3d7bbcda07bf89448d0ae4e43ea327d4f6ba
[OpenMP] Add support for extracting device code in linker wrapper

This patchs add support for extracting device offloading code from the
linker's input files. If the file contains a section with the name
`.llvm.offloading.<triple>.<arch>` it will be extracted to a new
temporary file to be linked. Addtionally, the host file containing it
will have the section stripped so it does not remain in the executable
once linked.

Depends on D116544

Differential Revision: https://reviews.llvm.org/D116545
clang/tools/clang-linker-wrapper/CMakeLists.txt
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp