Skip to content

Commit

Permalink
Fix compilation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
adam committed May 19, 2023
1 parent 6feb5d0 commit e7298ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ if(WIN32)
/wd4457 /wd4458 /wd4459 /wd4503 /wd4624 /wd4722 /wd4800
/wd4100 /wd4127 /wd4512 /wd4505 /wd4610 /wd4510 /wd4702
/wd4245 /wd4706 /wd4310 /wd4701 /wd4703 /wd4389 /wd4611
/wd4805 /wd4204 /wd4577 /wd4091 /wd4592 /wd4324
/wd4805 /wd4204 /wd4577 /wd4091 /wd4592 /wd4324
-Xclang -mlong-double-80 /DLLVM_FORCE_USE_OLD_TOOLCHAIN
)

target_compile_definitions(remill_settings INTERFACE
Expand Down
3 changes: 2 additions & 1 deletion cmake/BCCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ function(add_runtime target_name)
#
# When the versions do not match, the compilation will fail; we don't really care about
# this, as the second compiler is only really used to output BC files.
set(additional_windows_settings "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
# Also set -mlong-double-80 to compile on Windows with 16 byte long double.
set(additional_windows_settings "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" "-mlong-double-80")
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand Down
2 changes: 1 addition & 1 deletion lib/BC/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ LoadModuleFromFile(llvm::LLVMContext *context,
auto module = llvm::parseIRFile(file_name.string(), err, *context);

if (!module) {
llvm::outs() << "Unable to parse module file " << file_name << ": "
llvm::outs() << "Unable to parse module file " << file_name.string() << ": "
<< err.getMessage().str();
return {};
}
Expand Down

0 comments on commit e7298ce

Please sign in to comment.