juggle mimalloc.o to the beginning

This commit is contained in:
Marc Henderkes
2025-03-20 07:27:38 +01:00
parent 92470a35da
commit 0ce2c894e9
2 changed files with 13 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ class SPCConfigUtil
if ($this->builder->hasCpp()) {
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
}
// mimalloc must come first
if (str_contains($libs, BUILD_LIB_PATH . '/mimalloc.o')) {
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
}
return [
'cflags' => $cflags,
'ldflags' => $ldflags,