0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
Ali Cheraghi b3727d9bd1 spirv: rewrite linker
Previously, the SPIR-V linker would merge every function's MIR into one module, then parsed
it in `BinaryModule`, and run three passes over it:
- `prune_unused` walked the module from its entry points to drop dead declarations
- `dedup_types` deduplicated types and constants
- `lower_invocation_globals` rewrote function signatures to pass a pointer to global
  variables as function parameter

Now codegen emits instructions in the order it resolves them (not the spec specified order)
into one section per function. then the linker sorts them into the correct order while also
interning types, constants, strings, etc in the flush step.

Navs the frontend no longer references are now skipped using `Zcu.resolveReferences` instead
of a pass like `prune_unused`. Extern variables are also only loaded when an MIR references them.

`lower_invocation_globals` is gone too. non-`threadlocal` globals on SPIR-V targets are disallowed now.
Currently only vulkan supports them via the newly added `private` address space. See #36715

The new linker also supports incremental compilation now!
History 2026-09-18 16:36:23 +03:30
..
build-web Change usages of fmt.bufPrint* to mem.print* (#36263) 2026-09-01 02:21:28 +02:00
c libzigc: memchr, wmemchr: don't read past first occurence of value 2026-09-18 01:25:17 +02:00
compiler Build.Step.Options: addOptionPathUntracked 2026-09-18 04:31:03 +02:00
compiler_rt compiler_rt: downgrade ARMv6 Thumb instructions to ARMv4-valid variants 2026-08-07 15:44:32 +02:00
docs Change usages of fmt.bufPrint* to mem.print* (#36263) 2026-09-01 02:21:28 +02:00
include zig cc: update intrinsic headers to LLVM 22 2026-04-25 21:49:39 +02:00
init zig init: delete wrong documentation 2026-09-07 11:17:32 -07:00
libc libc: Update macOS headers to SDK 27.0 2026-09-11 00:11:01 +01:00
libcxx libcxx: update to LLVM 22.1.8 2026-06-25 01:46:47 +02:00
libcxxabi libcxxabi: unregress arm-freebsd and arm-openbsd build 2026-04-26 15:42:05 +02:00
libtsan libtsan: backport llvm/llvm-project#194116 2026-04-25 21:54:47 +02:00
libunwind libunwind: unregress x32 and mips n32 build 2026-04-27 10:16:02 +02:00
lldb InternPool: restore debugger pretty printing 2026-06-06 20:00:55 -07:00
std spirv: rewrite linker 2026-09-18 16:36:23 +03:30
c.zig feat(libzigc): add common implementations of pthread_spin_* 2026-04-21 09:03:06 +02:00
compiler_rt.zig compiler-rt: add @disableIntrinsics to memset 2026-08-23 03:57:05 +02:00
fuzzer.zig Change usages of fmt.bufPrint* to mem.print* (#36263) 2026-09-01 02:21:28 +02:00
ubsan_rt.zig std: support loongarch backend 2026-08-09 11:10:26 +08:00
zig.h compiler: add support for patchable functions 2026-09-16 19:21:21 +02:00