From 2df119c906645345b431952aea7b435b73f1f26d Mon Sep 17 00:00:00 2001 From: Stepan Hruda Date: Fri, 4 Apr 2025 07:50:50 -0700 Subject: [PATCH] Expose symbols on macos in the xplat pytorch stack (#9819) Summary: X-link: https://github.com/pytorch/pytorch/pull/150487 Pull Request resolved: https://github.com/pytorch/executorch/pull/9819 Had to revert D71321310 because it affected way too many targets and build sizes. These changes should expose just enough symbols to be buildable in arvr mode on macOS. Could potentially make narrow it down even more by avoiding eg `get_pt_compiler_flags` Differential Revision: D72255474 --- shim_et/xplat/executorch/build/runtime_wrapper.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shim_et/xplat/executorch/build/runtime_wrapper.bzl b/shim_et/xplat/executorch/build/runtime_wrapper.bzl index 3f9a1142b67..31aae43a69c 100644 --- a/shim_et/xplat/executorch/build/runtime_wrapper.bzl +++ b/shim_et/xplat/executorch/build/runtime_wrapper.bzl @@ -112,6 +112,11 @@ def _patch_build_mode_flags(kwargs): # @oss-disable: "ovr_config//build_mode:code-coverage": ["-D__ET_BUILD_MODE_COV=1"], }) + kwargs["compiler_flags"] = kwargs["compiler_flags"] + select({ + "DEFAULT": [], + "ovr_config//os:macos": ["-fvisibility=default"], + }) + return kwargs def _patch_test_compiler_flags(kwargs):