0.8.1 Release Notes
Download & Documentation
Zig is a general-purpose programming language and toolchain for maintaining
robust, optimal, and reusable software.
Backed by the Zig Software Foundation,
the project is financially sustainable and offers billable
hours for core team members:
Please consider donating to the ZSF to help us pay even more contributors!
This release contains only bug fixes.
A green check mark (✅) indicates the target meets all the requirements for the
support tier. The other icons indicate what is preventing the target from
reaching the support tier. In other words, the icons are
to-do items. If you find any wrong data here please
submit a pull request!
- Not only can Zig generate machine code for these targets, but the standard
library cross-platform abstractions have implementations for these targets.
- 🧪 The CI server automatically tests these targets on every commit to master
- 📦 The CI server automatically produces pre-built binaries for these targets,
on every commit to master, and updates
the download page with links.
- These targets have debug info capabilities and therefore produce stack traces
on failed assertions.
- libc is available for this target even when cross compiling.
- 🐛 All the behavior tests and applicable standard library tests pass for this target.
All language features are known to work correctly. Experimental features do not
count towards disqualifying an operating system or architecture from Tier 1.
zig c++ and related toolchain commands support
- 💀 If the Operating System is proprietary then the target is not marked deprecated
by the vendor,
such as macos/x86.
- 📖 The standard library supports this target, but it's possible that some
APIs will give an "Unsupported OS" compile error. One can link with libc or other
libraries to fill in the gaps in the standard library.
- 🔍 These targets are known to work, but may not be automatically tested, so there
are occasional regressions.
- Some tests may be disabled for these targets as we work toward
Tier 1 Support.
- The standard library has little to no knowledge of the existence of this
- If this target is provided by LLVM, LLVM has the target enabled by default.
- These targets are not frequently tested; one will likely need to contribute
to Zig in order to build for these targets.
- The Zig compiler might need to be updated with a few things such as
- what sizes are the C integer types
- C ABI calling convention for this target
- start code and default panic handler
zig targets is guaranteed to include this target.
- Support for these targets is entirely experimental.
- If this target is provided by LLVM, LLVM may have the target as an
experimental target, which means that you need to use Zig-provided binaries
for the target to be available, or build LLVM from source with special configure flags.
zig targets will display the target if it is available.
- This target may be considered deprecated by an official party,
such as macosx/i386 in which
case this target will remain forever stuck in Tier 4.
- This target may only support
-femit-asm and cannot emit object files
-fno-emit-bin enabled by default and cannot be overridden).
Tier 4 targets:
- 32-bit x86 macOS, 32-bit ARM macOS, powerpc32 and powerpc64 macOS,
because Apple has officially dropped support for them.
0.8.1 upgrades to LLVM 12.0.1, which solved a regression introduced in LLVM 12.0.0.
Mips tests are now re-enabled on Zig's CI infrastructure.
Additionally syscall_pipe is fixed. Previously the fd parameter was ignored and so the
result would not get populated. Now it passes the fd pointer to the inline assembly
so that the results can be observed.
This release upgrades to LLVM 12.0.1 which solved a handful of issues, including
regressions introduced in 12.0.0, notably to MIPS Support (#8155), DragonFlyBSD support
(#3563), and WebAssembly support (#5339).
This release will downgrade the expected CPU for x86 targets from
x86-64-v2 back down to baseline. We had
multiple reports of people wanting to
run the compiler binaries on older hardware. This has to do with the
not the Zig compiler codebase.
- Fix building stage1 via
- Adjust dynamic linker path on OpenBSD (#9010).
- stage1: Apply the same set of fn attributes everywhere. Make sure to
propagate the target-specific attributes to internal functions too. (#8965)
- stage1: fix render_const_value for printing const optional pointers.
- link: windows: look for more DLL import lib path names (#7799).
When linking with -lfoo syntax, this indicates to Zig that the
dependency should either be provided by Zig, or it should be dynamically
provided by the system.
For windows-gnu targets, the search path was "foo.lib". Now it
additionally looks for "libfoo.dll.a".
- stage1: make
@truncate to an integer type of different sign an error at comptime too.
- CLI: remove --verbose-ast and --verbose-tokenize (#9034).
These options were listed under the "Debug Options (Zig Compiler Development)" heading.
Anything in this section should be considered unstable and can be modified at any time
at any developer's discretion.
In this case, these options no longer make sense due to Whole-File AST Lowering which debuted in 0.8.0.
- stage1: Fix handling of C ABI parameters split in multiple regs (#9061).
Take into account the increased number of parameters when flattening a
structure into one or more SSE registers.
- better awareness of unwind tables (#9046).
- stage1 backend allows configuring the uwtables function attr
via a flag rather than its own logic.
- stage2 defaults to enabling uwtable attr when
linking libunwind, or always on windows.
- stage2 makes link_eh_frame_hdr true automatically if uwtable
attr is set to be on for zig functions.
- CLI: add
to allow the user to override the defaults.
- Hook it up to
- NetBSD: add args to limit number of PT_LOAD segs (#9109).
NetBSD expects 2 PT_LOAD segments in a shared object, otherwise
ld.elf_so fails to load, emitting a general "not found" error.
Workaround issue by adding args
- Fix lakemont CpuModel (#9099).
Lakemont has no x86, no MMX, no SSE and no way of handling any fp-math.
- stage1: fix zig0 help message (#9140).
- stage2: Unify compiler error printing (#9117).
- stage1: Store the specified code model in the LLVM module. This is needed for LTO builds to pick up the correct module (#9132).
- AstGen: properly generate errdefer expressions when returning (#8821).
- linker: macho: LC_RPATH: reserve byte for null-terminator.
- stage2: add --sysroot link option.
This feature is necessary for cross-compiling code that dynamically
links system libraries, at least with the current feature set of lld.
- stage1: Properly put
@shuffle type and mask params in
- Shared Cache Locking - prevents deadlocks from multiple zig processes compiling
at the same time which both need a shared subset of build artifacts (#9258).
- stage2: fix
@asyncCall parameter count (#9269).
- stage2: add the Zig version to AstGen cache hash. This solves the problem of
different versions of Zig having different binary representations of ZIR code (#9290).
- Fix unexpected truncation behavior with comptime_int larger than u64 range (#9303, #9299).
- mingw-w64: add odbc32 and dbghelp def files (#9124).
- Fix libc include directories for the MSVC target.
- Fix bigint_shl (#9305).
- -rdynamic now implies -fdll-export-fns unless the latter is explicitly set (#9340).
- Don't define valgrind_support on macOS (#9612). Unfortunately, Valgrind for macOS
has been broken for years, and the Homebrew formula is only for Linux.
- libunwind: fix unwinding through libunwind stack frames (#9591).
- Better handing of POLLHUP in ChildProcess (#8988).
- Fix some BPF function definitions.
- Fix pointer alignment unsafety on i386 (#8924).
- Limit Fixed Buffer Stream seekTo (#9023).
- Progress: use
*W functions on Windows (#534).
- math.sqrt_int: fixed odd size integers types
- AES 128-bit key expansion test - properly test the inverse round keys (#9065).
- Fix tanh for negative inputs (#9047).
It turns out the code was not ported correctly from C and produced wrong
results for negative input values. As a bonus fix the NaN codepath by
adding yet another missing piece of code.
- Fix bigint add failures with aliasing (#8330).
- Fix complex ldexp implementation (#9047).
Two bugs in the implementation ported from musl made all the complex
functions relying on ldexp return incorrect results in some cases.
- Windows: fix
- Fix auto hash of tagged union with void field.
- Don't reference non-existant ComptimeStringHashMap type
- NetBSD: add more std.os bits.
- HashMap.getOrPutAssumeCapacityAdapted now sets key to undefined (#9138).
- Make copy_file_range checks run at compile-time (#9146).
- Avoid emitting the copy_file_range symbol at all to prevent link-time errors.
- Fix a bug in the check logic, the has_copy_file_range_syscall was set to the wrong value in case of ENOSYS.
- If link_libc is true don't fall-back to the raw syscall approach.
- Fix PIE startup sequence (#9168).
- Restore ability for root source file to override
- os.linux.bpf: fix incorrect usage of unexpectedErrno.
- crypto.p256: fix neg function compile error.
- finish ChildProcess collectOutputWindows (#9148).
- os.uefi: fix packed struct bitfields.
- Add waitid syscall on linux (#9335).
- Add NotDir as possible error for os.inotify_add_watch. It's possible when mask
IN_ONLYDIR and pathname is not a directory.
- Add inotify_rm_watch definition to c/linux.zig and make inotify_add_watch's pathname marked as nul-terminated.
- ArrayList: add missing assertion in appendSliceAssumeCapacity.
- Correct hasUniqueRepresentation for vectors (#9333).
- crypto: handle the top bit in 25519.field.fromBytes64() (#9435).
The only known use case for this is the hash-to-curve operation where the top bit is
always cleared. But the function is public, so this makes it work as one would expect
in the general case.
- linux stdlib: fix definition of RW flags (#9428).
- user32.zig: fixed compile error: 'bMenu' needs to casted (#9426).
- ArrayList: Allow `ArrayList(u0)` to be created.
- Use truncating cast in WIFSTOPPED for Linux, FreeBSD and DragonFly.
- compiler-rt: Fix __floatunsitf signature. The function transforms an unsigned integer into a
- Avoid using undefined variables (#9013, #8928, #7991).
- zig build: add --libc general option.
This new option sets a default libc paths file to be used for all
LibExeObjSteps. Setting LibExeObjStep.libc_file overrides this default.
This is required to allow users to cross compile projects linking system
libraries without needing to patch the build.zig.
--sysroot general option.
- libc,macOS: update and add missing libc headers.
- native libc detection: respect spaces in CC env var (#8960).
Zig has detection for when it is accidentally being called recursively
when trying to find the native libc installation. However it was not
working, resulting in a cryptic failure, because zig tried to execute
a command which had spaces in it rather than tokenizing it.
This improves the user experience of
zig cc for systems that Zig
does not support cross-compiling for.
- Recognize more PIE flags.
- Fix RISC-V assembly CPU features.
Previously, Zig did not properly communicate the target CPU features for
RISC-V to Clang assembler, because Clang has a different way to pass CPU
features for C code and for assembly code. This fix makes Zig pass a
RISC-V -march flag in order to communicate CPU features to Clang when
compiling assembly files.
- Improve linker args parsing to handle linker args joined with a = like
-Wl,-rpath=foo. Also handle
-Wl,--script in addition
- Fix argument forwarding to LLVM on Windows.
- Use -isysroot on Mojave too.
- stage1: Wasm,libc: fix wasm-ld failure in matching libc symbols.
- stage1: add c_longdouble mapping for s390x.
- Remove paragraph that mentions IRC (#9055).
The language reference is independent from any particular
community. Also remove the call to action since the docs are
known to be incomplete and are not the current focus of the project.
- Link to 0.7.1 not 0.7.0 for the previous docs.
- Rename "top level global assembly" to "container level".
- Clarify local static variable (#8381).
@setRuntimeSafety more correct.
- remove incorrect statement on
- Fix array/pointer/slice type coercion section (#9392).
and even some
Zig is immature. Even with Zig 0.8.1, working on a non-trivial project using Zig will
likely require participating in the development process.
These release notes have been edited down to avoid excessive detail as to not overwhelm
the reader with content. In order to make sure everyone gets credit who contributed, here
is a list of everyone who landed commits during this release cycle (produced with
git shortlog -sne 0.8.0..0.8.1):
- Andrew Kelley
- Isaac Freund
- Michael Dusan
- Frank Denis
- Jacob G-W
- Jakub Konka
- Martin Wickham
- Matthew Borkowski
- Ryan Liptak
- Veikka Tuominen
- Adam C
- Alex Rønne Petersen
- Björn Linse
- David May
- Dustin Taylor
- Filippo Casarin
- Jonathan Marler
- Malcolm Still
- Meghan Denny
- Michal Ziulek
- Philip Åkesson
- Philipp Lühmann
- Roman Frołow
- Sebastian Ullrich
- Sebastien Marie
- Takeshi Yoneda
- Vincent Rischmann
- Zach Banks
- fn ⌃ ⌥
Special thanks to those who sponsor Zig.
Because of you, Zig is driven by the open source community, rather than the goal of making profit.
In particular, these fine folks sponsor Zig for $50/month or more: