Skip to content

Commit e1ea898

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fix Fuchsia RISC-V build.
TEST=local build Change-Id: If21f38e98d76c962519434504dfc5003332831ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464783 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 43f2347 commit e1ea898

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

runtime/vm/compiler/backend/il_riscv.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,11 @@ void NativeEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
17031703

17041704
__ PushNativeCalleeSavedRegisters();
17051705

1706-
#if defined(USING_SHADOW_CALL_STACK)
1706+
#if defined(DART_TARGET_OS_FUCHSIA) || defined(DART_TARGET_OS_ANDROID)
1707+
__ sx(GP,
1708+
compiler::Address(
1709+
THR, compiler::target::Thread::saved_shadow_call_stack_offset()));
1710+
#elif defined(USING_SHADOW_CALL_STACK)
17071711
#error Unimplemented
17081712
#endif
17091713

runtime/vm/compiler/stub_code_compiler_riscv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ void StubCodeCompiler::GenerateFfiCallbackTrampolineStub() {
486486
#if defined(DART_TARGET_OS_FUCHSIA)
487487
// TODO(https://dartbug.com/52579): Remove.
488488
if (FLAG_precompiled_mode) {
489-
GenerateLoadBSSEntry(BSS::Relocation::DRT_ExitIsolateGroupBoundIsolate,
489+
GenerateLoadBSSEntry(BSS::Relocation::DLRT_ExitIsolateGroupBoundIsolate,
490490
T1, T2);
491491
} else {
492492
const intptr_t kPCRelativeLoadOffset = 12;

runtime/vm/os_fuchsia.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,10 @@ int64_t OS::GetCurrentMonotonicMicrosForTimeline() {
464464
#endif
465465
}
466466

467-
// TODO(5411554): May need to hoist these architecture dependent code
468-
// into a architecture specific file e.g: os_ia32_fuchsia.cc
469467
intptr_t OS::ActivationFrameAlignment() {
470-
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \
471-
defined(TARGET_ARCH_ARM64)
468+
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64) || \
469+
defined(TARGET_ARCH_RISCV64)
472470
const int kMinimumAlignment = 16;
473-
#elif defined(TARGET_ARCH_ARM)
474-
const int kMinimumAlignment = 8;
475471
#else
476472
#error Unsupported architecture.
477473
#endif

runtime/vm/thread_interrupter_fuchsia.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class ThreadInterrupterFuchsia : public AllStatic {
9292
state->lr = static_cast<uintptr_t>(regs.lr);
9393
#elif defined(TARGET_ARCH_RISCV64)
9494
state->pc = static_cast<uintptr_t>(regs.pc);
95-
state->fp = static_cast<uintptr_t>(regs.r[FPREG]);
96-
state->csp = static_cast<uintptr_t>(regs.r[SPREG]);
97-
state->dsp = static_cast<uintptr_t>(regs.r[SPREG]);
98-
state->lr = static_cast<uintptr_t>(regs.r[LINK_REGISTER]);
95+
state->fp = static_cast<uintptr_t>(regs.s0);
96+
state->csp = static_cast<uintptr_t>(regs.sp);
97+
state->dsp = static_cast<uintptr_t>(regs.sp);
98+
state->lr = static_cast<uintptr_t>(regs.ra);
9999
#else
100100
#error "Unsupported architecture"
101101
#endif

0 commit comments

Comments
 (0)