Skip to content

Commit 8dd9c72

Browse files
committed
[ARMv7] Fix clang20 build
https://bugs.webkit.org/show_bug.cgi?id=306182 Reviewed by Yusuke Suzuki. See #1600. We fix this build error: ``` <inline asm>:320:49: error: Relocation Not In Range 320 | movw r4, #:lower16:.Lllint_op_tail_call_varargs - .Lllint_relativePCBase | ^ <inline asm>:321:49: error: Relocation Not In Range 321 | movt r4, #:upper16:.Lllint_op_tail_call_varargs - .Lllint_relativePCBase ... by emiting a worse sequence, a jump + data + a pc-relative load. This is only emitted at startup, so the perf impact should be minimal. * Source/JavaScriptCore/offlineasm/arm.rb: Canonical link: https://commits.webkit.org/306181@main
1 parent a055be7 commit 8dd9c72

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • Source/JavaScriptCore/offlineasm

Source/JavaScriptCore/offlineasm/arm.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,14 @@ def lowerARMCommon
755755
armMoveImmediate(operands[0].value >> 32, operands[1])
756756
armMoveImmediate(operands[0].value & 0xffffffff, operands[2])
757757
when "mvlbl"
758-
$asm.puts "movw #{operands[1].armOperand}, \#:lower16:#{operands[0].value}"
759-
$asm.puts "movt #{operands[1].armOperand}, \#:upper16:#{operands[0].value}"
758+
afterData = LocalLabel.unique(codeOrigin, "mvlbl")
759+
data = LocalLabel.unique(codeOrigin, "mvlbl")
760+
$asm.puts "b #{LocalLabelReference.new(codeOrigin, afterData).asmLabel}"
761+
$asm.puts ".align 1"
762+
data.lower("ARM")
763+
$asm.puts ".word #{operands[0].value}"
764+
afterData.lower("ARM")
765+
$asm.puts "ldr #{operands[1].armOperand}, #{LocalLabelReference.new(codeOrigin, data).asmLabel}"
760766
when "sxb2i"
761767
$asm.puts "sxtb #{armFlippedOperands(operands)}"
762768
when "sxh2i"
@@ -1000,4 +1006,3 @@ def lowerARMCommon
10001006
end
10011007
end
10021008
end
1003-

0 commit comments

Comments
 (0)