22771 Commits

Author SHA1 Message Date
Jacob Young
8ea1c1932e behavior: disable failing tests 2023-03-05 04:25:04 -05:00
Andrew Kelley
16302578d5 add behavior test case for previous commit 2023-03-04 14:04:58 -07:00
Jacob Young
2cf27c5718 llvm: fix incorrectly annotated DIType
Closes #14715
Closes #14783
2023-03-04 13:52:47 -07:00
Andrew Kelley
653814f76b std.Build.addModule: return the created module 2023-03-04 05:39:14 -05:00
Jakub Konka
18e6d1e819
Merge pull request #14781 from ziglang/codegen-cleanup
codegen: move common logic for generating typed values from each native backend into codegen.zig
2023-03-04 03:38:12 +01:00
r00ster91
e0d3904638 Ast: properly handle sentinel-terminated slices in tuple
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-03-04 01:08:03 +02:00
Ali Chraghi
75ff34db9e std.Build.Cache: remove 'test-filetimestamp.tmp' once timestamp returned 2023-03-03 13:50:44 -05:00
Jakub Konka
dc709fbf48 codegen: rename GenerateSymbolError to CodeGenError 2023-03-03 18:56:57 +01:00
Jakub Konka
d23472747e elf: fully zero out symbol when appending to freelist 2023-03-03 18:53:47 +01:00
Jakub Konka
f6eeb6c8ce sparc64: use common implementation of genTypedValue 2023-03-03 18:53:30 +01:00
Jakub Konka
5b3ea49806 riscv64: use common implementation of genTypedValue 2023-03-03 18:53:13 +01:00
Jakub Konka
0d2c25ca9d aarch64: use common implementation of genTypedValue 2023-03-03 18:46:08 +01:00
Andrew Kelley
2834b937f1 link: give executable bit to wasm executables sometimes
Give +x to the .wasm file if it is an executable and the OS is WASI.
Some systems may be configured to execute such binaries directly. Even
if that is not the case, it means we will get "exec format error" when
trying to run it rather than "access denied", and then can react to that
in the same way as trying to run an ELF file from a foreign CPU
architecture.

This is part of the strategy to unify RunStep and EmulatableRunStep.
2023-03-03 12:43:12 -05:00
Jakub Konka
d8d8842190 arm: skip unimplemented behavior test for @fieldParentPtr 2023-03-03 18:42:29 +01:00
Jakub Konka
c413ac100f codegen: refactor generating Int as immediate where appropriate 2023-03-03 18:40:16 +01:00
Jakub Konka
1024332adc arm: use common implementation of genTypedValue helper 2023-03-03 18:24:58 +01:00
Jakub Konka
c746cbc686 codegen: move gen logic for typed values, consts and decl ref to common codegen 2023-03-03 18:06:25 +01:00
Eckhart Köppen
6be5946ed8 sema: Place functions on AVR in flash addrspace
- Use .flash as the default address space for functions on AVR
- Return .flash as the address space for function pointers on AVR
  without explicit address space
2023-03-03 15:20:31 +02:00
Frank Denis
fdee558e45 crypto.25519.field: de-inline _sq()
May fix #14764
2023-03-03 07:51:23 -05:00
Andrew Kelley
aaaaab9ec2 std.process.Child: remove pid and handle, add id
Previously, this API had pid, to be used on POSIX systems, and handle,
to be used on Windows.

This commit unifies the API, defining an Id type that is either the pid
or the HANDLE depending on the target OS.

This commit also prepares for the future by allowing one to import via
`std.process.Child` which is the fully qualified namespace that I intend
to migrate to in the future.
2023-03-03 07:49:05 -05:00
Andrew Kelley
bb5006d728 std: add fchmodat
Also add `std.fs.has_executable_bit` for doing conditional compilation.

This adds the linux syscalls for chmod and fchmodat, as well as the
extern libc function declarations.

