#-fms-compatibility Enable full Microsoft Visual C++ compatibility
#-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler
+ # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around
+ # using twos-complement representation (this is normally undefined according to the C++ spec).
+ add_compile_options(-fwrapv)
+
if(CLR_CMAKE_PLATFORM_DARWIN)
# We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)
add_compile_options(-fstack-protector)
# may not generate the same object layout as MSVC.
add_compile_options(-Wno-incompatible-ms-struct)
+ # Some architectures (e.g., ARM) assume char type is unsigned while CoreCLR assumes char is signed
+ # as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746)
+ add_compile_options(-fsigned-char)
endif(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_UNIX_ARM)
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
if(ARM_SOFTFP)
+ add_definitions(-DARM_SOFTFP)
add_compile_options(-mfloat-abi=softfp)
add_compile_options(-target armv7-linux-gnueabi)
else()
add_compile_options(/Zm200) # Specify Precompiled Header Memory Allocation Limit of 150MB
add_compile_options(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640)
add_compile_options(/Zi) # enable debugging information
+ add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files.
if (CLR_CMAKE_PLATFORM_ARCH_I386)
add_compile_options(/Gz)
add_compile_options($<$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>:/MT>)
add_compile_options($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:/MTd>)
+ set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /ZH:SHA_256")
+
endif (WIN32)
if(CMAKE_ENABLE_CODE_COVERAGE)