mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
The helper's program target options left UseInitArray off, so a program constructor went to .ctors. The C startup files and lld run only .init_array entries, so such a constructor never ran. Runtime units already set the option (runtime-unit.cpp); program code now does too. No program emits a constructor today, so executables are unchanged. native-constructors.test.ts emits a constructor through a single object, split code generation and program partitions, checks that it lands in .init_array on ELF, and runs it.