[CI] Workaround relocation truncated to fit: R_AARCH64_CALL26 linker error (#169723)

By using `-mno-outline-atomics` compiler option, that will embed atomic instructions, instead of inserting `__aarch64_swp4_relax` call
Pull Request resolved: https://github.com/pytorch/pytorch/pull/169723
Approved by: https://github.com/huydhn
This commit is contained in:
Nikita Shulga
2025-12-05 17:01:17 -08:00
committed by PyTorch MergeBot
parent 4bebe21b05
commit 975d4b02bc

View File

@@ -1169,6 +1169,12 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
# Suppress warning to unblock libnop compilation by clang-17
# See https://github.com/pytorch/pytorch/issues/151316
target_compile_options_if_supported(tensorpipe -Wno-missing-template-arg-list-after-template-kw)
# Workaround for relocation truncated to fit: R_AARCH64_CALL26 against symbol __aarch64_swp4_relax'
# When compiling for ARMv8.0, build uv with embedded atomics, which are slightly slower
# But are used only once during shutdown
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
target_compile_options_if_supported(tensorpipe_uv -mno-outline-atomics)
endif()
list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
list(APPEND Caffe2_DEPENDENCY_LIBS nlohmann)