From a7b862acabde028be218c81950fc50dd9de2472f Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 3 Dec 2015 11:23:38 -0800 Subject: [PATCH] Update CoreCLR to a newer commit so that it will build under VS 2015 Update 1. In the process of updating the patch set to work with the newer commit, the patch set for CoreCLR was broken out into individual files to make maintaining them easier. --- .gitattributes | 1 + .gitignore | 23 +-- GetDeps.bat | 14 +- Patches/CoreCLR/CMakeLists.txt | 13 ++ Patches/CoreCLR/build.cmd | 24 +++ Patches/CoreCLR/clr.coreclr.props | 30 ++++ Patches/CoreCLR/clr.defines.targets | 13 ++ Patches/CoreCLR/clr.desktop.props | 13 ++ Patches/CoreCLR/src/CMakeLists.txt | 29 ++++ Patches/CoreCLR/src/inc/utilcode.h | 13 ++ Patches/CoreCLR/src/utilcode/CMakeLists.txt | 14 ++ Patches/CoreCLR/src/utilcode/util.cpp | 20 +++ python.diff => Patches/python.diff | 0 coreclr.diff | 166 -------------------- 14 files changed, 193 insertions(+), 180 deletions(-) create mode 100644 Patches/CoreCLR/CMakeLists.txt create mode 100644 Patches/CoreCLR/build.cmd create mode 100644 Patches/CoreCLR/clr.coreclr.props create mode 100644 Patches/CoreCLR/clr.defines.targets create mode 100644 Patches/CoreCLR/clr.desktop.props create mode 100644 Patches/CoreCLR/src/CMakeLists.txt create mode 100644 Patches/CoreCLR/src/inc/utilcode.h create mode 100644 Patches/CoreCLR/src/utilcode/CMakeLists.txt create mode 100644 Patches/CoreCLR/src/utilcode/util.cpp rename python.diff => Patches/python.diff (100%) delete mode 100644 coreclr.diff diff --git a/.gitattributes b/.gitattributes index 5e7c72874..c9b77376c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ # Auto detect text files and perform LF normalization * text=auto *.diff text eol=lf +/Patches/** eol=lf # Custom for Visual Studio *.cs diff=csharp diff --git a/.gitignore b/.gitignore index d32087fd5..1b0a33516 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ -Python/ -CoreCLR/ -Libs/ -Pyjion/x64/ -Test/x64/ -Tools/*.h -Tools/*.cpp -ipch/ -x64/ -.vs/ +/Python/ +/CoreCLR/ +/Libs/ +/Pyjion/x64/ +/Test/x64/ +/Tools/*.h +/Tools/*.cpp +/ipch/ +/x64/ +/.vs/ *.opensdf -*.sdf \ No newline at end of file +*.sdf +*.opendb diff --git a/GetDeps.bat b/GetDeps.bat index 2151c5a16..ab97aabda 100644 --- a/GetDeps.bat +++ b/GetDeps.bat @@ -10,13 +10,21 @@ REM ######################################################## REM # Clone CoreCLR code base git clone https://github.com/dotnet/coreclr CoreCLR pushd CoreCLR -git reset --hard 98c63c1612b2635a40d9a719c1505e0ad4bef08a +git reset --hard b16ff5935ff9df3211798f18f0c951666ae27774 REM ######################################################## REM # Apply changes to disable COM interop support echo Disabling COM interop support... -git apply ..\coreclr.diff +git apply ..\Patches\CoreCLR\src\inc\utilcode.h +git apply ..\Patches\CoreCLR\src\utilcode\CMakeLists.txt +git apply ..\Patches\CoreCLR\src\utilcode\util.cpp +git apply ..\Patches\CoreCLR\src\CMakeLists.txt +git apply ..\Patches\CoreCLR\build.cmd +git apply ..\Patches\CoreCLR\clr.coreclr.props +git apply ..\Patches\CoreCLR\clr.defines.targets +git apply ..\Patches\CoreCLR\clr.desktop.props +git apply ..\Patches\CoreCLR\CMakeLists.txt popd REM ######################################################## @@ -31,5 +39,5 @@ REM ######################################################## REM # Apply changes to integrate JIT support into CPython echo Applying changes to enable JIT support... -git apply ..\python.diff +git apply ..\Patches\python.diff popd diff --git a/Patches/CoreCLR/CMakeLists.txt b/Patches/CoreCLR/CMakeLists.txt new file mode 100644 index 000000000..1e2cc38b5 --- /dev/null +++ b/Patches/CoreCLR/CMakeLists.txt @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 80625f9..7d4642d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -573,7 +573,7 @@ add_definitions(-DFEATURE_ASYNC_IO) + add_definitions(-DFEATURE_BCL_FORMATTING) + add_definitions(-DFEATURE_COLLECTIBLE_TYPES) + +-if(WIN32) ++if(FALSE) + add_definitions(-DFEATURE_CLASSIC_COMINTEROP) + add_definitions(-DFEATURE_APPX) + add_definitions(-DFEATURE_COMINTEROP) diff --git a/Patches/CoreCLR/build.cmd b/Patches/CoreCLR/build.cmd new file mode 100644 index 000000000..9b7bc446c --- /dev/null +++ b/Patches/CoreCLR/build.cmd @@ -0,0 +1,24 @@ +diff --git a/build.cmd b/build.cmd +index 046970e..960cfb7 100644 +--- a/build.cmd ++++ b/build.cmd +@@ -123,7 +123,7 @@ exit /b 1 + :: Note: We've disabled node reuse because it causes file locking issues. + :: The issue is that we extend the build with our own targets which + :: means that that rebuilding cannot successfully delete the task +-:: assembly. ++:: assembly. + if /i "%__VSVersion%" =="vs2015" goto MSBuild14 + set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" + if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe" +@@ -174,8 +174,8 @@ exit /b 1 + REM Build CoreCLR + :BuildCoreCLR + set "__CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.log" +-%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%" +-IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild ++%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%" /p:FeatureCominterop=false ++IF NOT ERRORLEVEL 1 goto SuccessfulBuild + echo Native component build failed. Refer !__CoreCLRBuildLog! for details. + exit /b 1 + diff --git a/Patches/CoreCLR/clr.coreclr.props b/Patches/CoreCLR/clr.coreclr.props new file mode 100644 index 000000000..a1645274a --- /dev/null +++ b/Patches/CoreCLR/clr.coreclr.props @@ -0,0 +1,30 @@ +diff --git a/clr.coreclr.props b/clr.coreclr.props +index 2373b7b..2c0aa4e 100644 +--- a/clr.coreclr.props ++++ b/clr.coreclr.props +@@ -10,7 +10,7 @@ + true + true + true +- true ++ false + true + true + true +@@ -57,12 +57,12 @@ + true + + true +- true ++ false + true +- true ++ false + true +- true +- true ++ false ++ false + true + true + true diff --git a/Patches/CoreCLR/clr.defines.targets b/Patches/CoreCLR/clr.defines.targets new file mode 100644 index 000000000..cf2555eb9 --- /dev/null +++ b/Patches/CoreCLR/clr.defines.targets @@ -0,0 +1,13 @@ +diff --git a/clr.defines.targets b/clr.defines.targets +index 879de92..fe2b3b6 100644 +--- a/clr.defines.targets ++++ b/clr.defines.targets +@@ -18,7 +18,7 @@ + $(CDefines);FEATURE_TRACELOGGING + $(CDefines);FEATURE_CODEPAGES_FILE + $(CDefines);FEATURE_COLLECTIBLE_TYPES +- $(CDefines);FEATURE_COMINTEROP ++ + $(CDefines);FEATURE_ICASTABLE + $(CDefines);FEATURE_COMINTEROP_APARTMENT_SUPPORT + $(CDefines);FEATURE_COMINTEROP_MANAGED_ACTIVATION diff --git a/Patches/CoreCLR/clr.desktop.props b/Patches/CoreCLR/clr.desktop.props new file mode 100644 index 000000000..9b70c36a6 --- /dev/null +++ b/Patches/CoreCLR/clr.desktop.props @@ -0,0 +1,13 @@ +diff --git a/clr.desktop.props b/clr.desktop.props +index 84dd6cf..14e6a09 100644 +--- a/clr.desktop.props ++++ b/clr.desktop.props +@@ -19,7 +19,7 @@ + true + true + true +- true ++ false + true + true + true diff --git a/Patches/CoreCLR/src/CMakeLists.txt b/Patches/CoreCLR/src/CMakeLists.txt new file mode 100644 index 000000000..865439ef9 --- /dev/null +++ b/Patches/CoreCLR/src/CMakeLists.txt @@ -0,0 +1,29 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 31c37e5..c56a892 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -38,22 +38,10 @@ endif(CLR_CMAKE_PLATFORM_UNIX) + + add_subdirectory(utilcode) + add_subdirectory(gcinfo) +-add_subdirectory(coreclr) + add_subdirectory(jit) +-add_subdirectory(vm) +-add_subdirectory(md) +-add_subdirectory(debug) + add_subdirectory(inc) +-add_subdirectory(strongname) +-add_subdirectory(binder) +-add_subdirectory(classlibnative) +-add_subdirectory(dlls) +-add_subdirectory(ToolBox) +-add_subdirectory(tools) +-add_subdirectory(unwinder) +-add_subdirectory(ildasm) +- +-if(WIN32) ++ ++if(FALSE) + add_subdirectory(ipcman) + endif(WIN32) + diff --git a/Patches/CoreCLR/src/inc/utilcode.h b/Patches/CoreCLR/src/inc/utilcode.h new file mode 100644 index 000000000..7a1445338 --- /dev/null +++ b/Patches/CoreCLR/src/inc/utilcode.h @@ -0,0 +1,13 @@ +diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h +index fa0e1b1..9722315 100644 +--- a/src/inc/utilcode.h ++++ b/src/inc/utilcode.h +@@ -9,6 +9,8 @@ + // + //***************************************************************************** + ++#define SetErrorInfo __DoNotUseSetErrorInfo ++ + #ifndef __UtilCode_h__ + #define __UtilCode_h__ + diff --git a/Patches/CoreCLR/src/utilcode/CMakeLists.txt b/Patches/CoreCLR/src/utilcode/CMakeLists.txt new file mode 100644 index 000000000..5f40fbb1a --- /dev/null +++ b/Patches/CoreCLR/src/utilcode/CMakeLists.txt @@ -0,0 +1,14 @@ +diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt +index 52a017f..5a37a4b 100644 +--- a/src/utilcode/CMakeLists.txt ++++ b/src/utilcode/CMakeLists.txt +@@ -71,8 +71,7 @@ set(UTILCODE_SOURCES + # They should be moved out from here into the declaration + # of UTILCODE_SOURCES above after fixing compiler errors. + if(WIN32) +- list(APPEND UTILCODE_SOURCES +- appxutil.cpp ++ list(APPEND UTILCODE_SOURCES + dlwrap.cpp + downlevel.cpp + loadrc.cpp diff --git a/Patches/CoreCLR/src/utilcode/util.cpp b/Patches/CoreCLR/src/utilcode/util.cpp new file mode 100644 index 000000000..7237d7b7f --- /dev/null +++ b/Patches/CoreCLR/src/utilcode/util.cpp @@ -0,0 +1,20 @@ +diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp +index d7d3a9f..972edd7 100644 +--- a/src/utilcode/util.cpp ++++ b/src/utilcode/util.cpp +@@ -212,6 +212,7 @@ typedef HRESULT __stdcall DLLGETCLASSOBJECT(REFCLSID rclsid, + EXTERN_C const IID _IID_IClassFactory = + {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; + ++#if FEATURE_COMINTEROP + // ---------------------------------------------------------------------------- + // FakeCoCreateInstanceEx + // +@@ -374,6 +375,7 @@ HRESULT FakeCoCallDllGetClassObject(REFCLSID rclsid, + + return hr; + } ++#endif + + #if USE_UPPER_ADDRESS + static BYTE * s_CodeMinAddr; // Preferred region to allocate the code in. diff --git a/python.diff b/Patches/python.diff similarity index 100% rename from python.diff rename to Patches/python.diff diff --git a/coreclr.diff b/coreclr.diff deleted file mode 100644 index 456451d14..000000000 --- a/coreclr.diff +++ /dev/null @@ -1,166 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e490c43..3d76b83 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -523,7 +523,7 @@ add_definitions(-DFEATURE_ASYNC_IO) - add_definitions(-DFEATURE_BCL_FORMATTING) - add_definitions(-DFEATURE_COLLECTIBLE_TYPES) - --if(WIN32) -+if(FALSE) - add_definitions(-DFEATURE_CLASSIC_COMINTEROP) - add_definitions(-DFEATURE_APPX) - add_definitions(-DFEATURE_COMINTEROP) -diff --git a/build.cmd b/build.cmd -index f5f1d59..8374585 100644 ---- a/build.cmd -+++ b/build.cmd -@@ -172,8 +172,8 @@ exit /b 1 - REM Build CoreCLR - :BuildCoreCLR - set "__CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.log" --%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%" --IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild -+%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%" /p:FeatureCominterop=false -+IF NOT ERRORLEVEL 1 goto SuccessfulBuild - echo Native component build failed. Refer !__CoreCLRBuildLog! for details. - exit /b 1 - -diff --git a/clr.coreclr.props b/clr.coreclr.props -index b47de7b..5165fbf 100644 ---- a/clr.coreclr.props -+++ b/clr.coreclr.props -@@ -10,7 +10,7 @@ - true - true - true -- true -+ false - true - true - true -@@ -57,12 +57,12 @@ - true - - true -- true -+ false - true -- true -+ false - true -- true -- true -+ false -+ false - true - true - true -diff --git a/clr.defines.targets b/clr.defines.targets -index 87ec8ac..7c738e4 100644 ---- a/clr.defines.targets -+++ b/clr.defines.targets -@@ -18,7 +18,7 @@ - $(CDefines);FEATURE_TRACELOGGING - $(CDefines);FEATURE_CODEPAGES_FILE - $(CDefines);FEATURE_COLLECTIBLE_TYPES -- $(CDefines);FEATURE_COMINTEROP -+ - $(CDefines);FEATURE_ICASTABLE - $(CDefines);FEATURE_COMINTEROP_APARTMENT_SUPPORT - $(CDefines);FEATURE_COMINTEROP_MANAGED_ACTIVATION -diff --git a/clr.desktop.props b/clr.desktop.props -index 84dd6cf..14e6a09 100644 ---- a/clr.desktop.props -+++ b/clr.desktop.props -@@ -19,7 +19,7 @@ - true - true - true -- true -+ false - true - true - true -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index ded1a95..1e58913 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -38,21 +38,10 @@ endif(CLR_CMAKE_PLATFORM_UNIX) - - add_subdirectory(utilcode) - add_subdirectory(gcinfo) --add_subdirectory(coreclr) - add_subdirectory(jit) --add_subdirectory(vm) --add_subdirectory(md) --add_subdirectory(debug) - add_subdirectory(inc) --add_subdirectory(strongname) --add_subdirectory(binder) --add_subdirectory(classlibnative) --add_subdirectory(dlls) --add_subdirectory(ToolBox) --add_subdirectory(tools) --add_subdirectory(unwinder) - --if(WIN32) -+if(FALSE) - add_subdirectory(ipcman) - endif(WIN32) - -diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h -index 364b4e1..47b985d 100644 ---- a/src/inc/utilcode.h -+++ b/src/inc/utilcode.h -@@ -9,6 +9,8 @@ - // - //***************************************************************************** - -+#define SetErrorInfo __DoNotUseSetErrorInfo -+ - #ifndef __UtilCode_h__ - #define __UtilCode_h__ - -diff --git a/src/jit/jit.h b/src/jit/jit.h -index 9702da3..f0d6c77 100644 ---- a/src/jit/jit.h -+++ b/src/jit/jit.h -@@ -1,3 +1,4 @@ -+ - // - // Copyright (c) Microsoft. All rights reserved. - // Licensed under the MIT license. See LICENSE file in the project root for full license information. -diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt -index 0db79c1..32a6793 100644 ---- a/src/utilcode/CMakeLists.txt -+++ b/src/utilcode/CMakeLists.txt -@@ -74,7 +74,6 @@ set(UTILCODE_SOURCES - # of UTILCODE_SOURCES above after fixing compiler errors. - if(WIN32) - list(APPEND UTILCODE_SOURCES -- appxutil.cpp - dlwrap.cpp - downlevel.cpp - loadrc.cpp -diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp -index 3bc6f73..05e2dc9 100644 ---- a/src/utilcode/util.cpp -+++ b/src/utilcode/util.cpp -@@ -212,6 +212,7 @@ typedef HRESULT __stdcall DLLGETCLASSOBJECT(REFCLSID rclsid, - EXTERN_C const IID _IID_IClassFactory = - {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; - -+#if FEATURE_COMINTEROP - // ---------------------------------------------------------------------------- - // FakeCoCreateInstanceEx - // -@@ -374,7 +375,7 @@ HRESULT FakeCoCallDllGetClassObject(REFCLSID rclsid, - - return hr; - } -- -+#endif - #if USE_UPPER_ADDRESS - static BYTE * s_CodeMinAddr; // Preferred region to allocate the code in. - static BYTE * s_CodeMaxAddr;