From bee2981308ede3fcde835fa78d0740d087a3fdc2 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Fri, 9 Oct 2026 17:40:54 -0500 Subject: [PATCH] Keep the stack guard out of localized library archives The stack guard was a tentative definition, which some targets emit as a common symbol. Localized library archives deliberately leave common symbols shared, so on macOS the archive defined scr_stack_guard alongside its declared exports. An explicit initializer makes it an ordinary definition that localization hides like the rest of the runtime. --- packages/runtime/src/scr_exception.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/runtime/src/scr_exception.c b/packages/runtime/src/scr_exception.c index afcbe95a2..f6a08fbb4 100644 --- a/packages/runtime/src/scr_exception.c +++ b/packages/runtime/src/scr_exception.c @@ -56,8 +56,10 @@ ScrExcCell *scr_exc_active = &scr_main_exc; /* The running stack's overflow guard (scr_runtime.h). It lives beside the * exception cell so fiber switching can maintain it whenever scr_async.c is - * linked; scr_context.c installs it per thread. */ -SCR_TL uintptr_t scr_stack_guard; + * linked; scr_context.c installs it per thread. The explicit initializer + * keeps it an ordinary definition rather than a common symbol, which a + * localized library archive would otherwise leave shared. */ +SCR_TL uintptr_t scr_stack_guard = 0; /* Fiber switching (scr_async.c) points the exception machinery at the * incoming fiber's cell; returns the previous cell. */