Skip to content

Commit

Permalink
Fix build on alpine arm64 (#102953)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Jun 4, 2024
1 parent 5cbc38c commit a7c88a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 0 additions & 6 deletions src/coreclr/pgosupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ function(add_pgo TargetName)
if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-generate)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-generate")
if(NOT LD_LLVM)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
endif()
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
endif(CLR_CMAKE_HOST_WIN32)
elseif(CLR_CMAKE_PGO_OPTIMIZE AND NOT CLR_CMAKE_ENABLE_SANITIZERS)
Expand Down Expand Up @@ -59,9 +56,6 @@ function(add_pgo TargetName)
if(HAVE_LTO)
target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-use=${ProfilePath} -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fprofile-instr-use=${ProfilePath}")
if(NOT LD_LLVM)
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -fuse-ld=gold")
endif()
add_compile_definitions(WITH_NATIVE_PGO)
else(HAVE_LTO)
message(WARNING "LTO is not supported, skipping profile guided optimizations")
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm64/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ inline TADDR GetMem(PCODE address, SIZE_T size, bool signExtend)
}
EX_CATCH
{
mem = NULL;
mem = 0;
_ASSERTE(!"Memory read within jitted Code Failed, this should not happen!!!!");
}
EX_END_CATCH(SwallowAllExceptions);
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/vm/arm64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
context.X27 = unwoundstate->captureX19_X29[8] = baseState->captureX19_X29[8];
context.X28 = unwoundstate->captureX19_X29[9] = baseState->captureX19_X29[9];
context.Fp = unwoundstate->captureX19_X29[10] = baseState->captureX19_X29[10];
context.Lr = NULL; // Filled by the unwinder
context.Lr = 0; // Filled by the unwinder

context.Sp = baseState->captureSp;
context.Pc = baseState->captureIp;
Expand All @@ -316,7 +316,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
nonVolContextPtrs.X27 = &unwoundstate->captureX19_X29[8];
nonVolContextPtrs.X28 = &unwoundstate->captureX19_X29[9];
nonVolContextPtrs.Fp = &unwoundstate->captureX19_X29[10];
nonVolContextPtrs.Lr = NULL; // Filled by the unwinder
nonVolContextPtrs.Lr = 0; // Filled by the unwinder

#endif // DACCESS_COMPILE

Expand Down Expand Up @@ -464,7 +464,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContext->X27 = (DWORD64)(pUnwoundState->captureX19_X29[8]);
pRD->pCurrentContext->X28 = (DWORD64)(pUnwoundState->captureX19_X29[9]);
pRD->pCurrentContext->Fp = (DWORD64)(pUnwoundState->captureX19_X29[10]);
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC

pRD->pCurrentContextPointers->X19 = &pRD->pCurrentContext->X19;
pRD->pCurrentContextPointers->X20 = &pRD->pCurrentContext->X20;
Expand Down Expand Up @@ -503,7 +503,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContext->X27 = (DWORD64)(m_MachState.unwoundX19_X29[8]);
pRD->pCurrentContext->X28 = (DWORD64)(m_MachState.unwoundX19_X29[9]);
pRD->pCurrentContext->Fp = (DWORD64)(m_MachState.unwoundX19_X29[10]);
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC
#else // __APPLE__
pRD->pCurrentContext->X19 = *m_MachState.ptrX19_X29[0];
pRD->pCurrentContext->X20 = *m_MachState.ptrX19_X29[1];
Expand All @@ -516,7 +516,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContext->X27 = *m_MachState.ptrX19_X29[8];
pRD->pCurrentContext->X28 = *m_MachState.ptrX19_X29[9];
pRD->pCurrentContext->Fp = *m_MachState.ptrX19_X29[10];
pRD->pCurrentContext->Lr = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContext->Lr = 0; // Unwind again to get Caller's PC
#endif // __APPLE__

#if !defined(DACCESS_COMPILE)
Expand All @@ -531,7 +531,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContextPointers->X27 = m_MachState.ptrX19_X29[8];
pRD->pCurrentContextPointers->X28 = m_MachState.ptrX19_X29[9];
pRD->pCurrentContextPointers->Fp = m_MachState.ptrX19_X29[10];
pRD->pCurrentContextPointers->Lr = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContextPointers->Lr = 0; // Unwind again to get Caller's PC
#endif

ClearRegDisplayArgumentAndScratchRegisters(pRD);
Expand Down

0 comments on commit a7c88a2

Please sign in to comment.