Commit Graph

11375 Commits

Author SHA1 Message Date
Josh Holland
c25b157dda remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
Andrew Kelley
c9551652b0
Merge pull request #6978 from LemonBoy/statshit
Decouple kernel and libc stat definitions
2020-11-05 17:27:22 -05:00
Andrew Kelley
cf7505da1f
Merge pull request #6974 from daurnimator/prctl-cleanup
prctl improvements
2020-11-05 17:25:24 -05:00
LemonBoy
78840c4ab2 stage1: Make sure union(enum(T)) is valid
The T type should be wide enough to fit values in the  0...num field
range.

Closes #6988
2020-11-05 17:24:04 -05:00
Andrew Kelley
f85d719952
Merge pull request #6895 from jorangreef/fallocate
linux: add fallocate()
2020-11-05 17:23:00 -05:00
Frank Denis
e7b60b219b std/crypto: don't constrain Gimli hash output to a fixed length
As documented in the comment right above the finalization function,
Gimli can be used as a XOF, i.e. the output doesn't have a fixed
length.

So, allow it to be used that way, just like BLAKE3.
2020-11-05 17:21:19 -05:00
Frank Denis
2e354c387e math.shl/math.shr: add support for vectors 2020-11-05 17:20:54 -05:00
Frank Denis
73aef46f7d std.crypto: namespace constructions a bit more
With the simple rule that whenever we have or will have 2 similar
functions, they should be in their own namespace.

Some of these new namespaces currently contain a single function.

This is to prepare for reduced-round versions that are likely to
be added later.
2020-11-05 17:20:25 -05:00
Frank Denis
4417206230 Now that they support vectors, use math.rot{l,r} 2020-11-05 17:19:48 -05:00
Andrew Kelley
34502b9c4d
Merge pull request #6991 from alexnask/upgrade_mingw-w64
Upgrade mingw-w64 to version 8.0.0
2020-11-05 17:18:01 -05:00
Alexandros Naskos
3e1639c53b
Fixed mingw-w64 8.0.0 compilation
Reaplied mingw-w64 header patch
2020-11-05 20:04:25 +02:00
Alexandros Naskos
708962d51e
Updated mingw-w64 to version 8.0.0 2020-11-05 18:59:36 +02:00
LemonBoy
cca6b11138 Label WASI stat as kernel_stat
We're using WASI syscalls, it makes sense to put the kernel_ prefix.
2020-11-05 12:44:43 +01:00
LemonBoy
0e95fa455c std: Split kernel&libc definitions of stat struct
There's no guarantee for the kernel definition to be ABI compatible with
the libc one (and vice versa).
There's also no guarantee of ABI compatibility between musl/glibc.

Fun, isn't it?
2020-11-05 09:38:50 +01:00
Alexandros Naskos
17837affd2
Merge pull request #6982 from Rageoholic/master
Fix CoInitializeEx so it can take a null pointer
2020-11-05 09:00:03 +02:00
rageoholic
e5100605e9 Add missing LONG_PTR type 2020-11-04 18:30:48 -06:00
rageoholic
04267fb1ba Fix CoInitializeEx so it can take a null pointer 2020-11-04 16:53:05 -06:00
Frank Denis
bb14bd35bd Update wasmtime to version 0.20
The version we were using in CI is now getting quite old, and we
want to make sure that the code we produce is compatible with
current versions of Wasmtime.
2020-11-04 20:28:54 +01:00
LemonBoy
346a686b9d std: Correct stack_t definition for mips 2020-11-04 15:55:06 +01:00
LemonBoy
f313c88428 std: Fix pipe syscall stub for sparc64 2020-11-04 15:54:38 +01:00
daurnimator
b42ffbe9e8
std: use PR enum as only location of opcode numbers 2020-11-04 22:39:35 +11:00
daurnimator
b90fb1e96b
std: add PR enum for the prctl opcode 2020-11-04 22:32:57 +11:00
daurnimator
02252f3f07
std: workaround #280 in prctl 2020-11-04 22:23:59 +11:00
Frank Denis
342ba960f7 sparc64 has a 8Kb page size 2020-11-03 17:29:20 -05:00
Andrew Kelley
ede41759be std.fs.File.writeFileAll: support unseekable files
With this commit, the function tries to use more efficient syscalls, and
then falls back to non-positional reads.

The motivating use case for this change is to support something like the
following:

try io.getStdOut().writeFileAll(dest_file, .{});
2020-11-03 15:25:43 -07:00
Frank Denis
37bc6ee54a std.meta: test that const and mut variables have different addresses
We are checking that two identical, constant values, are stored at
different addresses.

But sharing a unique location doesn't look like something the compiler
wouldn't do.

