mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
scr_cyc_types, scr_str_scan and scr_wtf8_lone were tentative definitions. The macOS runtime build emits tentative definitions as COMMON symbols, and Mach-O `ld -r` writes COMMON symbols back out as commons, which -exported_symbols_list does not demote. Every runtime-localized library archive therefore defined them next to its declared API, failing the library-multi M1 and M7 symbol checks on macOS. Linux clang defaults to -fno-common, so the same declarations were ordinary definitions there and the checks passed. Initialize the three globals explicitly, as scr_sa and scr_stdio_write_hook already are, and add a runtime test that compiles every runtime source with -fcommon in the plain and worker configurations and expects no COMMON symbols, so a new tentative definition fails on Linux too.