Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-03[metadata] Size 0 Blob heap is ok when resolving assembly refs (#18313)Aleksey Kliger (λgeek)
* [metadata] Size 0 Blob heap is ok when resolving assembly refs Sometimes ILasm can produce images with a Blob heap of size 0. In cases where we're loading assembly references from such an image, the hash (which is optional) can be at index = 0 and the Blob heap size is also 0. Also: add the hash value to the output of `monodis --assemblyref` * [metadata] Add a separate assertion for the index == size == 0 case And a comment explaining how it is likely to be triggered. If the assembly is reasonable the caller of mono_metadata_blob_heap should be updated to use mono_metadata_blob_heap_null_ok instead * [bcl] Allow Mono's ILASM to produce a size 0 Blob heap ECMA 335 II.24.2.4 says that the user string and blob heaps should have an entry at index 0 consisting of the single byte 0. However .NET Framework (and .NET Core) ilasm will entirely omit the Blob heap (that is, create a blob heap entry of size 0) if it is not needed. This PR changes Mono's ILASM to emit the initial byte on demand only if one of the MetaDataStream.Add() methods is called. Otherwise we will also emit a stream of size 0. This is needed to compile some test cases. * [tests] Add regression test for loading assemblies with size 0 Blob heap Depends on ILASM that can emit a size 0 Blob heap
2019-04-04[DIM] Do not order implemented interfaces (#13721)Thays Grazia
This test https://github.com/dotnet/coreclr/blob/1649da12db73c8c07513c9168cb30ec70c310063/tests/src/Regressions/coreclr/20452/twopassvariance.il On mono we were ordering the list of implemented interfaces and shouldn't do this as it's described on ECMA-335 Section II.12.2.1 and II.12.2.2. The ordering was removed on ilasm and some changes were needed on metadata either because it's not ordered anymore. There were two bugs, one on ilasm and other on class initialization on mono. ### ILAsm ### If we get the .exe generated by .net Framework it doesn't execute on mono without modifications because we ordered the implemented interfaces list by id. And doing that the order defined on source code is ignored. If we get the .exe generated by Mono it doesn't execute on .net Framework because on IlAsm we order the list and loose the order defined on source code. The interfaces on metadata before these changes on IlAsm were like this: ``` 1: Fooer1 implements class IFoo<class Derived> 2: Fooer1 implements class IFoo<class Base> 3: Fooer2 implements class IFoo<class Base> 4: Fooer2 implements class IFoo<class Derived> 5: Fooer3 implements class IFoo<object> 6: Fooer3 implements class IBar<class Derived> 7: Fooer3 implements class IBaz<class Base> 8: IBar implements class IFoo<!0> 9: IBaz implements class IFoo<!0> 10: Fooer4 implements IQux 11: Fooer4 implements class IBar<class Derived> 12: IQux implements class IFoo<class Base> 13: IQux implements class IFoo<class Derived> 14: Fooer5 implements IQux 15: Fooer5 implements class IBar<class Derived> 16: Fooer6 implements class IBar<class Base> 17: Fooer6 implements class IFoo<class Base> 18: Fooer7 implements class IFoo<class Base> 19: Fooer7 implements class IBar<class Base> ``` And After the changes they follow the definition order which is the same order of IlAsm for .net framework and .net core. ``` 1: IBar implements class IFoo<!0> 2: IBaz implements class IFoo<!0> 3: IQux implements class IFoo<class Base> 4: IQux implements class IFoo<class Derived> 5: Fooer1 implements class IFoo<class Base> 6: Fooer1 implements class IFoo<class Derived> 7: Fooer2 implements class IFoo<class Derived> 8: Fooer2 implements class IFoo<class Base> 9: Fooer3 implements class IBaz<class Base> 10: Fooer3 implements class IBar<class Derived> 11: Fooer3 implements class IFoo<object> 12: Fooer4 implements IQux 13: Fooer4 implements class IBar<class Derived> 14: Fooer5 implements class IBar<class Derived> 15: Fooer5 implements IQux 16: Fooer6 implements class IFoo<class Base> 17: Fooer6 implements class IBar<class Base> 18: Fooer7 implements class IBar<class Base> 19: Fooer7 implements class IFoo<class Base> ``` ### Mono vtable layout ### Internally when Mono computes the interface table for each class, it would previously sort the interfaces by `MonoClass:interface_id` which is a unique id assigned (roughly) in load order. This was incorrect because the order of the interfaces determines the final vtable for the class. This PR changes the interface table computation so that the interfaces of a single class are ordered in declaration order, following ECMA. One consequence is that we can no longer use binary search with the interface id as the key to find out if a class implements an interface. We have to do a linear scan. On the other hand, we expect that the number of interfaces implemented by a single class is small in practice. This is how the Vtable for Fooer1 and Fooer2 looks like after the changes: ``` *** Vtable for class 'Fooer1' at "FINALLY" (size 6) [O][000][INDEX 000] object:ToString () [0x7fd78681db20] [O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8] [O][002][INDEX 002] object:Finalize () [0x7fd78681dad0] [O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8] [I][004][INDEX 000] IFoo:Gimme () [0x7fd786503800] [I][005][INDEX 000] IFoo:Gimme () [0x7fd7865038c0] Packed interface table for class Fooer1 has size 2 [000][UUID 078][SLOT 004][SIZE 001] interface IFoo[Base] [001][UUID 079][SLOT 005][SIZE 001] interface IFoo[Derived] ``` and ``` *** Vtable for class 'Fooer2' at "FINALLY" (size 6) [O][000][INDEX 000] object:ToString () [0x7fd78681db20] [O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8] [O][002][INDEX 002] object:Finalize () [0x7fd78681dad0] [O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8] [I][004][INDEX 000] IFoo:Gimme () [0x7fd7865038c0] [I][005][INDEX 000] IFoo:Gimme () [0x7fd786503800] Packed interface table for class Fooer2 has size 2 [000][UUID 079][SLOT 004][SIZE 001] interface IFoo[Derived] [001][UUID 078][SLOT 005][SIZE 001] interface IFoo[Base] ``` This is how the VTable for Fooer1 and Fooer2 looks like before the changes, as you can see Packed interface table are the same in Fooer1 and Fooer2, so the behavior of both classes was the same: ``` Vtable for class 'Fooer1' at "FINALLY" (size 6) [O][000][INDEX 000] object:ToString () [0x7fcf3801d920] [O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8] [O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0] [O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8] [I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29880] [I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29940] Packed interface table for class Fooer1 has size 2 [000][UUID 076][SLOT 004][SIZE 001] interface IFoo[Base] [001][UUID 077][SLOT 005][SIZE 001] interface IFoo[Derived] ``` ``` Vtable for class 'Fooer2' at "FINALLY" (size 6) [O][000][INDEX 000] object:ToString () [0x7fcf3801d920] [O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8] [O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0] [O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8] [I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29940] [I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29880] Packed interface table for class Fooer2 has size 2 [000][UUID 076][SLOT 005][SIZE 001] interface IFoo[Base] [001][UUID 077][SLOT 004][SIZE 001] interface IFoo[Derived] ```
2019-03-06[gitattributes] Do CRLF normalization on sln/proj filesAlexander Köplinger
They can be used with native line endings. We now have a shared folder with the dotnet repos and they have CRLF normalization enabled. This difference leads to conflicts while applying changes from the dotnet repos to mono.
2019-01-02[csproj] Update project filesmonojenkins
2018-10-10[build] Unify bootstrap profiles (#11024)Marek Safar
* [build] Unify bootstrap profiles We can now rely on build only as we have reliable monolite and package compilers * Fixes genproj dependencies * [csproj] Update project files
2018-09-02Move the PreBuild dependency property later in the file so targets can't ↵Katelyn Gadd
override it (#10429) * Move the PreBuild dependency property later in the file so targets can't override it * [csproj] Update project files
2018-08-31Kill sln dependencies (#10406)Katelyn Gadd
* Remove use of sln dependencies and use csproj project references instead * Rewrite jay.vcxproj so it builds correctly even without help from the sln file * Force pre-build event to run after references are resolved. Change how culevel.exe path is computed to be more resilient. * [csproj] Update project files
2018-08-09Move to generating msbuild choose elements to get if-else selection behavior ↵Katelyn Gadd
for sources in projects so that we don't get erroneous duplicate files in cases where there are both profile and host platform criteria (#9952) A recent commit revealed that in cases where we select based on a mix of host platform and profile, genproj csproj files can end up with duplicate sources because the existing <ItemGroup Condition= approach could make multiple groups match for a given compile when we really just want one. This PR changes to generating a cascade of msbuild <Choose> elements, which give if-else selection to ensure that we only ever build a single set of files.
2018-08-02Use msbuild project reference to establish dependency on genconsts instead ↵Katelyn Gadd
of solution dependencies (#9670) Using solution dependencies in ```bcl.sln``` seems flaky and seems like it might not establish the full ordering we need to ensure that ```Consts.cs``` exists before we build things that require it. Let's try using project references (where ```corlib.dll``` 'depends' on ```genconsts.exe```) instead. This should also insert the dependency for any project that includes Consts.cs instead of just corlib. This PR also makes update-solution-files actually fail if ```genconsts.exe``` fails to build because it was driving me mad. Part of #6886
2018-06-29Rework genproj to use gensources to build sources list for each profile and ↵Katelyn Gadd
host platform (#8985) * Update genproj makefile to include gensources Update genproj argument parser to be more generous about displaying help * Checkpoint * Checkpoint * Checkpoint * Checkpoint * Checkpoint * Checkpoint * Checkpoint * Checkpoint * Fix rebase issue * Checkpoint * Checkpoint * Fix built sources only being added to one profile * Fix typo * Checkpoint * Fix indentation * Use csc instead of mcs * Checkpoint * Fix BUILT_SOURCES only being handled for the first profile processed * Checkpoint * Checkpoint * Strip double slashes from paths to fix spurious csproj change * Checkpoint * Checkpoint * Checkpoint * Checkpoint: Fix genproj compilation * Checkpoint * Checkpoint * Checkpoint * Fix crash when no targets were loaded (due to an error) * Checkpoint * Checkpoint * Checkpoint * Fix TryParseTargetInto bug * Checkpoint * Shuffle exclude logic around so that it works correctly during genproj diffing * Remove gensources tracing * Checkpoint * Fix handling of oddball sources paths from executable.make * Fix jay not being set to build * Fix wrong slashes being used for embedded resource paths * [csproj] Update project files
2018-06-01[csproj] Update project filesmonojenkins
2018-05-22[bcl] Start replacing gensources.sh with gensources.cs (#8619)Katelyn Gadd
This PR introduces a new tool, gensources.cs, which replaces gensources.sh. It is able to parse the whole set of .sources files for a library in one go so that genproj can use that information to encode all our platform and profile specific files into one csproj file. For now this PR just introduces it and switches libraries to using it instead of gensources.sh.
2018-04-16Default platform to net_4_x if none is specified, to fix tools that build ↵Katelyn Gadd
without setting a platform (#8223) * Default platform to net_4_x if none is specified, to fix tools that build without setting a platform * [csproj] Update project files
2018-03-28[msvc] Update csproj files (#7811)monojenkins
* [msvc] Update csproj files * [msvc] Delete old net_4_x.csproj and xbuild_12.csproj files
2018-03-08[msvc] Update csproj files (#7497)monojenkins
2018-02-23[msvc] Update csproj files (#7238)monojenkins
2018-01-12[runtime] Fix some default interface method problems. (#6484)Zoltan Varga
* [runtime] Allow access to protected default interface methods from classes which implement the interface. * [interp] Add some automatic conversations between virtual and non-virtual calls that .net has. Fixes dim-valuetype.il. * [bcl] Sort the MethodImpl table in PEAPI. * [runtime] Enable dim-methodimpl.exe test. * [runtime] Fix vtable construction tracing. * [interp] Fix null checks on the receiver when converting virtual calls to non-virtual.
2017-11-26[msvc] Update csproj files (#6100)monojenkins
2017-08-29[PEAPI] Don't add mscorlib reference when no type needs itMarek Safar
2017-08-29[ilasm] Adds AggressiveInlining supportMarek Safar
2017-08-07[msvc] Update csproj filesAlexander Köplinger
2017-08-07[bcl] Specify the name of the key file on the command line instead of using ↵Zoltan Varga
the AssemblyKeyFile attribute for consistency and to make it easier to do path name manipulation on the file name. (#5316)
2017-05-15[msvc] Update csproj files (#4846)monojenkins
2017-04-18[msvc] Update csproj files (#4711)monojenkins
2017-01-17Clean up few warningsMarek Safar
2017-01-12[ilasm] Support 'nooptimization' attribute.Jon Purdy
2017-01-10[msvc] Update csproj files (#4221)monojenkins
2016-11-29ilasm: Add stub parsing for .data cil attributeVladimir Panteleev
The "cil" attribute seems to indicate that the data should be placed in the .text section, along with the code. Like the tls attribute, the cil attribute is only implemented insofar as to recognize it as a valid keyword that can occur in a .data declaration.
2016-11-14[msvc] Update .csproj filesAlexander Köplinger
2016-10-17[build] Regenerate .csproj filesAlexander Köplinger
Note: DISABLE_CAS_USE was removed in ed989a8e9e5c170b6d19edc60bb80e8a4e6d5cc0
2016-05-27[genproj] Do not use \r on the Unix parts of the build hook, add RabbitMQ hooksMiguel de Icaza
2016-05-19[msbuild projects] Use newlines without a carriage return for Unix targets ↵Miguel de Icaza
to appease MS msbuild
2016-05-19[genproj] Use an explicit IntermediateOutputPath to prevent rebuilds on ↵Miguel de Icaza
cyclic assemblies
2016-05-18genproj: Improve handling of executables and projects with build dependenciesMiguel de Icaza
2016-05-18[genproj] Updates to project generator and csproj files.Miguel de Icaza
* Adds support for a handful of new command line arguments that we now use in the build. * Always attempts to match to a project name, to get the proper project dependency. * Update to support .exe and .dll in the generation. * Remove warnings and some dead code * Update the resulting csproj files based on running: make update-csproj make package-inputs mono genproj.exe
2016-04-04[build] Change the way how mcs references are passed to compiler to always ↵Marek Safar
use full path. One of csc prerequisites because csc uses -lib as path which is considered after RuntimeEnvironment.GetRuntimeDirectory which makes -lib useless
2016-03-02[PEAPI] Fixed encoded token sizes for HasCustomAttribute, ↵Rodrigo Kumpera
CustomAttributeType and MemberRefParent. This would cause some large il files to be miscompiled as the token size would not be the expected one. This was found in b28158/test.il.
2016-01-29Remove ChangeLog files from the repoAlexander Köplinger
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2015-12-02[csproj] Remove *net_4_5.csproj files from the class libsAlexander Köplinger
We only use the net_4_x profile now so those csproj's don't make sense anymore.
2015-09-14[build] Generated up-to-date net_4_x MSBuild projects.João Matos
2015-06-23[ilasm] Even more undocumented custom attributes syntaxMarek Safar
2015-06-22[ilasm] Add another undocumented custom attributes initializer syntaxMarek Safar
2015-06-21[ilasm] Add emit of custom string attribute using member syntaxMarek Safar
2015-06-01[ilasm] Add support for undocumented modopt/modreq using primitive typesMarek Safar
2015-05-29[PEAPI] Fixes custom attributes with byte array constantMarek Safar
2015-05-29[ilasm] Extend syntax of custom attribute constructor constantsMarek Safar
2015-03-17[genproj] Re-generated the class library projects.João Matos
2015-03-02[build] Add the assemblies in LIB_REFS to LIB_MCS_FLAGS automatically to ↵Zoltan Varga
reduce duplication.
2015-02-27[build] Add dependency information for class libraries using a LIB_REFS ↵Zoltan Varga
variable which lists the assemblies a given assembly depends on to build.
2015-01-14[bcl] Remove NET_4_0 defines from class libs.Zoltan Varga