Skip to content

Commit f865987

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
Set kernel default visibility to hidden
Summary: When we compile the kernel into a shared library, we don't know whether the definition of kernel implementation symbol can be dropped or not based on op registry. The kernel itself is just a normal function and the user can find it. We set its visibility to hidden by default. Then these kernels are gone when we do `objdump -TC` This reduces binary size. Differential Revision: D56167833
1 parent 458d743 commit f865987

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shim/xplat/executorch/kernels/portable/op_registration_util.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
122122
fbandroid_platform_deps = android_deps,
123123
# kernels often have helpers with no prototypes just disabling the warning here as the headers
124124
# are codegend and linked in later
125-
compiler_flags = ["-Wno-missing-prototypes"],
125+
compiler_flags = ["-Wno-missing-prototypes", "-fvisibility=hidden"],
126126
deps = [
127127
"//executorch/runtime/kernel:kernel_includes" + aten_suffix,
128128
] + deps,

0 commit comments

Comments
 (0)