summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPierre Moreau <dev@pmoreau.org>2018-02-13 22:47:15 +0100
committerDavid Neto <dneto@google.com>2018-02-27 12:21:13 -0500
commitbdd6617faae5f9fa962ad73d36b70223c1dcf682 (patch)
treea80940da98ae2643a01b3b0c7a22cf224d29f052 /tools
parent64298bfd15ab1aa59328f3ffdccc861cbfc35ea7 (diff)
downloadSPIRV-Tools-bdd6617faae5f9fa962ad73d36b70223c1dcf682.tar.gz
SPIRV-Tools-bdd6617faae5f9fa962ad73d36b70223c1dcf682.tar.bz2
SPIRV-Tools-bdd6617faae5f9fa962ad73d36b70223c1dcf682.zip
linker: Allow modules to be partially linked
Fixes: https://github.com/KhronosGroup/SPIRV-Tools/issues/1144
Diffstat (limited to 'tools')
-rw-r--r--tools/link/linker.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/link/linker.cpp b/tools/link/linker.cpp
index b9afe1fa..fb44a37a 100644
--- a/tools/link/linker.cpp
+++ b/tools/link/linker.cpp
@@ -33,13 +33,14 @@ The SPIR-V binaries are read from the different <filename>.
NOTE: The linker is a work in progress.
Options:
- -h, --help Print this help.
- -o Name of the resulting linked SPIR-V binary.
- --create-library Link the binaries into a library, keeping all exported symbols.
- --verify-ids Verify that IDs in the resulting modules are truly unique.
- --version Display linker version information
- --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2|opencl2.1|opencl2.2}
- Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2/OpenCL-2.1/OpenCL2.2 validation rules.
+ -h, --help Print this help.
+ -o Name of the resulting linked SPIR-V binary.
+ --create-library Link the binaries into a library, keeping all exported symbols.
+ --allow-partial-linkage Allow partial linkage by accepting imported symbols to be unresolved.
+ --verify-ids Verify that IDs in the resulting modules are truly unique.
+ --version Display linker version information
+ --target-env {vulkan1.0|spv1.0|spv1.1|spv1.2|opencl2.1|opencl2.2}
+ Use Vulkan1.0/SPIR-V1.0/SPIR-V1.1/SPIR-V1.2/OpenCL-2.1/OpenCL2.2 validation rules.
)",
argv0, argv0);
}
@@ -73,6 +74,8 @@ int main(int argc, char** argv) {
options.SetCreateLibrary(true);
} else if (0 == strcmp(cur_arg, "--verify-ids")) {
options.SetVerifyIds(true);
+ } else if (0 == strcmp(cur_arg, "--allow-partial-linkage")) {
+ options.SetAllowPartialLinkage(true);
} else if (0 == strcmp(cur_arg, "--version")) {
printf("%s\n", spvSoftwareVersionDetailsString());
// TODO(dneto): Add OpenCL 2.2 at least.