It may make more sense to check that a const variable and a mutable
variable set to the same value have different addresses.
2020-11-03 16:52:51 -05:00
Andrew Kelley
f2cb63c2e1
Merge pull request #6956 from jedisct1/more-gimli-be-fixes
Another big-endian fix for Gimli
2020-11-03 11:22:54 -05:00
Jakub Konka
5060497174
Merge pull request #6921 from xackus/gimmeMoreOfThoseSweetSweetFileDescriptors
stage2: ask for more file descriptors
2020-11-03 10:07:39 +01:00
Frank Denis
8d7c160fb4 Make Gimli test vector look like the python implementation 2020-11-03 09:13:14 +01:00
Joran Dirk Greef
8193f55820 Support 32-bit big-endian targets 2020-11-03 06:03:38 +02:00
Frank Denis
d764636d21 Another big-endian fix for Gimli
We read and write bytes directly from the state, but in the init
function, we potentially endian-swap them.

Initialize bytes in native format since we will be reading them
in native format as well later.

Also use the public interface in the "permute" test rather than an
internal interface. The state itself is not meant to be accessed directly,
even in tests.
2020-11-03 02:01:48 +01:00
xackus
e023a5fe5d force comptime on isDarwin 2020-11-03 00:58:35 +01:00
Jakub Konka
8dda64fa3e
Fix Darwin codepath
On Darwin, according to the man pages for setrlimit(), when adjusting
max number of open fds, the reported hard max by getrlimit() is only
theoretical, while the actual maximum, set in the kernel, is hardcoded
in the header file. Therefore, the reported max has to be adjusted
as `min(OPEN_MAX, lim.max)`.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-03 00:38:43 +01:00
xackus
06b4526a3e fix freebsd compilation 2020-11-02 23:18:55 +01:00
Andrew Kelley
b30a765b95 fix cmake logic for checking LLVM version 2020-11-02 12:16:10 -07:00
LemonBoy
35a8d90e55 std: Make parseInt/parseUnsigned detect the radix 2020-11-02 14:13:06 -05:00
Andrew Kelley
00ceb592ef
Merge pull request #6932 from kubkon/fix-6318
macOS: fix linking issues on BigSur
2020-11-02 13:41:32 -05:00
LemonBoy
be26c3bf4e stage1: Fix *WithOverflow intrinsics with u0 values
Closes #5369
2020-11-02 13:40:00 -05:00
Frank Denis
ad9655db3a Fix Gimli for big-endian targets 2020-11-02 13:38:20 -05:00
Andrew Kelley
061ff11b2b
Merge pull request #6927 from LemonBoy/mipsbe-std
Fixes for stdlib for mips BE targets
2020-11-02 13:37:24 -05:00
Jakub Konka
6ecefd5903 Add std.Target.current.isDarwin() to exclude non-macs in comptime 2020-11-02 19:31:07 +01:00
Alex Cameron
ecdd636605 Fix file descriptor leak in fs.openFileZ. 2020-11-02 13:28:29 -05:00
Isaac Freund
50ba018223 std/ascii: add spaces array
This may be combined with std.mem.trim to form a proper replacement for
the now deprecated std.fmt.trimWhitespace().
2020-11-02 13:20:58 -05:00
Jakub Konka
f42ebd1b0a
Update src/Compilation.zig
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-11-02 18:56:08 +01:00
Jakub Konka
7f5c96378d Refactor the code according to Andrew's suggestions 2020-11-02 18:38:09 +01:00
Jakub Konka
317c555a5c Fix linking issues on BigSur
This commit fixes linking issue on macOS 11 BigSur by appending
a prefix path to all lib and framework search paths known as
`-syslibroot`.

The reason this is needed is that in macOS 11, the system libraries
and frameworks are no longer readily available in the filesystem.
Instead, the new macOS ships with a built-in dynamic linker cache
of all system-provided libraries, and hence, when linking with either
`lld.ld64` or `ld64`, it is required to pass in `-syslibroot [dir]`.
The latter can usually be obtained by invoking `xcrun --show-sdk-path`.
With this commit, Zig will do this automatically when compiling natively
on macOS. However, it also provides a flag `-syslibroot` which can be
used to overwrite the automtically populated value.

To summarise, with this change, the user of Zig is not required to
generate and append their own syslibroot path. Standard invocations
such as `zig build-exe hello.zig` or `zig build` for projects will
work out of the box. The only missing bit is `zig cc` and `zig c++`
since the addition of the `-syslibroot` option would be a mismatch
between the values provided by `clang` itself and Zig's wrapper.
2020-11-02 17:06:09 +01:00
LemonBoy
dc872a221d std: Fix syscall stubs passing 64bit offsets for BE targets 2020-11-02 12:11:07 +01:00
LemonBoy
76e9a4ae83 std: Fix std.unicode test cases for BE targets 2020-11-02 11:48:06 +01:00
LemonBoy
02efc2236a std: Fix json utf{8,16} decoding on BE targets
Byteswap some values when LE ordering is required.
2020-11-02 11:46:50 +01:00
LemonBoy
4fd1ec78e9 std: Re-enable union behaviour test for mips targets 2020-11-02 11:46:26 +01:00