aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorChristian Sigg <csigg@google.com>2021-01-11 13:04:09 +0100
committerChristian Sigg <csigg@google.com>2021-01-20 12:10:16 +0100
commitcf50f4f764566a78da8c0551f853118fe604d8d7 (patch)
treec2323b8e7008cf1a43aa2e6b743bbe2f1daed249 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent29aaae281403c3ab26a4e87fe37a69e1b810e0f2 (diff)
downloadllvm-cf50f4f764566a78da8c0551f853118fe604d8d7.zip
llvm-cf50f4f764566a78da8c0551f853118fe604d8d7.tar.gz
llvm-cf50f4f764566a78da8c0551f853118fe604d8d7.tar.bz2
[mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers.
The runtime-wrappers depend on LLVMSupport, pulling in static initialization code (e.g. command line arguments). Dynamically loading multiple such libraries results in ODR violoations. So far this has not been an issue, but in D94421, I would like to load both the async-runtime and the cuda-runtime-wrappers as part of a cuda-runner integration test. When doing this, code that asserts that an option category is only registered once fails (note that I've only experienced this in Google's bazel where the async-runtime depends on LLVMSupport, but a similar issue would happen in cmake if more than one runtime-wrapper starts to depend on LLVMSupport). The underlying issue is that we have a mix of static and dynamic linking. If all dependencies were loaded as shared objects (i.e. if LLVMSupport was linked dynamically to the runtime wrappers), each dependency would only get loaded once. However, linking dependencies dynamically would require special attention to paths (one could dynamically load the dependencies first given explicit paths). The simpler approach seems to be to link all dependencies statically into a single shared object. This change basically applies the same logic that we have in the c_runner_utils: we have a shared object target that can be loaded dynamically, and we have a static library target that can be linked to other runtime-wrapper shared object targets. Reviewed By: herhut Differential Revision: https://reviews.llvm.org/D94399
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions