Skip to content

Commit

Permalink
Fix build on alpine-riscv64 (#4787)
Browse files Browse the repository at this point in the history
cc @viewizard @gbalykov

```sh
docker run --rm -v$(pwd):/diagnostics -w /diagnostics --platform linux/riscv64 alpine:edge sh -c \
  'apk add build-base cmake bash curl clang llvm-dev   &&   ./build.sh -skipmanaged'
```
  • Loading branch information
am11 committed Jul 12, 2024
1 parent 702d20f commit 1fc8974
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/SOS/lldbplugin/services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ LLDBServices::VirtualUnwind(
DWORD spToFind = dtcontext->Sp;
#elif DBG_TARGET_ARM64
DWORD64 spToFind = dtcontext->Sp;
#elif DBG_TARGET_RISCV64
DWORD64 spToFind = dtcontext->Sp;
#else
#error "spToFind undefined for this platform"
#endif
Expand Down Expand Up @@ -454,6 +456,8 @@ LLDBServices::GetExecutingProcessorType(
*type = IMAGE_FILE_MACHINE_ARM64;
#elif DBG_TARGET_X86
*type = IMAGE_FILE_MACHINE_I386;
#elif DBG_TARGET_RISCV64
*type = IMAGE_FILE_MACHINE_RISCV64;
#else
#error "Unsupported target"
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/shared/inc/regdisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ struct REGDISPLAY : public REGDISPLAY_BASE {

inline TADDR GetRegdisplayFP(REGDISPLAY *display) {
LIMITED_METHOD_CONTRACT;
return NULL;
return (TADDR)NULL;
}

inline TADDR GetRegdisplayFPAddress(REGDISPLAY *display) {
LIMITED_METHOD_CONTRACT;
return NULL;
return (TADDR)NULL;
}

// This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame
Expand All @@ -248,14 +248,14 @@ inline TADDR GetRegdisplayStackMark(REGDISPLAY *display)
_ASSERTE(GetRegdisplaySP(display) == GetSP(display->pCurrentContext));
return GetRegdisplaySP(display);

#elif defined(TARGET_ARM64)
#elif defined(TARGET_ARM64) || defined(TARGET_RISCV64)

_ASSERTE(display->IsCallerContextValid);
return GetSP(display->pCallerContext);

#else // TARGET_AMD64
PORTABILITY_ASSERT("GetRegdisplayStackMark NYI for this platform (Regdisp.h)");
return NULL;
return (TADDR)NULL;
#endif // TARGET_AMD64
}

Expand Down

0 comments on commit 1fc8974

Please sign in to comment.