11949 Commits

Author SHA1 Message Date
g-w1
ea18f894f5
Peer type resolution with unsigned ints and larger signed ints 2020-12-23 00:05:42 +02:00
Veikka Tuominen
03113d9246
Merge pull request #7111 from tetsuo-cpp/emit-h
Implement emit-h
2020-12-23 00:01:22 +02:00
Veikka Tuominen
ba2f2e1393
Merge pull request #7476 from ifreund/pkgs
stage2: free Package resources, print package path on --pkg-begin failure
2020-12-23 00:00:37 +02:00
Evan Haas
ccdb81fb31 Improve handling of C compiler intrinsics in translate-c
C compiler intrinsics can only appear as part of a function call. When called
they are implicitly cast to a function pointer; treat this as a non-null
pointer so that it emits as a regular Zig function call.

Put `pub usingnamespace @import("std").c.builtins;` at the top of translated
C files so that they will have access to builtin functions defined there.

Fixes #6707
2020-12-22 23:59:30 +02:00
luna
6a75cfd0f6
cast sendto to SendError inside send (#7481)
* cast sendto to SendError inside send

* remove WouldBlock from SendToError

* add missing ENOTCONN mapping

* remove SystemResources duplicate

* move NetworkUnreachable to SendError

* add NetworkSubsystemFailed to SendError

* Use zig's implicit error set casting

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-12-22 16:47:11 -05:00
Alex Cameron
9849e894d5 Add emit_h path to compilation hash. 2020-12-23 01:14:35 +11:00
Alex Cameron
0771aac48b Don't use emit-h in test cases for other backends. 2020-12-23 01:14:35 +11:00
Alex Cameron
e834d0369a Make sure emit-h is off by default. 2020-12-23 01:14:35 +11:00
Alex Cameron
58bd6c5f8e Add tests for emit-h functionality. 2020-12-23 01:14:35 +11:00
Noam Preil
8d6066e09c Fix a dumb 2020-12-23 01:14:35 +11:00
Noam Preil
8538053940 Add header test harness 2020-12-23 01:14:35 +11:00
Noam Preil
ac33b10b5e CBE: Improve formatting 2020-12-23 01:14:35 +11:00
Noam Preil
37438dd789 CBE: add support for bool,u32 2020-12-23 01:14:35 +11:00
Noam Preil
15a148db01 Fix memory leak 2020-12-23 01:14:35 +11:00
Alex Cameron
c87da2f45a Remove redundant emit_h member in Compilation struct. 2020-12-23 01:14:35 +11:00
Alex Cameron
aba273d731 Enable emit-h by default for obj and lib compilation. 2020-12-23 01:14:35 +11:00
Alex Cameron
40f0275e7c Implement emit-h 2020-12-23 01:14:35 +11:00
Jakub Konka
43dbe86226
Merge pull request #7516 from kubkon/macho-better-space-alloc
macho: space preallocation, and various cleanups and fixes
2020-12-22 14:23:55 +01:00
Jakub Konka
34663abc90 macho: pad out LINKEDIT upto specified filesize 2020-12-22 10:57:58 +01:00
Jakub Konka
f106a46fd2 macho: enable binding and lazy binding info writes 2020-12-21 23:16:00 +01:00
Jakub Konka
3f21f9155f macho: write only bits that changed
Refactor use of `log` to not include an additional newline char.
2020-12-21 19:59:40 +01:00
Jakub Konka
de5421a0a6 macho: deduplicate symbol table relocation codepath 2020-12-21 18:31:26 +01:00
Jakub Konka
a1b3606f0e macho: dynamically preallocate space for LINKEDIT sections as well 2020-12-21 17:03:55 +01:00
Vexu
286077fec8 stage1: add missing error check on inferred struct field ptr 2020-12-21 12:40:51 +02:00
Andrew Kelley
4918605176
Merge pull request #7462 from ziglang/parallel-c-objects
Introduce a ThreadPool and parallel execution of some of the compilation work items
2020-12-20 21:19:05 -05:00
Andrew Kelley
1d94a68936 add an option to compile zig in single-threaded mode
And enable it for Drone CI. I hate to do this, but I need to make
progress on other fronts.
2020-12-20 15:37:58 -07:00
Andrew Kelley
10d30838d1 update WaitGroup to yet another version 2020-12-20 15:08:59 -07:00
Andrew Kelley
fbcffe9d5d std.Progress: fix atomic ordering semantics
thx king protty
2020-12-20 15:08:59 -07:00
Andrew Kelley
4e621d4260 workaround for std lib AutoResetEvent bug 2020-12-20 15:08:59 -07:00
Andrew Kelley
e00b6db2aa update stage2 test harness to new std.Progress API 2020-12-20 15:08:59 -07:00
Andrew Kelley
aa6ef10cc6 std.Progress: make the API thread-safe
We generally get away with atomic primitives, however a lock is required
around the refresh function since it traverses the Node graph, and we
need to be sure no references to Nodes remain after end() is called.
2020-12-20 15:08:59 -07:00
Andrew Kelley
b2f8631a3c ThreadPool: delete dead code
If this errdefer did get run it would constitute a race condition. So I
deleted the dead code for clarity.
2020-12-20 15:08:59 -07:00
Andrew Kelley
32fd637e57 stage2: replace WaitGroup with a trivially auditable one 2020-12-20 15:08:59 -07:00
Andrew Kelley
0d1cd0d482 use kprotty's ThreadPool implementation (v5) 2020-12-20 15:08:59 -07:00
Andrew Kelley
01d33855c7 stage2: protect mutable state from data races in updateCObject 2020-12-20 15:08:59 -07:00
Andrew Kelley
4964bb3282 std: move serialization to the std lib orphanage
std-lib-orphanage commit 633792839f6f838fa864cde6af015413ee713404
2020-12-20 15:08:06 -07:00
LemonBoy
84549b4267 stage1: Fix for generic fn monomorphization
Don't use the instantiation argument types to build the function
parameter array.

f416535768fc30195cad6cd481f73fd1e80082aa worked around the problem, this
commit solves it.
2020-12-19 19:45:48 -05:00
Vincent Rischmann
dd7b816d98 builder: implement float options 2020-12-20 01:24:59 +02:00
Jakub Konka
3f7dbde92a macho: bring back allocatedSize function 2020-12-19 23:51:39 +01:00
Jakub Konka
6712575e04 macho: preallocate space for linkedit hidden sections; 2020-12-19 23:37:21 +01:00
Jakub Konka
ca1d03fe77 macho: fix findFreeSpace start value 2020-12-19 19:44:13 +01:00
Jakub Konka
c89f4781bd macho: add missing dirty markers 2020-12-19 12:19:20 +01:00
Jakub Konka
f32681033d macho: auto-coerce to slice 2020-12-19 12:19:10 +01:00
Jakub Konka
99578e828b macho: move findFreeSpace back to MachO struct
However, adding a twist where `findFreeSpace` accepts a `SegmentCommand`
as argument meaning we want to look for free space specifically within
that segment and nowhere else.
2020-12-19 12:19:00 +01:00
Jakub Konka
6a021d845a macho: find free space even for __text section 2020-12-19 12:18:49 +01:00
Jakub Konka
f33b644c4f macho: redo how we allocate within a segment
Firstly, we preallocate segments offset and sizes, and then
when adding sections, we find the free space within each segment.
Currently, this applies to any segment that is not __LINKEDIT
segment since this requires special treatment.
2020-12-19 12:18:35 +01:00
Jakub Konka
b090451646
Merge pull request #7318 from kubkon/cc-macho
stage1: cross compile to x86_64 and arm64 macOS from anywhere with LLVM
2020-12-19 12:13:03 +01:00
Jakub Konka
3f81ddb735 macho: address review comments 2020-12-19 09:59:38 +01:00
Andrew Kelley
506af7e52e
Merge pull request #7482 from ziglang/tlcsprng
std: introduce a thread-local CSPRNG for general use
2020-12-18 23:57:46 -05:00
Andrew Kelley
f416535768 work around compiler bug regarding generic function slice alignment
See #7495
2020-12-18 18:30:06 -07:00