-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ilasm cannot compile against different corlib names #7758
Comments
How urgent is fixing this? What is it blocking? |
This will probably block us running a significant amount of Roslyn unit tests on CoreCLR. |
The fix should be to add another case for netstandard here: https://github.com/dotnet/coreclr/blob/52a816d3011f4d03b80b5940dc036b40d701f52d/src/ilasm/assembler.cpp#L279 |
It would be nice to support arbitrary corlib names. Roslyn currently uses the heuristic that an assembly with no references = the corlib. Is there a reason this couldn't be used by ilasm as well? |
@RussKeldorph I unblocked us by using the netstandard.library 2.0 mscorlib ref and that seems to be working OK. So I'll let you know if this becomes blocking again. |
This affects System.Runtime.CompilerServices.Unsafe, as well. For what it's worth, referencing "System.Runtime" is accepted by ilasm, and that's what we are doing for the time being. |
ilasm takes the IL text file as input, it does not take the ref assemblies as inputs. Thus, it cannot tell which assembly does not have any references. |
FWIW, if you alias .assembly '_0_89c370b1-0d11-4511-9273-3053e4dbf734' {}
.assembly extern netstandard as mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
.ver 2:0:0:0
}
.class public auto ansi beforefieldinit Class
extends [mscorlib]System.Object
{
} // end of class Class after ilasming, ildasm's to: .assembly '_0_89c370b1-0d11-4511-9273-3053e4dbf734' {}
.assembly extern netstandard
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
.ver 2:0:0:0
}
.class public auto ansi beforefieldinit Class
extends [netstandard]System.Object
{
} // end of class Class It's fairly unintuitive, and can actually cause problems if you alias mscorlib to something else (or System.Runtime as it turns out, see dotnet/coreclr#10595), but I believe this is what the original BaseAsmRef method is meant to do in general. Continuously adding new "BaseAsmRef" names seems.... bad... |
The issue with |
Sorry to leave a comment on this closed issue. I ran into this on Windows, the |
To be more specific,
|
Yeah, I think this issue is only addressing the ILasm built from coreclr. I'm guessing you are using the desktop ILAsm that comes from |
@ericstj Thanks for the quick reply! Yes, I'm using the desktop ILAsm that comes with the full .NET framework. That explains. Thanks! |
For instance, compiling the following il:
Results in the following warning:
And System.Object is retargeted to mscorlib and an mscorlib ref is added to the output assembly.
The text was updated successfully, but these errors were encountered: