[Lldb-commits] [lldb] [lldb][test] Don't export all symbols when building Wasm test inferiors (PR #204426)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 17 12:46:08 PDT 2026
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/204426
WASI.rules linked test inferiors with -Wl,--export-all and the reactor-style -Wl,--no-entry. I cargo-culted and neither flag is needed as our test inferiors all have a main and crt1 provided _start.
The --export-all flag was also harmful: for a no-argument main(), wasi-libc renames the user's main to __original_main and emits a small `main` trampoline. The --export-all flag caused that trampoline to an exported `main` symbol, so `break main` resolved to two locations.
Drop both flags; keep --allow-undefined for inferiors that reference runtime-provided symbols.
>From 6b601a2af3444b3df931e227fa150d48023732bb Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Wed, 17 Jun 2026 12:43:37 -0700
Subject: [PATCH] [lldb][test] Don't export all symbols when building Wasm test
inferiors
WASI.rules linked test inferiors with -Wl,--export-all and the
reactor-style -Wl,--no-entry. I cargo-culted and neither flag is needed
as our test inferiors all have a main and crt1 provided _start.
The --export-all flag was also harmful: for a no-argument main(), wasi-libc
renames the user's main to __original_main and emits a small `main`
trampoline. The --export-all flag caused that trampoline to an exported
`main` symbol, so `break main` resolved to two locations.
Drop both flags; keep --allow-undefined for inferiors that reference
runtime-provided symbols.
---
lldb/packages/Python/lldbsuite/test/make/WASI.rules | 2 --
1 file changed, 2 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/make/WASI.rules b/lldb/packages/Python/lldbsuite/test/make/WASI.rules
index 190a9e423c5ff..03a25d6400c2f 100644
--- a/lldb/packages/Python/lldbsuite/test/make/WASI.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/WASI.rules
@@ -9,6 +9,4 @@ ARCH_CXXFLAGS += \
ARCH_LDFLAGS += \
$(if $(RESOURCE_DIR),-resource-dir $(RESOURCE_DIR)) \
- -Wl,--export-all \
- -Wl,--no-entry \
-Wl,--allow-undefined
More information about the lldb-commits
mailing list