Skip to content

Commit 31e7cd3

Browse files
committed
make sure that mimalloc.o is *always* first, no matter if $_ENV['LIBS'] is set
1 parent 51ec819 commit 31e7cd3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/SPC/util/SPCConfigUtil.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,17 @@ public function config(array $extensions = [], array $libraries = [], bool $incl
102102
$libs = "-lphp {$libs} -lc";
103103
}
104104

105+
$allLibs = getenv('LIBS') . ' ' . $libs;
106+
105107
// mimalloc must come first
106108
if (str_contains($libs, BUILD_LIB_PATH . '/mimalloc.o')) {
107-
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
109+
$allLibs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $allLibs);
108110
}
109111

110112
return [
111113
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
112114
'ldflags' => trim(getenv('LDFLAGS') . ' ' . $ldflags),
113-
'libs' => trim(getenv('LIBS') . ' ' . $libs),
115+
'libs' => trim($allLibs),
114116
];
115117
}
116118

0 commit comments

Comments
 (0)