Skip to content

Commit 542d168

Browse files
committed
Revert "[release/6.0] Fix ReadyToRun loading on Apple Silicon (#64104)"
This reverts commit 8f7dff3.
1 parent 6dd808f commit 542d168

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

src/coreclr/jit/importer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -6960,9 +6960,7 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
69606960
//
69616961
CLANG_FORMAT_COMMENT_ANCHOR;
69626962

6963-
#ifndef OSX_ARM64_ABI
69646963
if (!opts.IsReadyToRun() || IsTargetAbi(CORINFO_CORERT_ABI))
6965-
#endif // !OSX_ARM64_ABI
69666964
{
69676965

69686966
// Reuse the temp used to pass the array dimensions to avoid bloating
@@ -7019,7 +7017,6 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
70197017

70207018
node = gtNewHelperCallNode(CORINFO_HELP_NEW_MDARR_NONVARARG, TYP_REF, args);
70217019
}
7022-
#ifndef OSX_ARM64_ABI
70237020
else
70247021
{
70257022
//
@@ -7049,7 +7046,6 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
70497046
}
70507047
#endif
70517048
}
7052-
#endif // !OSX_ARM64_ABI
70537049

70547050
for (GenTreeCall::Use& use : node->AsCall()->Args())
70557051
{

src/coreclr/pal/src/map/map.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2047,9 +2047,9 @@ MAPmmapAndRecord(
20472047

20482048
// Set the requested mapping with forced PROT_WRITE to ensure data from the file can be read there,
20492049
// read the data in and finally remove the forced PROT_WRITE
2050-
if ((mprotect(pvBaseAddress, len + adjust, PROT_WRITE) == -1) ||
2050+
if ((mprotect(pvBaseAddress, len + adjust, prot | PROT_WRITE) == -1) ||
20512051
(pread(fd, pvBaseAddress, len + adjust, offset - adjust) == -1) ||
2052-
(mprotect(pvBaseAddress, len + adjust, prot) == -1))
2052+
(((prot & PROT_WRITE) == 0) && mprotect(pvBaseAddress, len + adjust, prot) == -1))
20532053
{
20542054
palError = FILEGetLastErrorFromErrno();
20552055
}

src/coreclr/vm/jitinterface.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -14200,13 +14200,6 @@ BOOL LoadDynamicInfoEntry(Module *currentModule,
1420014200
CorInfoHelpFunc corInfoHelpFunc = MapReadyToRunHelper((ReadyToRunHelper)helperNum);
1420114201
if (corInfoHelpFunc != CORINFO_HELP_UNDEF)
1420214202
{
14203-
#ifdef OSX_ARM64_ABI
14204-
if (corInfoHelpFunc == CORINFO_HELP_NEW_MDARR)
14205-
{
14206-
STRESS_LOG(LF_ZAP, LL_WARNING, "CORINFO_HELP_NEW_MDARR is not supported on osx-arm64\n");
14207-
return FALSE;
14208-
}
14209-
#endif // OSX_ARM64_ABI
1421014203
result = (size_t)CEEJitInfo::getHelperFtnStatic(corInfoHelpFunc);
1421114204
}
1421214205
else

src/coreclr/vm/peimagelayout.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ void PEImageLayout::ApplyBaseRelocations()
235235
if (((pSection->Characteristics & VAL32(IMAGE_SCN_MEM_WRITE)) == 0))
236236
{
237237
DWORD dwNewProtection = PAGE_READWRITE;
238-
#if defined(TARGET_UNIX) && !defined(CROSSGEN_COMPILE) && !defined(__APPLE__)
238+
#if defined(TARGET_UNIX) && !defined(CROSSGEN_COMPILE)
239239
if (((pSection->Characteristics & VAL32(IMAGE_SCN_MEM_EXECUTE)) != 0))
240240
{
241241
// On SELinux, we cannot change protection that doesn't have execute access rights
242242
// to one that has it, so we need to set the protection to RWX instead of RW
243243
dwNewProtection = PAGE_EXECUTE_READWRITE;
244244
}
245-
#endif // TARGET_UNIX && !CROSSGEN_COMPILE && !__APPLE__
245+
#endif // TARGET_UNIX && !CROSSGEN_COMPILE
246246
if (!ClrVirtualProtect(pWriteableRegion, cbWriteableRegion,
247247
dwNewProtection, &dwOldProtection))
248248
ThrowLastError();

0 commit comments

Comments
 (0)