Skip to content

Commit fff4bd8

Browse files
trdthgConstellation
authored andcommitted
[RISCV] Fix instruction requires the following: 'D'/'F'/'M'
https://bugs.webkit.org/show_bug.cgi?id=282900 Reviewed by Yusuke Suzuki. This is a llvm bug, passing `-march=riscv64gc -cpu=lp64d` from clang will lost after it got llvm side. So we have to set arch here. More related infomations are here: - rust-lang/rust#80608 - llvm/llvm-project#61991 - llvm/llvm-project#97685 * Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp: * Source/JavaScriptCore/llint/LowLevelInterpreter.cpp: Canonical link: https://commits.webkit.org/286815@main
1 parent 9eb4f2a commit fff4bd8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ static_assert(!(RA_RESTORATION_SIZE & 0xf));
267267
asm(
268268
".text" "\n"
269269
".globl " SYMBOL_STRING(ctiMasmProbeTrampoline) "\n"
270+
".attribute arch, \"rv64gc\"" "\n"
270271
HIDE_SYMBOL(ctiMasmProbeTrampoline) "\n"
271272
SYMBOL_STRING(ctiMasmProbeTrampoline) ":" "\n"
272273

Source/JavaScriptCore/llint/LowLevelInterpreter.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,15 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
560560
".thumb\n" \
561561
".thumb_func " THUMB_FUNC_PARAM(label) "\n" \
562562
SYMBOL_STRING(label) ":\n"
563+
#elif CPU(RISCV64)
564+
#define OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, ALT_ENTRY, ALIGNMENT, VISIBILITY) \
565+
OFFLINE_ASM_TEXT_SECTION \
566+
ALIGNMENT \
567+
ALT_ENTRY(label) \
568+
".globl " SYMBOL_STRING(label) "\n" \
569+
".attribute arch, \"rv64gc\"" "\n" \
570+
VISIBILITY(label) "\n" \
571+
SYMBOL_STRING(label) ":\n"
563572
#else
564573
#define OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, ALT_ENTRY, ALIGNMENT, VISIBILITY) \
565574
OFFLINE_ASM_TEXT_SECTION \

0 commit comments

Comments
 (0)