experiments with compiling MSCORLIB.DLL

Coordinator
Jan 27, 2015 at 12:53 PM
experiments with compiling MSCORLIB.DLL

size of generated .LL file - 267 Mbytes
size of not optimized .OBJ file - 40 MBytes (can't be compiled into EXE as it is too big)
size of optimized .OBJ file - 14 MBytes
size of HelloWorld.exe file - 15 MBytes
Jan 27, 2015 at 1:03 PM
Good stuff! :)
15MB is on the rather big side of things though! :-o
Coordinator
Jan 27, 2015 at 1:17 PM
lloyd wrote:
Good stuff! :)
15MB is on the rather big side of things though! :-o
yes, if you compile without optimization the size of OBj is 40MBytes and can't be compiled by g++ on windows (only on linux). It seems we will migrate to linux soon :D
Coordinator
Jan 28, 2015 at 11:58 AM
Edited Jan 28, 2015 at 11:59 AM
first exception in mscorlib.dll
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) r
Starting program: C:\Temp\IlCTests\test-1.exe
[New Thread 5528.0x34bc]
warning: SHIMVIEW: ShimInfo(Complete)

Catchpoint 1 (exception thrown), 0x0085f004 in __cxa_throw ()
(gdb) bt
#0  0x0085f004 in __cxa_throw ()
#1  0x008550d5 in System.IntPtr System.Runtime.CompilerServices.JitHelpers.UnsafeCastToStackPointer<System.RuntimeType>(Ref System.RuntimeType&) ()
#2  0x0085498c in System.Runtime.CompilerServices.ObjectHandleOnStack System.Runtime.CompilerServices.JitHelpers.GetObjectHandleOnStack<System.RuntimeType>(Ref System.RuntimeType&) ()
#3  0x005082c8 in System.RuntimeType System.RuntimeTypeHandle.MakeSZArray() ()
#4  0x00501bf2 in System.Type System.RuntimeType.MakeArrayType() ()
#5  0x00565828 in Byte* System.Globalization.GlobalizationAssembly.GetGlobalizationResourceBytePtr(System.Reflection.Assembly, System.String) ()
#6  0x0055949e in Void System.Globalization.CharUnicodeInfo..cctor() ()
#7  0x0077a66c in Global Ctors for mscorlib ()
#8  0x0087227a in __do_global_ctors ()
#9  0x004013b2 in __tmainCRTStartup ()
#10 0x76c8919f in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\SysWOW64\kernel32.dll
#11 0x770b0bbb in ntdll!RtlInitializeExceptionChain () from C:\WINDOWS\SYSTEM32\ntdll.dll
#12 0x770b0b91 in ntdll!RtlInitializeExceptionChain () from C:\WINDOWS\SYSTEM32\ntdll.dll
#13 0x00000000 in ?? ()
(gdb)
and we see that method not implemented
internal static IntPtr UnsafeCastToStackPointer<T>(ref T val)
{
    throw new InvalidOperationException();
}
as I remember mscorlib.dll does not contain any impotent code at all :)