Bug 246157 - riscv64 llint fails to link with lld
Summary: riscv64 llint fails to link with lld
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-06 08:15 PDT by Daniel Kolesa
Modified: 2022-10-08 06:12 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kolesa 2022-10-06 08:15:58 PDT
When using riscv64 LLint on webkitgtk or WPE 2.38 with clang+lld, linking fails:

ld: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol 'g_opcodeMap'; recompile with -fPIC

(the actual log is much longer, but the same stuff)

This is because the generated assembly uses the lla pseudoinstruction which forces PC-relative addressing but with non-local symbols. The bfd linker somehow eats it, while the lld linker does not. The fix here is to use a GOT lookup (la).
Comment 1 Daniel Kolesa 2022-10-06 08:26:09 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5086
Comment 2 EWS 2022-10-08 06:11:21 PDT
Committed 255311@main (3127e0a5094b): <https://commits.webkit.org/255311@main>

Reviewed commits have been landed. Closing PR #5086 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-10-08 06:12:16 PDT
<rdar://problem/100933102>