Fix build regression for ARM.
authorBen Pye <ben@curlybracket.co.uk>
Thu, 27 Aug 2015 03:27:46 +0000 (04:27 +0100)
committerBen Pye <ben@curlybracket.co.uk>
Thu, 27 Aug 2015 14:50:45 +0000 (15:50 +0100)
Allow mscorlib.dll to be built for non x64 platforms on Linux.

build.sh
src/pal/inc/pal_mstypes.h

index f3cbb11..56fa09a 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -134,7 +134,7 @@ build_mscorlib()
     fi
 
     # Invoke MSBuild
-    mono "$__MSBuildPath" /nologo "$__ProjectRoot/build.proj" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__LogsDir/MSCorLib_$__BuildOS__$__BuildArch__$__BuildType.log" /t:Build /p:OSGroup=$__BuildOS /p:BuildOS=$__BuildOS /p:UseRoslynCompiler=true /p:BuildNugetPackage=false
+    mono "$__MSBuildPath" /nologo "$__ProjectRoot/build.proj" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__LogsDir/MSCorLib_$__BuildOS__$__BuildArch__$__BuildType.log" /t:Build /p:OSGroup=$__BuildOS /p:BuildOS=$__BuildOS /p:BuildArch=$__MSBuildBuildArch /p:UseRoslynCompiler=true /p:BuildNugetPackage=false
 }
 
 echo "Commencing CoreCLR Repo build"
index 8a50c0e..3167625 100644 (file)
@@ -72,10 +72,11 @@ extern "C" {
 #define _cdecl
 #define CDECL
 
-#ifndef PAL_STDCPP_COMPAT
+// On ARM __fastcall is ignored and causes a compile error
+#if !defined(PAL_STDCPP_COMPAT) || defined(__arm__)
 #define __fastcall
 #define _fastcall
-#endif // PAL_STDCPP_COMPAT
+#endif // !defined(PAL_STDCPP_COMPAT) || defined(__arm__)
 
 #endif  // !defined(__i386__)
 
@@ -594,7 +595,12 @@ typedef LONG_PTR LPARAM;
 
 #ifdef PAL_STDCPP_COMPAT
 
+#ifdef BIT64
 typedef unsigned long int uintptr_t;
+#else // !BIT64
+typedef unsigned int uintptr_t;
+#endif // !BIT64
+
 typedef char16_t WCHAR;
 
 #else // PAL_STDCPP_COMPAT