lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.22k stars 143 forks source link

wchar_size #676

Closed Pigrecos closed 12 months ago

Pigrecos commented 12 months ago

compilation with clang 16 under windows with vs code:

[main] Building folder: remill amd64_avx [build] Starting build [proc] Executing command: D:\MSys2\clang64\bin\cmake.EXE --build /build/remill --config Release --target amd64_avx [build] [1/5] Building BC object /build/remill/lib/Arch/X86/Runtime/amd64_avx_HyperCall.cpp.bc [build] [2/5] Building BC object /build/remill/lib/Arch/X86/Runtime/amd64_avx_Intrinsics.cpp.bc [build] [3/5] Building BC object /build/remill/lib/Arch/X86/Runtime/amd64_avx_BasicBlock.cpp.bc [build] [4/5] Building BC object /build/remill/lib/Arch/X86/Runtime/amd64_avx_Instructions.cpp.bc [build] [5/5] Linking BC runtime /build/remill/lib/Arch/X86/Runtime/amd64_avx.bc [build] FAILED: lib/Arch/X86/Runtime/amd64_avx.bc /build/remill/lib/Arch/X86/Runtime/amd64_avx.bc [build] cmd.exe /C "cd /D \build\remill\lib\Arch\X86\Runtime && D:\cxx-common\Deps\installed\x64-windows-static-md-rel\bin\llvm-link.exe --suppress-warnings /build/remill/lib/Arch/X86/Runtime/amd64_avx_Instructions.cpp.bc /build/remill/lib/Arch/X86/Runtime/amd64_avx_BasicBlock.cpp.bc /build/remill/lib/Arch/X86/Runtime/amd64_avx_Intrinsics.cpp.bc /build/remill/lib/Arch/X86/Runtime/amd64_avx_HyperCall.cpp.bc -o /build/remill/lib/Arch/X86/Runtime/amd64_avx.bc" [build] error: linking module flags 'wchar_size': IDs have conflicting values in '/build/remill/lib/Arch/X86/Runtime/amd64_avx_HyperCall.cpp.bc' and 'llvm-link' [build] ninja: build stopped: subcommand failed. [proc] The command: D:\MSys2\clang64\bin\cmake.EXE --build /build/remill --config Release --target amd64_avx exited with code: 1 [driver] Build completed: 00:00:20.676

add -fshort-wchar to makefilelists # Clang-specific warnings/error options if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") target_compile_options(remill_settings INTERFACE -Wgnu-alignof-expression -Wno-gnu-anonymous-struct -Wno-gnu-designator -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-statement-expression -fno-aligned-allocation -fshort-wchar ) but it still fails

Pigrecos commented 12 months ago

In BCCompiler.cmake add -fshort-wchar set(DEFAULT_BC_COMPILER_FLAGS -emit-llvm -Wno-unknown-warning-option -Wall -Wshadow -Wconversion -Wpadded -pedantic -Wshorten-64-to-32 -Wgnu-alignof-expression -Wno-gnu-anonymous-struct -Wno-return-type-c-linkage -Wno-gnu-zero-variadic-macro-arguments -Wno-nested-anon-types -Wno-extended-offsetof -Wno-gnu-statement-expression -Wno-c99-extensions -Wno-ignored-attributes -fno-vectorize -fno-slp-vectorize -Wno-variadic-macros -Wno-c11-extensions -Wno-c++11-extensions -ffreestanding -fno-common -fno-builtin -fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables -Wno-unneeded-internal-declaration -Wno-unused-function -Wgnu-inline-cpp-without-extern -Wno-pass-failed=transform-warning -fshort-wchar ${EXTRA_BC_SYSROOT} )