Unix/Build: use -fsigned-char
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 4 May 2016 04:28:31 +0000 (13:28 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 4 May 2016 04:30:29 +0000 (13:30 +0900)
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 <myungjoo.ham@samsung.com>
compileoptions.cmake

index 739b1a2..bda438e 100644 (file)
@@ -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)