@@ -10,44 +10,56 @@ Clang Linker Wrapper
10
10
Introduction
11
11
============
12
12
13
- This tool works as a wrapper over a linking job. The tool is used to create
14
- linked device images for offloading. It scans the linker's input for embedded
15
- device offloading data stored in sections ``.llvm.offloading.<triple>.<arch> ``
16
- and extracts it as a temporary file. The extracted device files will then be
17
- passed to a device linking job to create a final device image. The sections will
18
- also be stripped and the resulting file passed back to the host linker.
13
+ This tool works as a wrapper of the normal host linking job. This tool is used
14
+ to create linked device images for offloading and the necessary runtime calls to
15
+ register them. It works by first scanning the linker's input for embedded device
16
+ offloading data stored at the ``.llvm.offloading `` section. This section
17
+ contains binary data created by the :doc: `ClangOffloadPackager `. The extracted
18
+ device files will then be linked. The linked modules will then be wrapped into a
19
+ new object file containing the code necessary to register it with the offloading
20
+ runtime.
19
21
20
22
Usage
21
23
=====
22
24
23
- This tool can be used with the following options. Arguments to the host linker
24
- being wrapper around are passed as positional arguments using the ``-- `` flag to
25
- override parsing.
25
+ This tool can be used with the following options. Any arguments not intended
26
+ only for the linker wrapper will be forwarded to the wrapped linker job.
26
27
27
28
.. code-block :: console
28
29
29
- USAGE: clang-linker-wrapper [options] <options to be passed to linker>...
30
+ USAGE: clang-linker-wrapper [options] -- <options to passed to the linker>
30
31
31
32
OPTIONS:
32
-
33
- Generic Options:
34
-
35
- --help - Display available options (--help-hidden for more)
36
- --help-list - Display list of available options (--help-list-hidden for more)
37
- --version - Display the version of this program
38
-
39
- clang-linker-wrapper options:
40
-
41
- --host-triple=<string> - Triple to use for the host compilation
42
- --linker-path=<string> - Path of linker binary
43
- --opt-level=<string> - Optimization level for LTO
44
- --ptxas-option=<string> - Argument to pass to the ptxas invocation
45
- --save-temps - Save intermediary results.
46
- --strip-sections - Strip offloading sections from the host object file.
47
- --target-embed-bc - Embed linked bitcode instead of an executable device image
48
- --target-feature=<string> - Target features for triple
49
- --bitcode-library=<string> - Path for the target bitcode library
50
- -v - Verbose output from tools
33
+ --bitcode-library=<kind>-<triple>-<arch>=<path>
34
+ Extra bitcode library to link
35
+ --cuda-path=<dir> Set the system CUDA path
36
+ --device-debug Use debugging
37
+ --device-linker=<value> or <triple>=<value>
38
+ Arguments to pass to the device linker invocation
39
+ --dry-run Print program arguments without running
40
+ --embed-bitcode Embed linked bitcode in the module
41
+ --help-hidden Display all available options
42
+ --help Display available options (--help-hidden for more)
43
+ --host-triple=<triple> Triple to use for the host compilation
44
+ --linker-path=<path> The linker executable to invoke
45
+ -L <dir> Add <dir> to the library search path
46
+ -l <libname> Search for library <libname>
47
+ --opt-level=<O0, O1, O2, or O3>
48
+ Optimization level for LTO
49
+ -o <path> Path to file to write output
50
+ --pass-remarks-analysis=<value>
51
+ Pass remarks for LTO
52
+ --pass-remarks-missed=<value>
53
+ Pass remarks for LTO
54
+ --pass-remarks=<value> Pass remarks for LTO
55
+ --print-wrapped-module Print the wrapped module's IR for testing
56
+ --ptxas-arg=<value> Argument to pass to the 'ptxas' invocation
57
+ --save-temps Save intermediate results
58
+ --sysroot<value> Set the system root
59
+ --verbose Verbose output from tools
60
+ --v Display the version number and exit
61
+ -- The separator for the wrapped linker arguments
62
+
51
63
52
64
Example
53
65
=======
@@ -59,4 +71,4 @@ section and run a device linking job on it.
59
71
60
72
.. code-block :: console
61
73
62
- clang-linker-wrapper -host-triple x86_64 -linker-path /usr/bin/ld -- <Args>
74
+ clang-linker-wrapper -- host-triple= x86_64 -- linker-path= /usr/bin/ld -- <Args>
0 commit comments