Commit Graph

11548 Commits

Author SHA1 Message Date
Andrew Kelley
647c6e0d09 tfw you can't even disable a test without getting the logic wrong 2020-11-19 13:28:54 -07:00
Veikka Tuominen
cf819b95fe
Merge pull request #6829 from tadeokondrak/error-unsupported-callconv
stage1: Compile error instead of falling back to C for unsupported cc
2020-11-19 19:03:08 +02:00
Tadeo Kondrak
25ec2dbc1e Add builtin.Signedness, use it instead of is_signed 2020-11-19 18:59:21 +02:00
Vexu
3a28b659bd
add compile-error tests for unsupported calling convention 2020-11-19 14:25:46 +02:00
Tadeo Kondrak
51b362c350
stage1: Check calling convention correctly for subsystem detection 2020-11-19 14:18:35 +02:00
Tadeo Kondrak
c002a5026a
Update code to not use unsupported calling conventions for target 2020-11-19 14:01:07 +02:00
Tadeo Kondrak
6b9dc82fa5
stage1: Compile error instead of falling back to C for unsupported cc 2020-11-19 13:59:11 +02:00
LemonBoy
2b7781d82a stage1: Fix undefined assignment for bitfields
Prevents silent memory corruption.

Closes #7055
2020-11-18 21:49:39 -08:00
Andrew Kelley
13cccdd92c add std.heap.raw_c_allocator
This API does what `std.heap.c_allocator` previously did. See the new
doc comments for more details.
2020-11-18 22:09:34 -07:00
Andrew Kelley
02a4e5a4bf
Merge pull request #6385 from LemonBoy/callocator
std: Make C allocator respect the required alignment
2020-11-18 20:16:57 -08:00
breakin
6d3c176c12 Change seed for Murmur2_64 from u32 to u64 2020-11-18 17:05:38 -08:00
Veikka Tuominen
2418c8206a
Merge pull request #7154 from daurnimator/std.atomic
std.atomic.{Int,Bool}
2020-11-18 21:48:17 +02:00
pfg
cf7de64f1a stage1: improve error for missing a number type on a runtime var 2020-11-18 21:45:51 +02:00
Jakub Konka
663e112773 std: add chdir smoke test 2020-11-18 15:37:44 +01:00
Lee Cannon
64feae3ac3 Move utf8->utf16 up one level into os.zig 2020-11-18 15:37:44 +01:00
Lee Cannon
dbbe709dc7 use else in err switch 2020-11-18 15:37:44 +01:00
Lee Cannon
32c998e03c Switch to RtlSetCurrentDirectory_U 2020-11-18 15:37:44 +01:00
Lee Cannon
80b1e82b1b Implement chdir and chdirZ for Windows 2020-11-18 15:37:44 +01:00
Veikka Tuominen
a6470088c6
Merge pull request #6434 from daurnimator/fifo.pump
std: add LinearFifo(...).pump(src_reader, dest_writer)
2020-11-18 16:35:13 +02:00
Veikka Tuominen
ee1d21bbef
Merge pull request #6649 from Rocknest/verparse
make Version.parse less strict
2020-11-18 16:06:52 +02:00
daurnimator
767dd772c0
std: add std.atomic.Bool 2020-11-19 00:58:13 +11:00
daurnimator
d89d6374be
std: add tests for std.atomic.Int 2020-11-19 00:57:54 +11:00
daurnimator
8fa29bc0a2
std: fix missing operation argument to @atomicRmw 2020-11-19 00:57:35 +11:00
daurnimator
eb4d93ece3
std: some more docs for std.atomic.Int 2020-11-19 00:44:38 +11:00
daurnimator
513e8161dd
std: mark std.atomic.Int as extern so it can be used in public ABIs 2020-11-19 00:41:43 +11:00
daurnimator
c492ef97fd std: expose all atomic operations from std.atomic.Int 2020-11-18 15:36:40 +02:00
Vexu
da84ef2a9c
make help in commands more consistent
Closes #7101

Co-authored-by: pfg <pfg@pfg.pw>
2020-11-18 13:58:27 +02:00
frmdstryr
a39d3155b4 Change error when runtime value passed to comptime arg 2020-11-18 13:33:45 +02:00
LemonBoy
129ccad434 stage1: Reject undefined values when taking union ptr
The code rightfully assumes the union_val object to be fully initialized.

