22872 Commits

Author SHA1 Message Date
Jakub Konka
e9fc0aba4c x86_64: add missing source files to CMakeLists.txt 2023-03-12 22:08:29 +01:00
Jakub Konka
ac434fd8cc x86_64: avoid inline for-loops when scanning the encodings table 2023-03-12 22:06:22 +01:00
Jakub Konka
955e394792 x86_64: fix 32bit build issues in the encoder 2023-03-12 08:47:23 +01:00
Jakub Konka
707a74655b x86_64: downstream encoder/assembler tests 2023-03-12 08:41:44 +01:00
Jakub Konka
433558a92f x86_64: clean up 2023-03-11 20:05:50 +01:00
Jakub Konka
f279ccb807 x86_64: rename asmNone to asmOpOnly 2023-03-11 20:05:50 +01:00
Jakub Konka
fb38e3d6b2 x86_64: simplify immediate handling at MIR level 2023-03-11 20:05:50 +01:00
Jakub Konka
0a8b5c20aa x86_64: add wrapper for .jcc with relocation 2023-03-11 20:05:50 +01:00
Jakub Konka
c9a153c797 x86_64: add .dead pseudo-instruction to mark an unused MIR instruction 2023-03-11 20:05:50 +01:00
Jakub Konka
621fc36b55 x86_64: add wrapper for .jmp_reloc 2023-03-11 20:05:50 +01:00
Jakub Konka
21630ea17f x86_64: apply couple of tweaks and pass behavior tests 2023-03-11 20:05:50 +01:00
Jakub Konka
6e1da36503 x86_64: PtrSize.fromSize() should take into account nonexact sizes too 2023-03-11 20:05:50 +01:00
Jakub Konka
e34e7d5ad1 x86_64: add missing decodings for .movsx 2023-03-11 20:05:50 +01:00
Jakub Konka
fe1fab4a8e x86_64: fix CALL emits for ELF and Plan9 2023-03-11 20:05:49 +01:00
Jakub Konka
d0e7212539 x86_64: finish rolling out all MIR assembly helpers 2023-03-11 20:05:49 +01:00
Jakub Konka
022b308d6a x86_64: start converting MI references 2023-03-11 20:05:49 +01:00
Jakub Konka
4af8313f36 x86_64: plug up all RM/MR references 2023-03-11 20:05:49 +01:00
Jakub Konka
32708dd6e2 x86_64: add RM and MR helpers to codegen 2023-03-11 20:05:49 +01:00
Jakub Konka
9658ab6766 x86_64: handle all instructions without introducing Memory operand 2023-03-11 20:05:49 +01:00
Jakub Konka
1bde522c2c x86_64: add helper for Jcc instruction 2023-03-11 20:05:49 +01:00
Jakub Konka
7221cd8ec9 x86_64: add helpers for CMOVcc and SETcc at the MIR level 2023-03-11 20:05:49 +01:00
Jakub Konka
f61a70e812 x86_64: handle encoding and decoding Imm64 unsigned 2023-03-11 20:05:49 +01:00
Jakub Konka
aa8fda799e x86_64: split up assemble() into more declarative single-purpose helpers 2023-03-11 20:05:49 +01:00
Jakub Konka
6e882d730b x86_64: introduce assemble() helper which encodes/decodes into MIR -> Instruction 2023-03-11 20:05:49 +01:00
Jakub Konka
5b37701028 x86_64: refactor immediate selection logic 2023-03-11 20:05:49 +01:00
Jakub Konka
219c1261a5 x86_64: all behavior tests passing 2023-03-11 20:05:49 +01:00
Jakub Konka
292f91aef2 Handle .ah vs .spl register aliases 2023-03-11 20:05:49 +01:00
Jakub Konka
bc43cee775 Get more things passing 2023-03-11 20:05:49 +01:00
Jakub Konka
ea3b3e94ab x86_64: clean up call semantics in codegen 2023-03-11 20:05:49 +01:00
Jakub Konka
f14831ec73 x86_64: truncate immediates 2023-03-11 20:05:49 +01:00
Jakub Konka
817fb263b5 x86_64: downstream table-driven instruction encoder 2023-03-11 20:05:49 +01:00
Andrius Bentkus
4ea2f441df Module: retry ZIR cache file creation
There are no dir components, so you would think that this was
unreachable, however we have observed on macOS two processes racing to
do openat() with O_CREAT manifest in ENOENT.

closes #12138
2023-03-11 06:20:51 -05:00
Andrew Kelley
3169f0529b eliminate posix_spawn from the standard library
Today I found out that posix_spawn is trash. It's actually implemented
on top of fork/exec inside of libc (or libSystem in the case of macOS).

So, anything posix_spawn can do, we can do better. In particular, what
we can do better is handle spawning of child processes that are
potentially foreign binaries. If you try to spawn a wasm binary, for
example, posix spawn does the following:

 * Goes ahead and creates a child process.
 * The child process writes "foo.wasm: foo.wasm: cannot execute binary file"
   to stderr (yes, it prints the filename twice).
 * The child process then exits with code 126.

This behavior is indistinguishable from the binary being successfully
spawned, and then printing to stderr, and exiting with a failure -
something that is an extremely common occurrence.

Meanwhile, using the lower level fork/exec will simply return ENOEXEC
code from the execve syscall (which is mapped to zig error.InvalidExe).

The posix_spawn behavior means the zig build runner can't tell the
difference between a failure to run a foreign binary, and a binary that
did run, but failed in some other fashion. This is unacceptable, because
attempting to excecve is the proper way to support things like Rosetta.
2023-03-10 15:41:07 -05:00
Luuk de Gram
904f414e7e
Merge pull request #14869 from Luukdegram/wasm-linker
wasm-linker: refactor virtual addresses
2023-03-10 16:48:30 +01:00
Lavt Niveau
5a26d1b426
Include signal.h to define SIGTRAP in Stage 1 compiler (#14867)
copy lib/zig.h to stage1/zig.h

In this case, it looks safe to backport over with no changes.

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2023-03-10 13:36:43 +00:00
mlugg
023753b469 Sema: correctly detect use of undefined within slices in @Type
Resolves: #14712
2023-03-10 12:18:06 +02:00
Luuk de Gram
0ee9a52507
wasm-linker: remove synthetic segments & atoms 2023-03-10 06:20:10 +01:00
antlilja
b445bbfea2 Add ability to import dependencies from build.zig 2023-03-09 22:38:14 -05:00
Andrew Kelley
7c9ed45ac2
Merge pull request #14762 from truemedian/http-keepalive
std.http: add connection pooling, handle keep-alive and compressed content
2023-03-09 22:02:01 -05:00
mlugg
14590e956e Fix test case added in 6d7fb8f 2023-03-09 23:25:38 +02:00
Nameless
524e0cd987
std.http: rework connection pool into its own type 2023-03-09 14:55:31 -06:00
Nameless
634e715504
std.http: split Client's parts into their own files 2023-03-09 14:55:20 -06:00
Nameless
0a4130f364
std.http: handle relative redirects 2023-03-09 14:55:13 -06:00
Nameless
fd2f906d1e
std.http: handle compressed payloads 2023-03-09 14:54:26 -06:00
Nameless
8d86194b6e
add error sets to tcpConnect* and tls.Client.init 2023-03-09 14:54:26 -06:00
Nameless
afb26f4e6b
std.http: add connection pooling and make keep-alive requests by default 2023-03-09 14:54:23 -06:00
Frank Denis
95f6a5935a
TurboSHAKE: change default delimiter to 0x1F (#14857)
The TurboSHAKE paper just got published:
https://eprint.iacr.org/2023/342.pdf

and unlike the previous K12 paper, suggests 0x1F instead of 0x01
as the default value for "D".
2023-03-09 19:20:57 +00:00
Luuk de Gram
87738cad86
wasm-linker: store symbol's virtual address
For data symbols we will now store its virtual address. This means
we do no longer have to calculate it each time a relocation asks
for the address. This is now done for all data symbols only once
rather than every single relocation for that symbol.

This now also allows us directly store the virtual address of synthetic
symbols without having to create an atom for them. This means we also
don't need to have a "synthetic" segment any longer and do not emit
the synthetic symbols such as __heap_end and __heap_base into the final
binary.
2023-03-09 19:14:17 +01:00
Andrew Kelley
12b74b2c05 CI: more aggressively check zig1 bootstrapping
This would have caught the problem we are seeing in #14799.
2023-03-09 01:26:21 -05:00
Frank Denis
134e5748e0
Fix incorrect SHA-3 computation with the streaming API (#14852)
* Fix SHA3 with streaming

Leftover bytes should be added to the buffer, not to the state.

(or, always to the state; we can and probably should eventually get
rid of the buffer)

Fixes #14851

* Add a test for SHA-3 with streaming
2023-03-09 05:18:15 +00:00