-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update Architecture to unknown machine #101038
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
(one less thing to worry about when adding a new platform support 😅)
Suggested by @am11. Thank you. Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Fix build error by adding TargetArchitecture casting for int value Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
I will handle failures tomorrow. Thank you. |
I was able to locally repro the illink error we are seeing in the CI; it repros with crossbuild+release config. This patch seem to fix it: --- a/src/coreclr/binder/assemblybindercommon.cpp
+++ b/src/coreclr/binder/assemblybindercommon.cpp
@@ -143,8 +143,7 @@ namespace BINDER_SPACE
}
else
{
- if ((CLRPeKind & peILonly) && !(CLRPeKind & pe32Plus) &&
- !(CLRPeKind & pe32BitRequired) && dwImageType == IMAGE_FILE_MACHINE_I386)
+ if ((CLRPeKind & peILonly) && !(CLRPeKind & pe32Plus) && !(CLRPeKind & pe32BitRequired))
{
// Processor-agnostic (MSIL)
*PeKind = peMSIL;
diff --git a/src/coreclr/vm/peassembly.cpp b/src/coreclr/vm/peassembly.cpp
index c7c618b4852..99ccb8638f9 100644
--- a/src/coreclr/vm/peassembly.cpp
+++ b/src/coreclr/vm/peassembly.cpp
@@ -39,7 +39,7 @@ static void ValidatePEFileMachineType(PEAssembly *pPEAssembly)
DWORD actualMachineType;
pPEAssembly->GetPEKindAndMachine(&peKind, &actualMachineType);
- if (actualMachineType == IMAGE_FILE_MACHINE_I386 && ((peKind & (peILonly | pe32BitRequired)) == peILonly))
+ if ((peKind & (peILonly | pe32BitRequired)) == peILonly)
return; // Image is marked CPU-agnostic.
if (actualMachineType != IMAGE_FILE_MACHINE_NATIVE && actualMachineType != IMAGE_FILE_MACHINE_NATIVE_NI) |
Mono has a different behavior than existing coreclr and proposed patch: runtime/src/mono/mono/metadata/assembly.c Line 499 in b7c3446
|
These failures suggests that the fix is not producing proper AnyCPU files. Have you checked that the fix is producing AnyCPU files? AnyCPU are IMAGE_FILE_MACHINE_I386, COMIMAGE_FLAGS_ILONLY bit set, both COMIMAGE_FLAGS_32BITREQUIRED and COMIMAGE_FLAGS_32BITPREFERRED bits cleared. I do not think we want to be changing the assembly loader as part of this fix. |
@jkotas, it is failing to read corelib:
Shouldn't corelib be machine specific? before:
after:
If so, then maybe this PR is a no-go (revive dotnet/cecil#171)? |
CoreLib is machine, OS and runtime specific, but this fact is not encoded in the PE header. The runtime should not require CoreLib to be machine specific. |
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Reduce amount of architecture specific code. Minor cleanup motivated by dotnet#101038.
Reduce amount of architecture specific code. Minor cleanup motivated by #101038.
* Update Architecture to unknown machine * Update src/tools/illink/src/linker/Linker.Steps/OutputStep.cs Suggested by @am11. Thank you. Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --------- Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Reduce amount of architecture specific code. Minor cleanup motivated by dotnet#101038.
Fix #96978 issue
Part of #84834
cc @dotnet/samsung