Closes #7019
2020-11-18 13:21:36 +02:00
Alexandros Naskos
252924ae33 Added std.meta.fieldNames 2020-11-18 13:16:56 +02:00
Veikka Tuominen
6d5b76a75d
Merge pull request #7005 from jshholland/deprecate-span
Remove ArrayList.span
2020-11-18 13:14:48 +02:00
Timon Kruiper
66d6930b5c Allow Zig to be built with clang 11 and -Werror
This was brought to the horizon when using zig-bootstrap to cross compile
Zig for windows-gnu.
2020-11-18 13:09:44 +02:00
LemonBoy
bef140c0a2 stage1: Add architecture-specific clobbers to asm()
We're basically following Clang's lead, add the necessary clobbers to
minimize the risk of generating wrong code.
2020-11-18 13:08:04 +02:00
Veikka Tuominen
1e1a490600
Merge pull request #7084 from xackus/mem-volatile
std.mem: make sliceAsBytes, etc. respect volatile
2020-11-18 13:06:35 +02:00
xackus
27b73cc395 std: make meta.IntType a compile error
the function signature changed
also update langref
2020-11-18 12:57:49 +02:00
Jakub Konka
39336fd2e9 stage2 aarch64: assert register is 64bits in PCrel
Thanks @joachimschmidt557 for pointing out this fix!
2020-11-18 10:12:39 +01:00
Jakub Konka
5ff8dd179e stage2 aarch64: add PC relative address instructions 2020-11-18 08:46:52 +01:00
g-w1
a0226ab05b
std: openDirAbsolute and accessAbsolute (#7082)
* add more abosolutes

* added wrong files

* adding 2 tests and changing the function signatures because of lazy analysis not checking them

* fix a bug that got uncovered by lazy eval

* Add compile error when using WASI with openDirAbsolute and accessAbsolute

* typo
2020-11-18 08:42:35 +01:00
Andrew Kelley
238718b93a disable the flaky ResetEvent test
See #7009
2020-11-17 18:08:10 -07:00
Frank Denis
9c2b014ea8 std/crypto: use NAF for multi-scalar edwards25519 multiplication
Transforming scalars to non-adjacent form shrinks the number of
precomputations down to 8, while still processing 4 bits at a time.

However, real-world benchmarks show that the transform is only
really useful with large precomputation tables and for batch
signature verification. So, do it for batch verification only.
2020-11-17 17:07:32 -08:00
Frank Denis
0d9c474ecf std/crypto: implement the Hash-To-Curve standard for Edwards25519
https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve

This is quite an important feature to have since many other standards
being worked on depend on this operation.

Brings a couple useful arithmetic operations on field elements by the way.

This PR also adds comments to the functions we expose in 25519/field
so that they can appear in the generated documentation.
2020-11-17 17:06:38 -08:00
LemonBoy
fa27420b72 stage1: Fix asyncCall with non-abi-aligned arguments
Make the code used to calculate the variable slot index into the frame
match what's done during the structure layout calculation.

Prevents a few nasty LLVM errors when such types are passed around.
2020-11-17 15:55:12 -08:00
Andrew Kelley
af4727814b cli: make -h, --help consistent in usage text and parsing
also trivial fixes in the general usage text
2020-11-17 16:53:45 -07:00
Andrew Kelley
2eee0582f8 macOS libc headers: downgrade to 10.15.7 (Catalina)
See ziglang/fetch-them-macos-headers#2 for more details. The path
forward looks like one of the following:

 * Ony provide headers for the oldest supported macOS (currently 10.13
   but soon to be bumped to 10.14).
 * Provide headers for multiple versions, and select based on the Zig
   target OS version range minimum.
 * Don't try to provide macOS headers.

If we don't tackle the version problem, we would have to re-introduce
the ability to detect and depend on native system headers if we wanted
to support C/C++ code that used newer OS definitions.

This patch also adds support for `#include <mach/mach_time.h>`.

Also related: #5236
2020-11-17 11:40:24 -08:00
Alexandros Naskos
21a77f7ac3
Merge pull request #7032 from GuoxinYin/master
Add -h alias for --help
2020-11-17 15:52:39 +02:00
Andrew Kelley
e6bfa377d1 std.crypto.isap: fix callsites of secureZero 2020-11-16 18:10:41 -07:00
Andrew Kelley
8b3c1ed734 Merge branch 'johnLate-issue-6724-cmake' into master
closes #7078
closes #6724
2020-11-16 18:03:06 -07:00
Andrew Kelley
3348cb915f cmake: add the correct set of zig stage2 sources 2020-11-16 17:57:22 -07:00
johnLate
77d67aa662 CMake: try to avoid compilation for install target
This is andrewrk's patch from ziglang#6724 (rebased)

CMake: Fix dependency problem

I don't know whether the error was expected cmake behavior or a bug.
This change seems to fix the issue. See ziglang#6724 for details.
2020-11-16 17:45:13 -07:00
Frank Denis
f9d209787b std/crypto: add ISAPv2 (ISAP-A-128a) AEAD
We currently have ciphers optimized for performance, for
compatibility, for size and for specific CPUs.

However we lack a class of ciphers that is becoming increasingly
important, as Zig is being used for embedded systems, but also as
hardware-level side channels keep being found on (Intel) CPUs.

Here is ISAPv2, a construction specifically designed for resilience
against leakage and fault attacks.

ISAPv2 is obviously not optimized for performance, but can be an
option for highly sensitive data, when the runtime environment cannot
be trusted.
2020-11-16 16:02:19 -08:00