Uh oh!
There was an error while loading. Please reload this page.
Build managed part of crossgen2 as platform independent (AnyCPU) - #33041
Conversation
jkotas
commented
Mar 2, 2020
Why not build everything as AnyCpu? ie delete https://github.com/dotnet/runtime/blob/master/src/coreclr/dir.common.props#L33 |
gbalykov
commented
Mar 3, 2020
@jkotas this change by itself didn't seem to work, and I was not sure whether that was the correct approach, because for example System.Private.CoreLib build relies on Platform set equal to build arch. |
jkotas
commented
Mar 3, 2020
Set Platform for System.Private.CoreLib, and leave it to default to AnyCPU for everything else? |
There was a problem hiding this comment.
None of this should be needed once the default is AnyCPU.
@jkotas there is a problem with the approach that sets Platform to AnyCPU for everything. Crossgen2 is built as an app targeting specific RID (e.g. I've done the change that sets Platform to AnyCPU for everything (gbalykov@703ca05), however, this doesn't affect the resulting dlls, because they still target the specific platform. The same effect is from simple build command instead of publish: Only if I remove On the other side, approach with setting PlatformTarget to AnyCPU works even with build for specific rid. What do you think? |
jkotas
commented
Apr 1, 2020
Hmmm, I have not realized that |
jkotas
left a comment
There was a problem hiding this comment.
Ok, I have not realized we can clean this up later if necessary.
After this change same crossgen2.dll can be launched on different architectures.
Related issue: #31793
cc @alpencolt@jkotas