From cc67ef513c84a0088cf0d8088fa25d7894f69bdc Mon Sep 17 00:00:00 2001 From: Cheng Shao <terrorjack@type.dance> Date: Tue, 1 Oct 2024 18:53:17 +0000 Subject: [PATCH] rts: don't build predefined GloblRegs for wasm PIC mode This commit wraps the predefined GlobalRegs in Wasm.S under a CPP guard to prevent building for PIC mode. When building dynamic ways of RTS, the wasm globals that represent STG GlobalRegs will be created and supplied by dyld.mjs. The current wasm dylink convention doesn't properly support exporting relocatable wasm globals at all, any wasm global exported by a .so is assumed to be a GOT.mem entry. (cherry picked from commit 98a32ec551dd95534c1a8eaccb0f67dbe5f19648) --- rts/wasm/Wasm.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rts/wasm/Wasm.S b/rts/wasm/Wasm.S index 3f5ad36f5de..4e6c8b5fa43 100644 --- a/rts/wasm/Wasm.S +++ b/rts/wasm/Wasm.S @@ -8,6 +8,8 @@ #define W_ i64 #endif +#if !defined(__PIC__) + .hidden __R1 .globl __R1 .section .data.__R1,"",@ @@ -169,3 +171,5 @@ __Hp: .section .data.__HpLim,"",@ .globaltype __HpLim, W_ __HpLim: + +#endif -- GitLab