Skip to content

Commit 3b805fa

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
DynamicShim for dlsym user (#3136)
Summary: Add a shim layer so that users just need the header and load the symbol with dlsym. we will have two libraries: - header, where declarations and class (shim) are to be compiled with their codebase statically. Want to keep this minimal. - implementation, which pulls in the ET libraries and shim implementation. It’s compiled separately as a .so file and they can load and find symbols with dlopen and dlsym. Note that users only need to compile the header dynamic_shim.h into their code in compile time. dynamic_shim.h contains minimal dependency from ExecuTorch, so it won't impact static time binary size or startup time. The actual implementation dynamic_shim_impl is compiled into a separate shared library, which has all the ExecuTorch libraries. The shared library can be loaded later with dlopen. For users, they can now only load the so library, and just use dysym to look for exposed API `create_executorch_dynamic_shim` and `free_executorch_dynamic_shim`, and use API code in DynamicShim (as a pointer to an interface), and the DynamicShimImpl will invoke the actual ET Module code in its implementation details. Differential Revision: D55025594
1 parent cb77763 commit 3b805fa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runtime/core/portable_type/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def define_common_targets():
4949
"bits_types.h",
5050
],
5151
visibility = [
52+
"//executorch/extension/fb/dynamic_shim/...",
5253
"//executorch/runtime/core/exec_aten/util/...",
5354
"//executorch/kernels/...",
5455
],

0 commit comments

Comments
 (0)