[PATCH] D71786: RFC: [Support] On Windows, add optional support for rpmalloc

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 20:53:19 PST 2020


aganea added a comment.

In D71786#1801275 <https://reviews.llvm.org/D71786#1801275>, @russell.gallop wrote:

> It fails creating a library


This use-case is supported (using both Visual Studio 2017 and 2019). The error you're seeing most likely occurs because of the OBJs link order. I would assume a symbol gets pulled, and somehow `link.exe` considers `libucrt.lib` first, before `LLVMSupport.lib` (where our `malloc` override is).

Could you please run `ninja -v`, and ensure `LLVMSupport.lib` appears at first on the linker cmd-line? (before other libs).
Now add `/INCLUDE:malloc` to the link cmd-line and re-run it, see if that fixes the issue. That will force the `malloc` symbol to be processed first, and consequently to consider  
`LLVMSupport.lib` before any `#pragma comment(linker, "/defaultlib:libucrt.lib")` directive is encountered.

If nothing works, could you please post the exact cmake cmd-line you're running, along with the version for Visual Studio and the Windows Kit? It'd be interesting also to have an output of that linker cmd-line by running again with `/VERBOSE`, so I can see how `malloc` is pulled from `libucrt.lib`.


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