Skip to content

Commit

Permalink
CoreCLR \ ILAsm 4.700.2 with an implemented /REBASE feature.
Browse files Browse the repository at this point in the history
Fixes #125
  • Loading branch information
3F committed Dec 11, 2019
1 parent c0a67ab commit 8c9ab72
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ public string OurILAsmPath
}
}

public bool SysObjRebase
{
get => _ExportTaskImplementation.SysObjRebase;
set => _ExportTaskImplementation.SysObjRebase = value;
}

public string MetaLib
{
get {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ public string OurILAsmPath
}
}

public bool SysObjRebase
{
get => _ExportTaskImplementation.SysObjRebase;
set => _ExportTaskImplementation.SysObjRebase = value;
}

public string MetaLib
{
get {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ public string OurILAsmPath
}
}

public bool SysObjRebase
{
get => _Values.SysObjRebase;
set => _Values.SysObjRebase = value;
}

public string MetaLib
{
get {
Expand Down
6 changes: 6 additions & 0 deletions RGiesecke.DllExport/IInputValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ string OurILAsmPath
set;
}

bool SysObjRebase
{
get;
set;
}

string MetaLib
{
get;
Expand Down
6 changes: 6 additions & 0 deletions RGiesecke.DllExport/InputValuesCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public string OurILAsmPath
set;
}

public bool SysObjRebase
{
get;
set;
}

public string MetaLib
{
get;
Expand Down
42 changes: 30 additions & 12 deletions RGiesecke.DllExport/Parsing/ILAsm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,8 @@ private string GetCommandLineArguments(CpuPlatform cpu, string fileName, string
keyFile = "\"/Key=" + keyFile + '"';
}

string cvtres;
if(!String.IsNullOrWhiteSpace(InputValues.OurILAsmPath)) {
// https://github.com/3F/coreclr/issues/2
// Only our new ILAsm 4.5.1+ may detect cvtres.exe automatically if the path is not presented at all. However, we can also provide CVR key
cvtres = String.IsNullOrWhiteSpace(InputValues.FrameworkPath) ? "" : $"/CVRES=\"{InputValues.FrameworkPath}/\"";
}
else {
cvtres = String.Empty; // original coreclr \ ILAsm does not support /CVRES
}

return String.Format(
return string.Format
(
CultureInfo.InvariantCulture,
"/nologo \"/out:{0}\" \"{1}.il\" {2} {3} {4} {5} {6} {7}",
fileName,
Expand All @@ -423,8 +414,35 @@ private string GetCommandLineArguments(CpuPlatform cpu, string fileName, string
InputValues.EmitDebugSymbols ? "/debug" : "/optimize",
cpu == CpuPlatform.X86 ? "" : (" /PE64 " + (cpu == CpuPlatform.Itanium ? " /ITANIUM" : " /X64")),
keyFile,
cvtres
GetKeysToCustomILAsm()
);
}

/// <returns>
/// Keys to modified coreclr \ ILAsm
/// </returns>
private string GetKeysToCustomILAsm()
{
if(string.IsNullOrWhiteSpace(InputValues.OurILAsmPath))
{
return string.Empty;
}

var sb = new StringBuilder();

// https://github.com/3F/coreclr/issues/2
// Our custom ILAsm 4.5.1+ may automatically detect cvtres if the path is not presented at all
if(!string.IsNullOrWhiteSpace(InputValues.FrameworkPath))
{
sb.Append($" /CVRES=\"{InputValues.FrameworkPath}/\"");
}

if(InputValues.SysObjRebase)
{
sb.Append(" /REBASE");
}

return sb.ToString();
}
}
}
2 changes: 1 addition & 1 deletion coreclr
Submodule coreclr updated 98 files
+1 −1 .modversion
+6 −4 ILAsm.nuspec
+1 −0 LICENSE.TXT
+15 −10 README.md
+12 −0 changelog.txt
+4 −0 clrdefinitions.cmake
+2 −2 dir.common.props
+10 −6 eng/Version.Details.xml
+6 −5 eng/Versions.props
+1 −0 eng/pipelines/internal.yml
+1 −0 eng/pipelines/pr.yml
+1 −1 global.json
+6 −3 init-tools.cmd
+8 −7 init-tools.sh
+30 −0 src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs
+6 −3 src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs
+1 −0 src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
+17 −11 src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventProvider.cs
+19 −0 src/System.Private.CoreLib/shared/System/Environment.Unix.cs
+15 −0 src/System.Private.CoreLib/shared/System/Environment.Windows.cs
+0 −24 src/System.Private.CoreLib/shared/System/Environment.cs
+24 −10 src/System.Private.CoreLib/shared/System/Globalization/CompareInfo.Windows.cs
+1 −11 src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Windows.cs
+9 −9 src/System.Private.CoreLib/shared/System/IO/StreamReader.cs
+3 −1 src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
+7 −3 src/System.Private.CoreLib/shared/System/Text/DecoderNLS.cs
+8 −13 src/System.Private.CoreLib/shared/System/TimeSpan.cs
+0 −7 src/classlibnative/bcltype/system.cpp
+8 −9 src/debug/daccess/dacdbiimpl.cpp
+3 −1 src/debug/daccess/request_svr.cpp
+2 −1 src/debug/di/module.cpp
+1 −0 src/debug/di/rsfunction.cpp
+1 −1 src/debug/di/rspriv.h
+60 −83 src/debug/ee/controller.cpp
+7 −6 src/debug/ee/controller.h
+14 −0 src/debug/ee/debugger.cpp
+1 −1 src/debug/ee/frameinfo.cpp
+4 −4 src/debug/ee/frameinfo.h
+2 −27 src/dlls/mscorpe/ceefilegenwriter.cpp
+20 −1 src/gc/gc.cpp
+11 −0 src/gc/gcpriv.h
+9 −0 src/gc/unix/config.h.in
+30 −0 src/gc/unix/configure.cmake
+239 −15 src/gc/unix/gcenv.unix.cpp
+2 −0 src/ilasm/assem.cpp
+28 −0 src/ilasm/assembler.cpp
+4 −0 src/ilasm/assembler.h
+7 −1 src/ilasm/main.cpp
+11 −11 src/inc/bbsweep.h
+1 −1 src/inc/clrconfigvalues.h
+37 −0 src/inc/corprof.idl
+1 −1 src/inc/regdisp.h
+10 −1 src/jit/hwintrinsiccodegenxarch.cpp
+1 −1 src/pal/inc/rt/specstrings_strict.h
+3 −0 src/pal/prebuilt/idl/corprof_i.cpp
+999 −1 src/pal/prebuilt/inc/corprof.h
+2 −0 src/pal/src/include/pal/utils.h
+33 −7 src/pal/src/map/map.cpp
+13 −25 src/pal/src/map/virtual.cpp
+71 −12 src/pal/src/misc/sysinfo.cpp
+40 −0 src/pal/src/misc/utils.cpp
+0 −6 src/pal/src/thread/process.cpp
+4 −1 src/scripts/genLttngProvider.py
+0 −4 src/utilcode/util.cpp
+27 −2 src/vm/amd64/jithelpers_fast.S
+4 −3 src/vm/amd64/jitinterfaceamd64.cpp
+17 −6 src/vm/ceemain.cpp
+6 −0 src/vm/diagnosticserver.cpp
+17 −7 src/vm/eventtrace.cpp
+11 −1 src/vm/excep.cpp
+28 −0 src/vm/exceptionhandling.cpp
+4 −4 src/vm/gcheaputilities.h
+5 −1 src/vm/genmeth.cpp
+2 −3 src/vm/ilmarshalers.cpp
+2 −0 src/vm/mlinfo.cpp
+1 −0 src/vm/mlinfo.h
+4 −1 src/vm/ngenhash.inl
+15 −2 src/vm/perfinfo.cpp
+11 −0 src/vm/prestub.cpp
+105 −3 src/vm/proftoeeinterfaceimpl.cpp
+15 −1 src/vm/proftoeeinterfaceimpl.h
+1 −1 src/vm/rejit.cpp
+9 −0 src/vm/stackwalk.cpp
+44 −0 src/vm/threads.cpp
+12 −0 src/vm/threads.h
+2 −0 src/vm/threadsuspend.cpp
+2 −2 src/vm/typedesc.cpp
+4 −0 tests/CoreFX/CoreFX.issues.rsp
+6 −0 tests/ilasm-restore/Directory.Build.props
+6 −0 tests/ilasm-restore/Directory.Build.targets
+30 −0 tests/ilasm-restore/ilasm.depproj
+2 −2 tests/publishdependency.targets
+6 −2 tests/src/Common/CoreFX/CoreFX.depproj
+1 −1 tests/src/Common/build_against_pkg_dependencies/build_against_pkg_dependencies.csproj
+3 −3 tests/src/Common/test_dependencies/test_dependencies.csproj
+3 −3 tests/src/Common/test_runtime/test_runtime.csproj
+3 −3 tests/src/JIT/config/benchmark+intrinsic/benchmark+intrinsic.csproj
+2 −2 tests/src/dir.props
2 changes: 1 addition & 1 deletion packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="vsSolutionBuildEvent" version="1.14.0" output="vsSolutionBuildEvent" />
<package id="ILAsm" version="4.700.1" output="ILAsm" />
<package id="ILAsm" version="4.700.2" output="ILAsm" />
</packages>
2 changes: 2 additions & 0 deletions tools/net.r_eg.DllExport.targets
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<DllExportSkipOnAnyCpu Condition="'$(DllExportSkipOnAnyCpu)' == ''">$(NoDllExportsForAnyCpu)</DllExportSkipOnAnyCpu>
<DllExportDDNSCecil Condition="'$(DllExportDDNSCecil)' == ''">true</DllExportDDNSCecil>
<DllExportOurILAsm Condition="'$(DllExportOurILAsm)' == ''">false</DllExportOurILAsm>
<DllExportSysObjRebase Condition="'$(DllExportSysObjRebase)' == ''">false</DllExportSysObjRebase>
<DllExportOrdinalsBase Condition="'$(DllExportOrdinalsBase)' == ''">1</DllExportOrdinalsBase>
<DllExportGenExpLib Condition="'$(DllExportGenExpLib)' == ''">false</DllExportGenExpLib>
<DllExportOurILAsmPath Condition="'$(DllExportOurILAsm)' != 'true'"></DllExportOurILAsmPath>
Expand Down Expand Up @@ -95,6 +96,7 @@
OurILAsmPath="$(DllExportOurILAsmPath)"
MetaLib="$(DllExportMetaLibFullPath)"
PeCheckRaw="$(DllExportPeCheck)"
SysObjRebase="$(DllExportSysObjRebase)"
/>

<PropertyGroup>
Expand Down

0 comments on commit 8c9ab72

Please sign in to comment.