Only `fchmodat` is added to `std.os`, and it is not yet added to std.fs.
2023-03-03 02:37:45 -05:00
Andrew Kelley
426c13dddf add doc comments to std.fs.File.default_mode 2023-03-03 01:00:44 -05:00
Frank Denis
4789cc0249
crypto.KeccakF: compute rotations at comptime, add a test with f=800 (#14760) 2023-03-02 19:14:41 +00:00
Frank Denis
28364166e8
crypto.hash.sha3: make permutation generic and public, add SHAKE (#14756)
Make the Keccak permutation public, as it's useful for more than
SHA-3 (kMAC, SHAKE, TurboSHAKE, TupleHash, etc).

Our Keccak implementation was accepting f as a comptime parameter,
but always used 64-bit words and 200 byte states, so it actually
didn't work with anything besides f=1600.

That has been fixed. The ability to use reduced-round versions
was also added in order to support M14 and K12.

The state was constantly converted back and forth between bytes
and words, even though only a part of the state is actually used
for absorbing and squeezing bytes. It was changed to something
similar to the other permutations we have, so we can avoid extra
copies, and eventually add vectorized implementations.

In addition, the SHAKE extendable output function (XOF) was
added (SHAKE128, SHAKE256). It is required by newer schemes,
such as the Kyber post-quantum key exchange mechanism, whose
implementation is currently blocked by SHAKE missing from our
standard library.

Breaking change: `Keccak_256` and `Keccak_512` were renamed to
`Keccak256` and `Keccak512` for consistency with all other
hash functions.
2023-03-02 06:13:40 +00:00
Andrew Kelley
db8217f9a0 packages: avoid creating multiple modules with same build.zig
When there is a diamond dependency, reuse a *Module instead of creating
a redundant one using the same build.zig file. Otherwise, the compile
error "file exists in multiple modules" would occur.
2023-03-01 20:01:23 -05:00
Andrew Kelley
874d3a17ae
Merge pull request #14744 from ziglang/std.io.poll
introduce std.io.poll
2023-03-01 18:08:43 -05:00
Auguste Rame
25b83188d0
Add --build-runner zig build option (#14742) 2023-03-01 13:20:01 -05:00
Jonathan Marler
f2b15420ad std.io.poll: remove done function 2023-03-01 12:21:53 -05:00
Jonathan Marler
138e8b162a std.child_process: use std.io.poll for collectOutput 2023-03-01 12:21:53 -05:00
Jonathan Marler
4f58a80735 std.io.zig: fmt 2023-03-01 12:21:53 -05:00
Binary Craft
a7a709aaa9 Fixes #13893 - some standard library networking tests are failing on Windows 2023-03-01 02:54:43 -05:00
John Schmidt
e41bc640c6 astgen: do not discard result location in for/while loops
If we use the discard result location any break with a value will be
ignored and not checked for usage.

Closes https://github.com/ziglang/zig/issues/14684.
2023-03-01 02:51:59 -05:00
Jonathan Marler
ef72cd6698 std.io.poll initial windows implementation 2023-02-28 15:00:51 -05:00
Andrew Kelley
98508a12cf
Merge pull request #14741 from jacobly0/lldb 2023-02-28 01:25:05 -05:00
Andrew Kelley
d8c3738e21 redo std.io.poll with only outputs 2023-02-27 22:39:47 -07:00
Andrew Kelley
814de45bd2 add std.io.poll and implement it for POSIX
I think having inputs is problematic here, it should only be for
outputs.
2023-02-27 22:06:18 -07:00
Andrew Kelley
5236842a9d std.heap.GeneralPurposeAllocator: add doc comment for deinit 2023-02-27 22:04:29 -07:00
Andrew Kelley
f33af7af40 delete a subtly incorrect Haiku collectOutput implementation
It's not OK to half-ass this function. Please implement it correctly, or
not at all.
2023-02-27 20:42:13 -07:00
Jacob Young
6bed45b873 codegen: fix test failures
Various backend were mismatching arg instructions and function args.
2023-02-27 16:30:15 -05:00
Jacob Young
57236961e6 tools: revert sharing of stage2 pretty printer info
Partial revert of 1e963053d0ff67361b587b046a917375e963d5e9. Now that
lldb has a new method for accessing this data that does not require
manual updating, there is no longer any reason to share this data.
2023-02-27 05:37:03 -05:00
Jacob Young
a3529c2dea tools: implement more lldb pretty printers 2023-02-27 05:37:03 -05:00
Jacob Young
9e51972701 llvm: fix untagged struct names in debug info for llvm (again)
At least lldb misbehaves with all these same-named unions, so just
generate a unique name.
2023-02-27 05:18:47 -05:00
Andrew Kelley
f6c9346773 std.Build.CompileStep.installConfigHeader: add missing step dependency 2023-02-25 23:22:17 -05:00
Andrew Kelley
ee6df50678 fix package hashes on Windows
closes #14602
2023-02-25 23:22:17 -05:00
Andrew Kelley
81a47dc874
Merge pull request #14725 from jacobly0/more-ctype
CBE: more `CType` improvements
2023-02-25 15:53:28 -05:00
Jacob Young
477be90c0c CBE: replace locals list with a hash map
Replace `ArrayList` with `ArrayHashMap` since we want to be able to
remove by element.
2023-02-25 00:27:07 -05:00
Andrew Kelley
26196be344 rename std.Build.InstallRawStep to ObjCopyStep
And make it not do any installation, only objcopying. We already have
install steps for doing installation.

This commit also makes ObjCopyStep properly integrate with caching.
2023-02-24 23:48:03 -05:00
Jacob Young
1453a595aa CBE: reuse locals with the same CType instead of Type
Many `Type`s can correspond to the same `CType`, so this reduces the
number of used locals by 27760 when compiling only-c.

Also, disabled some tests that were only passing by accident and
shouldn't really be considered working.
2023-02-24 23:41:54 -05:00
Andrew Kelley
6398aabb87
Merge pull request #14713 from jacobly0/cbe-behavior
CBE: fix more behavior tests
2023-02-24 21:23:54 -05:00
Frank Denis
c7f479c3cb
crypto/benchmark.zig: fix pointer capture of non pointer type (#14722) 2023-02-24 19:45:24 +00:00