[PATCH] D71786: [Support] On Windows, add optional support for {rpmalloc|snmalloc|mimalloc}

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 08:10:51 PDT 2020


hans added a comment.

I've been trying to use this, but not with much luck so far.

Using rpmalloc (I used version 1.4.1), llvm-lld hangs during clang bootstrap in different stages of the build - sometimes already during the cmake invocation. I'm not sure what's going on there - it's not using a lot of memory or anything - but would be curious to find out.

Trying to use snmalloc, it doesn't build because the /std:c++17 flag doesn't actually seem to get applied to the snmalloc files:

  C:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\a687d8e2e4114d9015eb550e1b156af21381faac\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\Support -IC:\src\chromium\src\third_party\llvm\llvm\lib\Support -Iinclude -IC:\src\chromium\src\third_party\llvm\llvm\include -IC:\src\chromium\src\third_party\llvm-build-tools\zlib-1.2.11 -IC:\src\chromium\src\third_party\llvm-build-tools\zlib-1.2.11 /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast /bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MT /O2 /Ob2   -UNDEBUG -std:c++14 /showIncludes /Folib\Support\CMakeFiles\LLVMSupport.dir\C_\src\chromium\src\third_party\llvm-build-tools\snmalloc\src\override\malloc.cc.obj /Fdlib\Support\CMakeFiles\LLVMSupport.dir\LLVMSupport.pdb /FS -c C:\src\chromium\src\third_party\llvm-build-tools\snmalloc\src\override\malloc.cc
  C:\src\chromium\src\third_party\llvm-build-tools\snmalloc\src\ds\../aal/aal.h(178): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'

but the flag does get applied to other files (because of PARENT_SCOPE?), although the compiler warns that it gets overridden by a later -std:c++14 flag:

  [127/3104] Building CXX object lib\TableGen\CMakeFiles\LLVMTableGen.dir\StringMatcher.cpp.obj
   cl : Command line warning D9025 : overriding '/std:c++17' with '/std:c++14'

Maybe it would be better to try to override CXX_STANDARD instead of setting the flag?

Using mimalloc doesn't look appealing right now since the cmake file expects to be pointed at a .lib file built with a patch applied. But hopefully they'll fix https://github.com/microsoft/mimalloc/issues/268 at some point :-)

I'll keep tinkering, just wanted to report my findings so far.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71786/new/

https://reviews.llvm.org/D71786



More information about the llvm-commits mailing list