From 7f203ae2ca9f7c14239b4e7228b8f9638b3388f3 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Wed, 4 May 2016 13:28:31 +0900 Subject: [PATCH] Unix/Build: use -fsigned-char Some architectures including ARM assumes that plain char is unsigned unlike x64. Because CoreCLR has been assuming char is signed, we need to explictly tell the toolchain the signedness of char type. Fix #4746 Signed-off-by: MyungJoo Ham --- compileoptions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compileoptions.cmake b/compileoptions.cmake index 739b1a2..bda438e 100644 --- a/compileoptions.cmake +++ b/compileoptions.cmake @@ -42,6 +42,10 @@ if (CLR_CMAKE_PLATFORM_UNIX) # 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) -- 2.7.4