File llvm19-no-shlib-sigcheck.patch of Package nodejs-vscode-tree-sitter-wasm
From 7cbb230e4362246be2aca68dba124e3af17459a8 Mon Sep 17 00:00:00 2001
From: Sam Clegg <sbc@chromium.org>
Date: Mon, 15 Jul 2024 09:58:46 -0700
Subject: [PATCH] Remove temporary setting of WASM_BIGINT in dylink tests. NFC
(#22238)
The llvm change that includes `--no-shlib-sigcheck` has now langed
(https://github.com/llvm/llvm-project/pull/75242) so we can use that
instead.
---
test/common.py | 5 -----
tools/building.py | 6 ++++++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/test/common.py b/test/common.py
index 84281ff65c5d..b6a821360304 100644
--- a/test/common.py
+++ b/test/common.py
@@ -795,11 +795,6 @@ def check_dylink(self):
self.skipTest('no dynamic linking support in wasm2js yet')
if '-fsanitize=undefined' in self.emcc_args:
self.skipTest('no dynamic linking support in UBSan yet')
- # Temporarily enableing WASM_BIGINT in all dylink tests in order to allow
- # a recent llvm change to land:
- # https://github.com/llvm/llvm-project/pull/75242
- # Once that lands we can use --no-shlib-sigcheck instead.
- self.set_setting('WASM_BIGINT')
# MEMORY64=2 mode doesn't currently support dynamic linking because
# The side modules are lowered to wasm32 when they are built, making
# them unlinkable with wasm64 binaries.
diff --git a/tools/building.py b/tools/building.py
index 83ea46b773af..3e8efdb5671a 100644
--- a/tools/building.py
+++ b/tools/building.py
@@ -194,6 +194,12 @@ def lld_flags_for_executable(external_symbols):
if settings.RELOCATABLE:
cmd.append('--experimental-pic')
cmd.append('--unresolved-symbols=import-dynamic')
+ if not settings.WASM_BIGINT:
+ # When we don't have WASM_BIGINT available, JS signature legalization
+ # in binaryen will mutate the signatures of the imports/exports of our
+ # shared libraries. Because of this we need to disabled signature
+ # checking of shared library functions in this case.
+ cmd.append('--no-shlib-sigcheck')
if settings.SIDE_MODULE:
cmd.append('-shared')
else: