Andrew Kelley
435c8ad703
non-hacky workaround for the empty file bug
...
See #3328
2020-10-26 16:06:14 -07:00
Andrew Kelley
c1ae9f40c7
stage1: support "native" as the OS string in -target
...
This should help for bootstrapping purposes, intending to fix the macOS
CI.
2020-10-26 15:48:48 -07:00
frmdstryr
1ce0994897
Fix @import of empty file
2020-10-26 13:29:32 -07:00
Andrew Kelley
e83334274f
add regression test for already fixed bug
...
closes #6781
2020-10-26 13:18:44 -07:00
data-man
194e29adfc
Format null type in std.fmt
2020-10-26 15:40:48 -04:00
Andrew Kelley
a0f4606f32
ci: still build zig even though we are using (older) zig cc
2020-10-26 10:50:43 -07:00
Yanis Zafirópulos
c6747e1063
Copy editing :)
2020-10-26 18:39:34 +01:00
Frank Denis
74a1175d9d
std/*: add missing MIT license headers
2020-10-26 17:41:29 +01:00
mlarouche
e3fed3c814
Temp Fix for deadlock in C compilation, found and tested on Windows
2020-10-25 21:33:46 -04:00
johnLate
0a619c68a6
fix type mismatch in std.net.StreamServer
...
Parameter in std.os.listen is u31.
Fixes ziglang#6775
2020-10-25 21:18:24 -04:00
dec05eba
c0fa5963ee
Make lastIndexOf use the same cut-off between BMH as indexOf
...
Also update test to use a string longer than 52 characters
to test both BMH and linear path.
2020-10-25 21:17:22 -04:00
Frank Denis
72064eba23
std/crypto: vectorize BLAKE3
...
Gives a ~40% speedup on x86_64.
However, the generic code remains faster on aarch64.
This is still processing only one block at a time for now.
I'm pretty confident that processing more blocks per round
will eventually give a substantial performance improvement on
all platforms with vector units.
2020-10-25 21:13:14 -04:00
Frank Denis
1b4ab749cf
std/crypto: add the bcrypt password hashing function
...
The bcrypt function intentionally requires quite a lot of CPU cycles
to complete.
In addition to that, not having its full state constantly in the
CPU L1 cache causes a massive performance drop.
These properties slow down brute-force attacks against low-entropy
inputs (typically passwords), and GPU-based attacks get little
to no advantages over CPUs.
2020-10-25 21:11:40 -04:00
Sébastien Marie
2a0a11aa66
openbsd: make dl_phdr_info cross arches
...
introduce Addr and Half definition to std.elf, and use them for dl_phdr_info
2020-10-25 20:46:28 -04:00
Andrew Kelley
0088efc4b2
Merge pull request #6809 from jedisct1/salsa
...
std/crypto: add (X)Salsa20 and NaCl boxes
2020-10-25 20:34:35 -04:00
Andrew Kelley
bbd1e122d4
ci: skip compile error tests on freebsd to save time
2020-10-25 17:29:10 -07:00
Frank Denis
0c7a99b38d
Move ed25519 key pairs to a KeyPair structure
2020-10-25 21:55:05 +01:00
Frank Denis
28fb97f188
Add (X)Salsa20 and NaCl boxes
...
The NaCl constructions are available in pretty much all programming
languages, making them a solid choice for applications that require
interoperability.
Go includes them in the standard library, JavaScript has the popular
tweetnacl.js module, and reimplementations and ports of TweetNaCl
have been made everywhere.
Zig has almost everything that NaCl has at this point, the main
missing component being the Salsa20 cipher, on top on which NaCl's
secretboxes, boxes, and sealedboxes can be implemented.
So, here they are!
And clean the X25519 API up a little bit by the way.
2020-10-25 18:04:12 +01:00
Koakuma
cbc8750502
Separate libc stat and kernel stat definitions
2020-10-25 23:52:08 +07:00
Koakuma
3ce9428e3d
Various formatting fixes
2020-10-25 21:53:16 +07:00
Koakuma
5474d43389
Zero %i6 to terminate backchain
2020-10-25 21:51:01 +07:00
Koakuma
1a362ea5b0
Fix sparc64 bits definitions
2020-10-25 21:38:39 +07:00
Koakuma
785153d756
Fix SA_* constants for sparc64
2020-10-25 20:39:32 +07:00
Koakuma
f018201009
Predict error-less path on syscalls
2020-10-25 20:07:18 +07:00
joachimschmidt557
7b4f3c7cfc
stage2 ARM: genSetStack and genSetReg from stack
2020-10-25 12:51:19 +01:00
joachimschmidt557
7d14426da4
stage2 ARM: enable backpatching return statement
2020-10-25 12:51:19 +01:00
joachimschmidt557
0e16328636
stage2 ARM: add multiply and multiply long instructions
2020-10-25 12:51:19 +01:00
joachimschmidt557
7391087df1
stage2 ARM: better immediate loading feat. movw and movt
2020-10-25 12:51:19 +01:00
Vincent Rischmann
59af275680
test runner: use the correct number in leak report
2020-10-25 11:28:36 +02:00
Sébastien Marie
3115d2f2cd
readd original code from #6638 . realpathZ() is expected to take a [*:0]const u8
2020-10-25 10:02:10 +01:00
Koakuma
2e7a4758b3
Add back ppc input/output/clobber definitions
...
Accidentally removed when rebasing, this adds it back.
2020-10-25 13:39:22 +07:00
Koakuma
1d3abb761d
"zig fmt" on lib/std/os/linux.zig
2020-10-25 13:38:08 +07:00
Jakub Konka
872bc787b5
cc: fix regression on macOS after adding libc headers
...
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-24 17:32:50 +02:00
Koakuma
e7369ada93
Fix boolean operator in if clause
2020-10-24 21:33:40 +07:00
Koakuma
73e62f22ec
Fix sigaction(2) call on sparc64
2020-10-24 20:05:37 +07:00
Koakuma
792526c0bd
Fix sparc64 argument loading
2020-10-24 20:05:36 +07:00
Koakuma
cdbf66e36e
Add sparc64-specific values for the various SA_ and SIG_ constants
2020-10-24 20:05:34 +07:00
Koakuma
268516d5d9
Fix constants
2020-10-24 20:04:18 +07:00
Koakuma
238f253de9
Move comptime out
2020-10-24 20:03:41 +07:00
Koakuma
cefbe4e7be
Use correct names for generic SPARC targets
...
LLVM calls generic sparc32 CPUs "v8" and generic sparc64 CPUs "v9".
2020-10-24 20:03:41 +07:00
Koakuma
341eec71fd
Add clone(2) implementation
...
This implementation kindly provided by @LemonBoy at GitHub
https://github.com/ziglang/zig/pull/6187#issuecomment-682635168
2020-10-24 20:03:41 +07:00
Koakuma
300cfbf252
Add TLS implementation for sparc64
2020-10-24 20:03:40 +07:00
Koakuma
6146f81c6e
Add pipe(2) support
2020-10-24 20:03:37 +07:00
Koakuma
dba009fd21
Account for the delay slot
2020-10-24 20:01:32 +07:00
Koakuma
c29da84c0e
Add sp loading
2020-10-24 20:01:29 +07:00
Koakuma
23433fb317
Fix register naming
2020-10-24 19:59:05 +07:00
Koakuma
206f96d474
Add sparc64 linux C ABI
2020-10-24 19:59:04 +07:00
Koakuma
de06b0a635
Add sparc64 linux bits
2020-10-24 19:59:04 +07:00
Koakuma
e5a11020cc
Add sparc64 syscall interface
2020-10-24 19:59:04 +07:00
Frank Denis
91a1c20e74
Fix a typo (s/multple/multiple/)
2020-10-24 07:57:34 +02:00