Skip to content

fix: compile test-fork-locks as C++ under MI_USE_CXX (#619) - #623

Merged
zackees merged 1 commit into
mainfrom
fix/619-fork-locks-cxx-link
Oct 23, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/619-fork-locks-cxx-link

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Closes #619.

With -DMI_USE_CXX=ON the library sources are compiled as C++, so _mi_test_*_heaps_lock* hooks are exported mangled; test-fork-locks.c was still compiled as C and failed to link. It is now in the same LANGUAGE CXX list as the other tests that include mimalloc/internal.h.

Verified locally (Linux gcc, Debug, MI_USE_CXX=ON): builds; test-fork-locks, -prof-env, -spawn-prof-env pass. Default (C) build unaffected — the change is inside if(MI_USE_CXX).

The library is compiled as C++ with MI_USE_CXX=ON, so the MI_DEBUG test
hooks from internal.h are exported with C++ linkage; the test was still
compiled as C and failed to link. Add it to the LANGUAGE CXX list like the
other internal.h-using tests.

Local-Gate: v1 tree=f31954c4603d558eb5ed8253fb93089ebe2c9078 secs=59 lanes=lint:run
Ci-Attestation: {"at":1792798621,"gate":"python/all/lint","host":"linux-x86_64","key":"217f3299a4ee3b2eb60995d8d8a267718740750b7d00f7bfd7de1ba459fa8d06","lane":"lint","parents":["aaef948845f03eecd7e80b29196a4e891bf55444"],"secs":59,"stamp":"9819106f71bf22a4512e74502602d4ad","tree":"f31954c4603d558eb5ed8253fb93089ebe2c9078","v":1,"via":"run"}
@zackees
zackees force-pushed the fix/619-fork-locks-cxx-link branch from e4b7866 to 628da79 Compare October 23, 2026 23:37
@zackees
zackees merged commit 78a4dda into main Oct 23, 2026
64 checks passed
zackees added a commit that referenced this pull request Oct 25, 2026
* fix: give the fork-lock test hooks C linkage (#619)

Wrap the MI_DEBUG heaps-lock test hooks in extern "C", matching the other
test hooks in internal.h, so test-fork-locks.c links as C whether or not the
library is compiled as C++. Reverts #623's compile-test-as-C++ workaround.

* build: regenerate vendor C for #619 extern "C" hooks

Local-Gate: v1 tree=d2a10acfef865c6dfea38201230f9c0368efb86d secs=59 lanes=lint:run
Ci-Attestation: {"at":1792965286,"gate":"python/all/lint","host":"linux-x86_64","key":"ce16a1154e5cad93293e2e09c3e87dae0d737ffe74c64db4967e7d26bc85ea19","lane":"lint","parents":["eea8867618915649c03188db161d45226d37ab5d"],"secs":59,"stamp":"a8b2323b2cfbe651cf265bc41a491760","tree":"d2a10acfef865c6dfea38201230f9c0368efb86d","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test-fork-locks fails to link under MI_USE_CXX (C++ linkage of _mi_test_* hooks)

1 participant