mcsema icon indicating copy to clipboard operation
mcsema copied to clipboard

mcsema_rt builds are broken on Windows

Open vient opened this issue 5 years ago • 1 comments

There are multiple problems with both x86 and x64 builds, and I don't know how to deal with them all.

First of all, x86 build:

  1. It seems that C++ standard set in mcsema/Arch/X86/Runtime/CMakeLists.txt, gnu++11, is wrong. I tried c++17 but finally c++14 worked.
  2. In the same place, option -fPIC is not supported by Clang on Windows. I don't know if it is necessary on other platforms or not, on Windows deleting it fixed the problem.
  3. I had some weird problem in the STL itself: some obscure file ...\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include\yvals_core.h was complaining that my Clang version is less than 9, although it was 9.0.0. I worked it out but commenting out this #error line.

After performing these fixes I got a successful x86 build. Since I only tested it on Windows, and I am not sure about these fixes, and I don't know how to fix 3 in mcsema itself, I didn't make a PR.

x64 build: I didn't need it, so I didn't try to solve the error(s). The only one shown to me right now is remill\tools\mcsema\mcsema\Arch\X86\Runtime\print_PE_64_windows.cpp(68,43): error : use of undeclared identifier 'RegState', which blocks the build.

I have latest Visual Studio 2019. I didn't manage to work with it though, so I also downloaded latest Build Tools for Visual Studio 2019. Source code version is also latest (e626fb86).

vient avatar Apr 30 '20 20:04 vient

Thank for the tips! We have not had much time to dedicate to Windows builds but I do hope to get them running with modern LLVMs again.

artemdinaburg avatar May 25 '20 05:05 artemdinaburg