Skip to content

Commit

Permalink
Another round of changes required to compile on ARM (#1310)
Browse files Browse the repository at this point in the history
* Another round of changes required to compile on ARM
- libunwind change is fix compilation type mismatch.  Present in upstream https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/libunwind/src/libunwind.cpp#L102
- gcinfodecoder.cpp This one looks like leftover from other times? Would like to be educated. This location assumes that `src\coreclr\inc\regdisp.h` included, but `src\coreclr\nativeaot\Runtime\regdisplay.h` included. I again do not understand how this happens and why this is working for other targets.

* Special case for the UNW_ARM_LR
since it is located at index 13.
  • Loading branch information
kant2002 authored Jul 25, 2021
1 parent dc24a19 commit 666e35a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/nativeaot/libunwind/src/libunwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _LIBUNWIND_HIDDEN int __unw_set_reg(unw_cursor_t *cursor, unw_regnum_t regNum,
unw_word_t value, unw_word_t *pos) {
_LIBUNWIND_TRACE_API("__unw_set_reg(cursor=%p, regNum=%d, value=0x%" PRIxPTR
")",
static_cast<void *>(cursor), regNum, (unsigned long)value);
static_cast<void *>(cursor), regNum, value);
typedef LocalAddressSpace::pint_t pint_t;
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
if (co->validReg(regNum)) {
Expand Down Expand Up @@ -155,7 +155,7 @@ _LIBUNWIND_HIDDEN int __unw_set_fpreg(unw_cursor_t *cursor, unw_regnum_t regNum,
_LIBUNWIND_WEAK_ALIAS(__unw_set_fpreg, unw_set_fpreg)

/// Get location of specified register at cursor position in stack frame.
_LIBUNWIND_HIDDEN int __unw_get_save_loc(unw_cursor_t *cursor, int regNum,
_LIBUNWIND_HIDDEN int __unw_get_save_loc(unw_cursor_t *cursor, int regNum,
unw_save_loc_t* location)
{
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
Expand Down
13 changes: 12 additions & 1 deletion src/coreclr/vm/gcinfodecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,17 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot(
_ASSERTE(regNum >= 0 && regNum <= 14);
_ASSERTE(regNum != 13); // sp

#ifdef FEATURE_REDHAWK
if(regNum < 14)
{
PTR_UIntNative* ppReg = &pRD->pR0;
return (OBJECTREF*)*(ppReg + regNum);
}
else
{
return (OBJECTREF*) pRD->pLR;
}
#else
DWORD **ppReg;

if(regNum <= 3)
Expand All @@ -1505,7 +1516,7 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot(
ppReg = &pRD->pCurrentContextPointers->R4;

return (OBJECTREF*)*(ppReg + regNum-4);

#endif
}

#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK)
Expand Down

0 comments on commit 666e35a

Please sign in to comment.