2305 Commits

Author SHA1 Message Date
Andrew Kelley
c15e464320
Merge branch 'uefi' of https://github.com/nrdmn/zig into nrdmn-uefi 2019-09-13 14:10:42 -04:00
stratact
742abc71c7 Add missing C dl_iterate_phdr function for FreeBSD 2019-09-13 15:10:35 -04:00
LemonBoy
774f770056 Correct AT_FDCWD definition 2019-09-12 13:15:50 -04:00
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
Andrew Kelley
68b49f74c4
consolidate std.debug.parseDie and std.debug.parseDie1 2019-09-12 01:40:55 -04:00
LemonBoy
f36b8fd7b2 Recognize & skip the UTF-8 BOM 2019-09-11 15:20:18 -04:00
Andrew Kelley
67491a4222
disable runtime safety in std.io.InStream
Let's not be writing 0xaa in safe modes for upwards of 4 MiB for every
stream read. This is equivalent to the fact that we don't memset the
entire call stack to 0xaa for every function call.
2019-09-11 15:01:54 -04:00
Andrew Kelley
0489d06c24
make the std lib support event-based I/O
also add -fstack-report
2019-09-10 10:26:52 -04:00
daurnimator
a29ce78651 std: add BloomFilter data structure 2019-09-10 10:20:30 -04:00
LemonBoy
fec795cd29 Adjust the stdlib to be 32bit compatible 2019-09-09 16:16:13 -04:00
LemonBoy
e4c3067617 Fix typo in TLS initialization code 2019-09-09 13:54:31 -04:00
Andrew Kelley
d1a98ccff4
implement spills when expressions used across suspend points
closes #3077
2019-09-07 00:13:12 -04:00
Andrew Kelley
0a3c6dbda9
implement noasync function calls
See #3157
2019-09-05 21:55:32 -04:00
LemonBoy
fabf45f5fc Add the noinline keyword for function declarations 2019-09-05 13:04:58 -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
6a76298740 Add missing clobbers on arm-eabi and arm64 syscall conventions 2019-09-04 15:59:51 +02:00
Robin Voetter
5308eb7045 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-09-04 15:55:54 +02:00
Andrew Kelley
8a7e2e3479
Merge branch 'comment-in-array' of https://github.com/Vexu/zig into Vexu-comment-in-array 2019-09-03 21:49:35 -04:00
Andrew Kelley
a4ce10df80
Merge pull request #3169 from Sahnvour/string_hash_map
Using StringHashMap everywhere it's needed
2019-09-03 20:30:26 -04:00
Sahnvour
9d6f236728 add fastpath for std.mem.eql and simplify std.hash_map.eqlString
this should also be friendlier to the optimizer
2019-09-03 23:56:04 +02:00
Sahnvour
f08c6e4fe6 changing occurrences of HashMap with []const u8 as keys for StringHashMap 2019-09-03 23:53:05 +02:00
Andrew Kelley
fc0f8d0359
zig build: make install prefix available to build.zig and
prevent accident of '/' showing up in application/library names
2019-09-03 16:19:10 -04:00
Vesa Kaihlavirta
e9530ce97b Fix addition direction, remove superfluous loop counter, add tests 2019-09-03 13:45:02 -04:00
Nick Erdmann
5e874a89b9
std/os/uefi: fix ordering of packed bit fields 2019-09-02 22:31:59 +02:00
Nick Erdmann
8db41b7adb
std/os/uefi: add support for getting memory map 2019-09-02 22:10:50 +02:00
Nick Erdmann
03abc6edf4
std/os/uefi: add global_variable guid 2019-09-02 20:34:00 +02:00
Andrew Kelley
0fe28855c5
add ability to specify darwin framework search dirs 2019-09-02 11:48:06 -04:00
Robin Voetter
d62f7c6b60 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-09-01 23:45:51 +02:00
Robin Voetter
e7912dee9b Fix up preadv, preadv2, pwritev and pwritev2 2019-09-01 16:10:36 +02:00
Robin Voetter
e9d795b025 Fix up seteuid and setegid 2019-09-01 12:08:02 +02:00
Robin Voetter
e39c93a2f3 Replace legacy 16-bit syscalls with 32-bit versions when appropriate 2019-09-01 11:54:57 +02:00
Andrew Kelley
8b1900e5df
Revert "Merge pull request #2991 from emekoi/mingw-ci"
This reverts commit ec7d7a5b14540ea3b2bab9f11318630338467965, reversing
changes made to 81c441f8855d4c58f0b2ff86d3d007cf0bf395d3.

It looks like this broke colors in Windows Command Prompt (#3147)
and this method of detecting native C ABI isn't working well (#3121).
2019-09-01 00:33:02 -04:00
Andrew Kelley
6ab8b2aab4
support recursive async and non-async functions
which heap allocate their own frames

related: #1006
2019-08-30 20:06:02 -04:00
Andrew Kelley
2148943fff
Merge pull request #3139 from hspak/zig-fmt-nested-if
zig fmt: fix nested if
2019-08-30 15:48:07 -04:00
Robin Voetter
7a2b4cb9a1 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 21:37:46 +02:00
Andrew Kelley
d9fed5cdfd
align(@alignOf(T)) T does not force resolution of T 2019-08-30 14:53:44 -04:00
Robin Voetter
ca2aa4880f Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 13:02:28 +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
Hong Shick Pak
19964f5dc8 run new zig fmt and remove stale comment 2019-08-29 21:23:49 -07:00
Hong Shick Pak
9f4d44bc49 zig fmt: fix nested if 2019-08-29 21:10:26 -07:00
Andrew Kelley
8e93991634
avoid unnecessarily requiring alignment for array elem pointers 2019-08-29 16:25:58 -04:00
Robin Voetter
2323da3a68 add __aeabi_read_tp 2019-08-29 18:12:58 +02:00
Robin Voetter
e4c262b804 Don't print line info if source is not available 2019-08-29 10:52:50 +02:00
Robin Voetter
108a51b110 fix issues with debug.zig
- Use sys_*stat*64 instead of sys_*stat* where appropriate
- Fix overflow when calculating atime, ctime and mtime on File.stat()
- Fix compilation error casting getEndPos to usize.
2019-08-29 10:34:05 +02:00
Robin Voetter
b3ac323a44 TLS initialization, clone definition and _start functionality 2019-08-29 01:14:43 +02:00
Robin Voetter
57de61084e Make mmap use SYS_mmap2 if it exists 2019-08-29 00:55:22 +02:00
Robin Voetter
223b773e03 Add more syscall constants 2019-08-29 00:54:57 +02:00