Revert "Fix `clang-cl` and `mingw` builds"

This reverts commit add871993f.

I'll make a PR with these changes.
pull/79/head
Ionel-Cristinel ANICHITEI 1 year ago
parent add871993f
commit e67584241b

@ -35,9 +35,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif () endif ()
# These are shared by bddisasm and bdshemu. # These are shared by bddisasm and bdshemu.
if (MSVC OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") if (NOT MSVC)
set(BDDISASM_COMMON_COMPILE_OPTIONS /W4 /WX)
else ()
set(BDDISASM_COMMON_COMPILE_OPTIONS set(BDDISASM_COMMON_COMPILE_OPTIONS
"$<$<CONFIG:Release>:-U_FORTIFY_SOURCE>" "$<$<CONFIG:Release>:-U_FORTIFY_SOURCE>"
"$<$<CONFIG:Release>:-D_FORTIFY_SOURCE=2>" "$<$<CONFIG:Release>:-D_FORTIFY_SOURCE=2>"
@ -70,6 +68,8 @@ else ()
-gdwarf-4 -gdwarf-4
-grecord-gcc-switches -grecord-gcc-switches
-march=westmere) -march=westmere)
else ()
set(BDDISASM_COMMON_COMPILE_OPTIONS /W4 /WX)
endif () endif ()
set(BDDISASM_PUBLIC_HEADERS set(BDDISASM_PUBLIC_HEADERS
@ -91,7 +91,6 @@ set(BDDISASM_INSTALL_INCLUDE_DIR
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckCCompilerFlag)
add_library( add_library(
bddisasm STATIC bddisasm STATIC
@ -172,9 +171,7 @@ target_include_directories(bddisasm PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOU
target_link_libraries(bdshemu PUBLIC bddisasm) target_link_libraries(bdshemu PUBLIC bddisasm)
target_compile_options(bdshemu PRIVATE ${BDDISASM_COMMON_COMPILE_OPTIONS}) target_compile_options(bdshemu PRIVATE ${BDDISASM_COMMON_COMPILE_OPTIONS})
if (NOT MSVC)
check_c_compiler_flag(-maes HAS_MAES)
if (HAS_MAES)
target_compile_options(bdshemu PRIVATE -maes) target_compile_options(bdshemu PRIVATE -maes)
endif () endif ()

@ -3550,7 +3550,7 @@ cleanup_and_exit:
// //
// NdGetVectorLength // NdGetVectorLength
// //
static inline NDSTATUS static __forceinline NDSTATUS
NdGetVectorLength( NdGetVectorLength(
INSTRUX *Instrux INSTRUX *Instrux
) )
@ -3605,7 +3605,7 @@ NdGetVectorLength(
// //
// NdGetAddrAndOpMode // NdGetAddrAndOpMode
// //
static inline NDSTATUS static __forceinline NDSTATUS
NdGetAddrAndOpMode( NdGetAddrAndOpMode(
INSTRUX *Instrux INSTRUX *Instrux
) )
@ -3636,7 +3636,7 @@ NdGetAddrAndOpMode(
// //
// NdGetEffectiveOpMode // NdGetEffectiveOpMode
// //
static inline NDSTATUS static __forceinline NDSTATUS
NdGetEffectiveOpMode( NdGetEffectiveOpMode(
INSTRUX *Instrux INSTRUX *Instrux
) )
@ -3792,7 +3792,7 @@ NdPostProcessEvex(
// //
// NdValidateInstruction // NdValidateInstruction
// //
static inline NDSTATUS static __forceinline NDSTATUS
NdValidateInstruction( NdValidateInstruction(
INSTRUX *Instrux INSTRUX *Instrux
) )

@ -11,6 +11,10 @@
#define UNREFERENCED_PARAMETER(P) ((void)(P)) #define UNREFERENCED_PARAMETER(P) ((void)(P))
#endif #endif
#if !defined(_MSC_VER)
# define __forceinline inline __attribute__((always_inline))
#endif // _MSC_VER
// By default, an integrator is expected to provide nd_vsnprintf_s and nd_strcat_s. // By default, an integrator is expected to provide nd_vsnprintf_s and nd_strcat_s.
// bddisasm needs both for NdToText, while bdshemu needs nd_vsnprintf_s for emulation tracing. // bddisasm needs both for NdToText, while bdshemu needs nd_vsnprintf_s for emulation tracing.
// If BDDISASM_NO_FORMAT is defined at compile time these requirements are removed. Instruction formatting will no // If BDDISASM_NO_FORMAT is defined at compile time these requirements are removed. Instruction formatting will no

@ -27,21 +27,14 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
endif () endif ()
endif () endif ()
if (MSVC OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") if (NOT MSVC)
target_compile_options(disasmtool PRIVATE /W4 /WX)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(disasmtool PRIVATE -Wno-format)
endif ()
else ()
target_compile_options( target_compile_options(
disasmtool disasmtool
PRIVATE -Wall PRIVATE -Wall
-Wno-unknown-pragmas -Wno-unknown-pragmas
-Wextra -Wextra
-Wshadow -Wshadow
-Wno-format -Wformat-security
-Wno-cast-function-type
-Wstrict-overflow=2 -Wstrict-overflow=2
-Wstrict-prototypes -Wstrict-prototypes
-Wwrite-strings -Wwrite-strings
@ -53,6 +46,7 @@ else ()
-Wno-discarded-qualifiers -Wno-discarded-qualifiers
-Wnull-dereference -Wnull-dereference
-Wduplicated-cond -Wduplicated-cond
-Werror=format-security
-Werror=implicit-function-declaration -Werror=implicit-function-declaration
-pipe -pipe
-fwrapv -fwrapv
@ -65,4 +59,6 @@ else ()
-gdwarf-4 -gdwarf-4
-grecord-gcc-switches -grecord-gcc-switches
-march=westmere) -march=westmere)
else ()
target_compile_options(disasmtool PRIVATE /W4 /WX)
endif () endif ()

@ -594,7 +594,7 @@ INT32 regstr_to_idx(
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
}; };
for (INT32 i = 0; i < (INT32)ARRAYSIZE(reg64); i++) for (INT32 i = 0; i < ARRAYSIZE(reg64); i++)
{ {
if (!_stricmp(Reg, reg64[i])) if (!_stricmp(Reg, reg64[i]))
{ {
@ -1417,7 +1417,7 @@ void set_shemuctx_file(
// first element is the register // first element is the register
regIdx = regstr_to_idx(regStr); regIdx = regstr_to_idx(regStr);
if (regIdx < 0 || regIdx >= (INT32)ARRAYSIZE(Options->ShemuRegs)) if (regIdx < 0 || regIdx >= ARRAYSIZE(Options->ShemuRegs))
{ {
if (!_stricmp(regStr, "rip")) if (!_stricmp(regStr, "rip"))
{ {

Loading…
Cancel
Save