* Reuse bytes of async function frames when non-async functions
make `noasync` calls. This prevents explosive stack growth.
* Zig now passes a stack size argument to the linker when linking ELF
binaries. Linux ignores this value, but it is available as a program
header called GNU_STACK. I prototyped some code that memory maps
extra space to the stack using this program header, but there was
still a problem when accessing stack memory very far down. Stack
probing is needed or not working or something. I also prototyped
using `@newStackCall` to call main and that does work around the
issue but it also brings its own issues. That code is commented out
for now in std/special/start.zig. I'm on a plane with no Internet,
but I plan to consult with the musl community for advice when I get a
chance.
* Added `noasync` to a bunch of function calls in std.debug. It's very
messy but it's a workaround that makes stack traces functional with
evented I/O enabled. Eventually these will be cleaned up as the root
bugs are found and fixed. Programs built in blocking mode are
unaffected.
* Lowered the default stack size of std.io.InStream (for the async
version) to 1 MiB instead of 4. Until we figure out how to get
choosing a stack size working (see 2nd bullet point above), 4 MiB
tends to cause segfaults due to stack size running out, or usage of
stack memory too far apart, or something like that.
* Default thread stack size is bumped from 8 MiB to 16 to match the
size we give for the main thread. It's planned to eventually remove
this hard coded value and have Zig able to determine this value
during semantic analysis, with call graph analysis and function
pointer annotations and extern function annotations.
- Replace @intCast with a checked version (std/debug.zig)
- Replace @intCast with i64() when casting from a smaller type (std/fs/file.zig)
- Replace `nakedcc` with appropriate calling convention for linking with c (std/os/linux/arm-eabi.zig)
- Only check if hwcap contains TLS when the hwcap field actually exists (std/os/linux/tls.zig)
* CLI: `-target [name]` instead of `--target-*` args.
This matches clang's API.
* `builtin.Environ` renamed to `builtin.Abi`
- likewise `builtin.environ` renamed to `builtin.abi`
* stop hiding the concept of sub-arch. closes#1526
* `zig targets` only shows available targets. closes#438
* include all targets in readme, even those that don't
print with `zig targets` but note they are Tier 4
* refactor target.cpp and make the naming conventions
more consistent
* introduce the concept of a "default C ABI" for a given
OS/Arch combo. As a rule of thumb, if the system compiler
is clang or gcc then the default C ABI is the gnu ABI.
Previously, std.debug.assert would `@panic` in test builds,
if the assertion failed. Now, it's always `unreachable`.
This makes release mode test builds more accurately test
the actual code that will be run.
However this requires tests to call `std.testing.expect`
rather than `std.debug.assert` to make sure output is correct.
Here is the explanation of when to use either one, copied from
the assert doc comments:
Inside a test block, it is best to use the `std.testing` module
rather than assert, because assert may not detect a test failure
in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert
is the correct function to use.
closes#1304