18 Commits

Author SHA1 Message Date
Andrew Kelley
cf4bccf765
improvements targeted at improving async functions
* 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.
2019-09-12 01:40:58 -04:00
LemonBoy
e4c3067617 Fix typo in TLS initialization code 2019-09-09 13:54:31 -04:00
Andrew Kelley
a7fd14096c
fix typo with tls initialization
I tested that hello world cross compiles to armv7 now.

closes #3167
2019-09-04 14:44:16 -04:00
Robin Voetter
df06976e73 Only check for TLS support on arm if TLS segment exists 2019-09-04 17:48:01 +02:00
Robin Voetter
77d04c03e3 Implement remaining requested changes
- 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)
2019-09-04 16:23:25 +02:00
Robin Voetter
4b8325f381 Remove unneeded os check 2019-08-30 13:02:15 +02:00
Robin Voetter
c1f8b201a1 Improve comments near un-implemented functionality 2019-08-30 12:58:44 +02:00
Robin Voetter
2323da3a68 add __aeabi_read_tp 2019-08-29 18:12:58 +02:00
Robin Voetter
b3ac323a44 TLS initialization, clone definition and _start functionality 2019-08-29 01:14:43 +02:00
Andrew Kelley
2b42e910bf
behavior tests passing on Linux 2019-05-26 19:56:37 -04:00
Andrew Kelley
7cb6279ac0
clean up references to posix 2019-05-26 18:32:44 -04:00
Andrew Kelley
67726e36b0
extract posix functions from std/os.zig to std/os/posix.zig
See #2380
2019-05-26 18:32:40 -04:00
emekoi
1c73c08298 ran zig fmt on stdlib 2019-05-19 16:33:31 -04:00
Andrew Kelley
c1793d6106
zig fmt on the standard library 2019-05-12 12:56:01 -04:00
LemonBoy
043bd71621 Add ARCH_SET_* definitions for x86_64 2019-05-07 13:19:38 +02:00
LemonBoy
b1db696c10 Less error messages
Decrease the overall size of the binary, programming errors are caught
with unreachable.
2019-05-07 13:09:20 +02:00
LemonBoy
cfcf02489d std: Implement on-demand TLS allocation 2019-05-07 13:09:19 +02:00
LemonBoy
d8ab301aa8 std: Implement TLS support for Linux
Tested on x86_64, i386, ARM, AARCH64
2019-05-07 13:09:18 +02:00