Skip to content

Commit 127d999

Browse files
kddnewtonmeta-codesync[bot]
authored andcommitted
Give CinderX's vendored asmjit a private ABI namespace
Summary: CinderX vendors its own copy of `asmjit`, while APF/Torch can also pull in `fbsource//third-party/asmjit:asmjit` through `//caffe2:_torch` and FBGEMM. The APF blame task `T277711004` showed `cxx_link_python_exe` failures such as `fbcode//apf/plugin/tests:no_op_gpu_tracer_test`, where `//apf/plugin:no_op_gpu_tracer` depends on `:interfaces`, `interfaces.py` imports `torch`, `:interfaces` depends on `//caffe2:_torch`, and FBGEMM exports the repo-level `asmjit`. After `D109607577`, CinderX `code_allocator.cpp` calls the new out-of-line `CodeHolder::ensureBranchStubIslands()` method, which forced the CinderX vendored `asmjit` archive to contribute `codeholder.cpp.pic.o` during links that already included the repo-level `asmjit` archive. Both copies used the default `asmjit::_abi_1_13` inline namespace, so the linker saw duplicate definitions for `asmjit::_abi_1_13::CodeHolder` methods. Change only the CinderX vendored default `ASMJIT_ABI_NAMESPACE` to `_cinderx_abi_1_13`. AsmJit explicitly supports overriding this namespace for projects that embed multiple copies, and this keeps CinderX symbols distinct from the repo-level third-party `asmjit` symbols while preserving CinderX source compatibility through the inline namespace. Reviewed By: Yhg1s Differential Revision: D110116689 fbshipit-source-id: 7308cd6f40216ec6d63d76ba8a6af3400f1baf8e
1 parent 588af0f commit 127d999

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cinderx/ThirdParty/asmjit/src/asmjit/core/api-config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! AsmJit default, which makes it possible to use multiple AsmJit libraries within a single project, totally
2828
//! controlled by users. This is useful especially in cases in which some of such library comes from third party.
2929
#if !defined(ASMJIT_ABI_NAMESPACE)
30-
#define ASMJIT_ABI_NAMESPACE _abi_1_13
30+
#define ASMJIT_ABI_NAMESPACE _cinderx_abi_1_13
3131
#endif // !ASMJIT_ABI_NAMESPACE
3232

3333
//! \}

0 commit comments

Comments
 (0)