Revert "Consistently use c10_ovrsource in arvr mode everywhere (#164128)"

This reverts commit efd7fd5ed5ac7ec03201a546a09fb19ec59de431.

Reverted https://github.com/pytorch/pytorch/pull/164128 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](https://github.com/pytorch/pytorch/pull/164128#issuecomment-3352544006))
This commit is contained in:
PyTorch MergeBot
2025-09-30 14:43:52 +00:00
parent 79fcfd49d6
commit 0fb89b84b9
2 changed files with 4 additions and 16 deletions

View File

@ -156,7 +156,7 @@ ROOT = "//" if IS_OSS else "//xplat/caffe2"
# for targets in subfolders # for targets in subfolders
ROOT_PATH = "//" if IS_OSS else "//xplat/caffe2/" ROOT_PATH = "//" if IS_OSS else "//xplat/caffe2/"
C10 = "//c10:c10" if IS_OSS else ("//xplat/caffe2/c10:c10_ovrsource" if is_arvr_mode() else "//xplat/caffe2/c10:c10") C10 = "//c10:c10" if IS_OSS else "//xplat/caffe2/c10:c10"
# a dictionary maps third party library name to fbsource and oss target # a dictionary maps third party library name to fbsource and oss target
THIRD_PARTY_LIBS = { THIRD_PARTY_LIBS = {

View File

@ -16,21 +16,11 @@ cuda_supported_platforms = [
"ovr_config//os:windows-cuda", "ovr_config//os:windows-cuda",
] ]
# rocktenn apparently has its own copy of glog that comes with libmp.dll, so we
# had better not try to use glog from c10 lest the glog symbols not be eliminated.
C10_USE_GLOG = native.read_config("c10", "use_glog", "1") == "1"
# If you don't use any functionality that relies on static initializer in c10 (the
# most notable ones are the allocators), you can turn off link_whole this way.
# In practice, this is only used by rocktenn as well.
C10_LINK_WHOLE = native.read_config("c10", "link_whole", "1") == "1"
def define_c10_ovrsource(name, is_mobile): def define_c10_ovrsource(name, is_mobile):
pp_flags = []
if is_mobile: if is_mobile:
pp_flags.append("-DC10_MOBILE=1") pp_flags = ["-DC10_MOBILE=1"]
if C10_USE_GLOG: else:
pp_flags.append("-DC10_USE_GLOG") pp_flags = []
oxx_static_library( oxx_static_library(
name = name, name = name,
@ -41,7 +31,6 @@ def define_c10_ovrsource(name, is_mobile):
"util/*.cpp", "util/*.cpp",
]), ]),
compatible_with = cpu_supported_platforms, compatible_with = cpu_supported_platforms,
link_whole = C10_LINK_WHOLE,
compiler_flags = select({ compiler_flags = select({
"DEFAULT": [], "DEFAULT": [],
"ovr_config//compiler:cl": [ "ovr_config//compiler:cl": [
@ -88,7 +77,6 @@ def define_c10_ovrsource(name, is_mobile):
"//arvr/third-party/gflags:gflags", "//arvr/third-party/gflags:gflags",
"//third-party/cpuinfo:cpuinfo", "//third-party/cpuinfo:cpuinfo",
"//third-party/fmt:fmt", "//third-party/fmt:fmt",
# For some godforsaken reason, this is always required even when not C10_USE_GLOG
"//third-party/glog:glog", "//third-party/glog:glog",
], ],
) )