Skip to content

Commit

Permalink
[LoongArch64] Fix the clr build error on Alpine.
Browse files Browse the repository at this point in the history
* Apply libunwind: libunwind/libunwind#741
  • Loading branch information
LuckyXu-HF committed Sep 11, 2024
1 parent 5e560d9 commit f6bf38d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/coreclr/vm/loongarch64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
context.S8 = unwoundstate->captureCalleeSavedRegisters[8] = baseState->captureCalleeSavedRegisters[8];
context.Fp = unwoundstate->captureCalleeSavedRegisters[9] = baseState->captureCalleeSavedRegisters[9];
context.Tp = unwoundstate->captureCalleeSavedRegisters[10] = baseState->captureCalleeSavedRegisters[10];
context.Ra = NULL; // Filled by the unwinder
context.Ra = 0; // Filled by the unwinder

context.Sp = baseState->captureSp;
context.Pc = baseState->captureIp;
Expand All @@ -340,7 +340,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
nonVolContextPtrs.S8 = &unwoundstate->captureCalleeSavedRegisters[8];
nonVolContextPtrs.Fp = &unwoundstate->captureCalleeSavedRegisters[9];
nonVolContextPtrs.Tp = &unwoundstate->captureCalleeSavedRegisters[10];
nonVolContextPtrs.Ra = NULL; // Filled by the unwinder
nonVolContextPtrs.Ra = 0; // Filled by the unwinder

#endif // DACCESS_COMPILE

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

pRD->pCurrentContextPointers->S0 = pUnwoundState->ptrCalleeSavedRegisters[0];
pRD->pCurrentContextPointers->S1 = pUnwoundState->ptrCalleeSavedRegisters[1];
Expand Down Expand Up @@ -525,7 +525,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContext->S8 = m_MachState.ptrCalleeSavedRegisters[8] ? *m_MachState.ptrCalleeSavedRegisters[8] : m_MachState.captureCalleeSavedRegisters[8];
pRD->pCurrentContext->Fp = m_MachState.ptrCalleeSavedRegisters[9] ? *m_MachState.ptrCalleeSavedRegisters[9] : m_MachState.captureCalleeSavedRegisters[9];
pRD->pCurrentContext->Tp = m_MachState.ptrCalleeSavedRegisters[10] ? *m_MachState.ptrCalleeSavedRegisters[10] : m_MachState.captureCalleeSavedRegisters[10];
pRD->pCurrentContext->Ra = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContext->Ra = 0; // Unwind again to get Caller's PC
#else // TARGET_UNIX
pRD->pCurrentContext->S0 = *m_MachState.ptrCalleeSavedRegisters[0];
pRD->pCurrentContext->S1 = *m_MachState.ptrCalleeSavedRegisters[1];
Expand All @@ -538,7 +538,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
pRD->pCurrentContext->S8 = *m_MachState.ptrCalleeSavedRegisters[8];
pRD->pCurrentContext->Fp = *m_MachState.ptrCalleeSavedRegisters[9];
pRD->pCurrentContext->Tp = *m_MachState.ptrCalleeSavedRegisters[10];
pRD->pCurrentContext->Ra = NULL; // Unwind again to get Caller's PC
pRD->pCurrentContext->Ra = 0; // Unwind again to get Caller's PC
#endif

#if !defined(DACCESS_COMPILE)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/loongarch64/virtualcallstubcpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ struct ResolveHolder
_stub._resolveWorkerTarget = resolveWorkerTarget;

_ASSERTE(resolveWorkerTarget == (PCODE)ResolveWorkerChainLookupAsmStub);
_ASSERTE(patcherTarget == NULL);
_ASSERTE(patcherTarget == (PCODE)NULL);

#undef DATA_OFFSET
#undef PC_REL_OFFSET
Expand Down
1 change: 1 addition & 0 deletions src/native/external/libunwind-version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Apply https://github.com/libunwind/libunwind/pull/714
Revert https://github.com/libunwind/libunwind/commit/ec03043244082b8f552881ba9fb790aa49c85468 and follow up changes in the same file # issue: https://github.com/libunwind/libunwind/issues/715
Apply https://github.com/libunwind/libunwind/pull/734
Apply https://github.com/libunwind/libunwind/pull/758
Apply https://github.com/libunwind/libunwind/pull/741
1 change: 0 additions & 1 deletion src/native/external/libunwind/src/loongarch64/getcontext.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

#include "offsets.h"
#include <endian.h>
.text

#define SREG(X) st.d $r##X, $r4, (LINUX_UC_MCONTEXT_GREGS + 8 * X)
Expand Down

0 comments on commit f6bf38d

Please sign in to comment.