14181 Commits

Author SHA1 Message Date
LemonBoy
ec4e67fb0e std: Better formatting of tuple types
Skip the useless type name and the numeric field names.
2021-06-08 21:02:56 +03:00
Matthew Borkowski
9ac6d28614 stage1: make @truncate to an integer type of different sign an error at comptime too 2021-06-08 20:58:30 +03:00
Matthew Borkowski
ff0a15bb7a parse.zig: make parseParamDeclList check for nonfinal varargs 2021-06-08 20:50:55 +03:00
Matthew Borkowski
8bf04c3a69 parse.zig: simplify parseParamDeclList by always using scratch buffer 2021-06-08 20:50:55 +03:00
Matthew Borkowski
fc956fc110 stage1: fix render_const_value for printing const optional pointers 2021-06-08 20:41:09 +03:00
Dustin Taylor
c34e9c73ab
Limit Fixed Buffer Stream seekTo (#9023) 2021-06-08 20:34:57 +03:00
ArtixFox
032204ffe7
Changed return values of SectionHeaderIterator().next() to bswapAllFields() (#9014) 2021-06-08 20:32:12 +03:00
Andrew Kelley
38e233845e link: windows: look for more DLL import lib path names
When linking with -lfoo syntax, this indicates to Zig that the
dependency should either be provided by Zig, or it should be dynamically
provided by the system.

For windows-gnu targets, the search path was "foo.lib". Now it
additionally looks for "libfoo.dll.a".

Closes #7799
2021-06-08 01:31:10 -04:00
Rejean Loyer
c313e3f509 tools: fix update_clang_options.zig for ArrayHashMap's Separated Key/Value Storage breaking change. 2021-06-08 06:26:39 +02:00
Jakub Konka
b0ee911c23 wasi: always grant fd_readdir right
Since v0.23 release of Wasmtime, if we want to iterate a directory
Y then directory Y needed to have been granted `fd_readdir` right.
However, it is now also required for directory X to carry `fd_readdir`
right, and so on, up-chain all the way until we reach the preopen
(which possesses all rights by default).

This caused problems for us since our libstd implementation is more
fine-grained and allowed for parent dirs not to carry the right while
allow for iterating on its children. My proposal here is to always
grant `fd_readdir` right as part of
`std.fs.Dir.OpenDirOptions.access_sub_paths`. This seems to be the
approach taken by Rust also, plus we should be justified to take this
approach since WASI is experimental and snapshot1 will be discontinued
eventually and replaced with a new approach to access management
that will require a complete rewrite of our libstd anyhow.
2021-06-08 05:48:33 +02:00
Jens Goldberg
7462b0e5b9
Add Linux XDP bits (#9019) 2021-06-07 21:33:29 -04:00
Evan Haas
fa6546ba74 translate-c: properly handle enums used as boolean expressions 2021-06-07 15:51:42 +03:00
LemonBoy
fc8791c133 stage1: Allow array-like initialization for tuple types
This small change makes working with tuple types much easier, allowing
the use of anonymous (eg. obtained with meta.ArgsTuple) tuples in more
places without the need for specifying each (quoted!) field name in the
initializer.
2021-06-06 21:21:42 -04:00
Andrew Kelley
b87c3d5371
Merge pull request #9008 from LemonBoy/mem-align
Add helpers to align pointers
2021-06-06 21:06:04 -04:00
Andrew Kelley
b973e0a3e3 fix doc comments copy paste typo 2021-06-06 18:05:06 -07:00
LemonBoy
0c091f8b09 std: Add helpers to safely align pointers
Add two helpers to ensure people won't ignore some edge cases such as
pointers overflowing the address space.

Also fix #8924 to some degree, the amount of unchecked alignForward is
still scary.
2021-06-06 18:04:16 -07:00
LemonBoy
616c82e446 Revert "tests: disable i386-linux-gnu -lc target due to CI failures"
This reverts commit 97a2f4e7ae9c52c595841347bb0b26572b180dcf.
2021-06-06 18:04:16 -07:00
LemonBoy
e44b55b072 std: Fix some BPF fn definitions
Cros-checked with bpf.h of kernel 5.12.9.
2021-06-06 20:41:14 -04:00
LemonBoy
734a5cd6d1 build: Avoid using undefined variables
Closes #9013
Closes #8928
Closes #7991
2021-06-06 19:57:07 -04:00
LemonBoy
849b4e3495 stage1: Apply the same set of fn attributes everywhere
Make sure to propagate the target-specific attributes to internal
functions too.

Closes #8965
2021-06-06 18:24:25 -04:00
Frank Denis
ca6951ff79
std.crypto: timing-safe functions to add&subtract serialized integers (#8977)
This is useful to increment nonces and for scalar reduction.

It will avoid code duplication in crypto/25519 and crypto/pcurves/*
2021-06-06 16:37:58 +02:00
Sebastien Marie
fbd99319d1
openbsd: adjust dynamic linker path (#9010)
the dynamic linker on OpenBSD is at /usr/libexec/ld.so (and not /libexec/ld.so)
2021-06-06 16:35:15 +02:00
Evan Haas
6d52daba37 translate-c: Small cleanup, remove unneeded std.math.max call 2021-06-06 11:07:00 +03:00
Michael Dusan
0bda8435e0 test: re-enable dragonfly tests
Tests with LLVM assertions enabled are no longer failing.

closes #3563
2021-06-05 22:08:36 -04:00
Nicolas
aecf4571ba Add zig_llvm-ar.cpp in build.zig
This was added in 0afb5b2ec6de494efe0605b2270f6a01b95237af 8 days ago, but it seems it was only added in the cmake files and not build.zig
2021-06-05 20:37:20 -04:00
LemonBoy
1aeee80344
std: Better handing of POLLHUP in ChildProcess (#8988)
* std: Better handing of POLLHUP in ChildProcess

Upon hitting the EOF condition there are two main differences between
how Linux and the *BSD-derived systems behave: the former sets POLLHUP
and POLLIN and, after reading any residual data, only POLLHUP remains
set. The latter signal the EOF condition by setting both flags thus
requiring some extra checks to determine if the stream is "done".

DragonFly workaround/hack for POLLHUP is no longer required.

Closes #8969
2021-06-05 14:26:59 -04:00
LemonBoy
7babff0bc6 compiler-rt: Fix __floatunsitf signature
The function transforms an unsigned integer into a f128.

Closes #8996
2021-06-05 13:32:41 -04:00
Andrew Kelley
ddf9c40bc1 ci: fix 0.8.0 release date 2021-06-04 16:33:50 -07:00
Andrew Kelley
c7b68ce0f8 ci: fix aarch64-macos download tarball filename 2021-06-04 16:21:01 -07:00
Andrew Kelley
555805e0d5 ci: update download page releases 2021-06-04 15:33:18 -07:00
Andrew Kelley
b755c46d70 start the 0.9.0 release cycle 2021-06-04 11:29:01 -07:00
Andrew Kelley
a642552faf Release 0.8.0 0.8.0 2021-06-04 11:21:32 -07:00
Andrew Kelley
2699232c4e
Merge pull request #8990 from ziglang/mingw-w64-9.0.0
upgrade to mingw-w64 9.0.0
2021-06-04 14:17:40 -04:00
Felix (xq) Queißner
167754b31b Makes std.io.StreamSource usable with freestanding 2021-06-04 13:04:36 -04:00
Andrew Kelley
6f4339be3a update mingw-w64 crt files to v9.0.0 2021-06-04 09:49:36 -07:00
Andrew Kelley
d7f00c4389 update mingw-w64 headers to v9.0.0 2021-06-04 09:29:56 -07:00
Jacob G-W
5d94e754f4 fmt: fix #8974
also add a regression test
2021-06-04 10:49:05 +03:00
Min-Yih Hsu
83e0a49ba4
llvm: Add support for collecting time trace (#8546)
LLVM time profiler can collect time traces and present them in a
hierarchical view. Which breakdowns the time spent in each Pass or even
IR unit. The result is also exported into a format that can be easily
visualized by the Chrome browser.

Currently this features is controlled by the following environment
variables:
 - `ZIG_LLVM_TIME_TRACE_FILE` toggles this feature and specifies the
   output time trace file.
 - `ZIG_LLVM_TIME_TRACE_GRANULARITY` controls the time granularity in
   ms (default to 500).
2021-06-04 09:32:37 +02:00
Andrew Kelley
9c08a33b22
Merge pull request #8750 from lithdew/master
x/io, x/os: async i/o reactor, cross-platform socket syscalls and bits
2021-06-04 01:21:28 -04:00
Isaac Freund
05b677f0c4 langref: sync grammar with zig-spec repo 2021-06-04 01:18:45 -04:00
viri
ce072894a1 docs: minor spelling fix 2021-06-04 01:18:14 -04:00
Andrew Kelley
7d15a3ac71
Merge pull request #8975 from SpexGuy/hash-map-updates
Breaking hash map changes for 0.8.0
2021-06-04 01:12:38 -04:00
Martin Wickham
6953c8544b Fix return type of HashMap.getAdapted 2021-06-03 17:58:06 -05:00
Martin Wickham
fc9430f567 Breaking hash map changes for 0.8.0
- hash/eql functions moved into a Context object
- *Context functions pass an explicit context
- *Adapted functions pass specialized keys and contexts
- new getPtr() function returns a pointer to value
- remove functions renamed to fetchRemove
- new remove functions return bool
- removeAssertDiscard deleted, use assert(remove(...)) instead
- Keys and values are stored in separate arrays
- Entry is now {*K, *V}, the new KV is {K, V}
- BufSet/BufMap functions renamed to match other set/map types
- fixed iterating-while-modifying bug in src/link/C.zig
2021-06-03 17:02:16 -05:00
Andrew Kelley
87dae0ce98
Merge pull request #8932 from ziglang/llvm-needs-zlib
cmake: LLVM needs to link against zlib
2021-06-03 02:13:37 -04:00
Andrew Kelley
05cd8936c8 ci: drone: use zig-bootstrap tarball instead of system toolchain 2021-06-02 17:03:11 -07:00
Jakub Konka
d1f60a63bd zld: fix the linker for 32bit comp targets 2021-06-03 00:23:04 +02:00
Andrew Kelley
16c5cbab0c ci: update x86_64-freebsd tarball
to llvm 12.0.1-rc1, and -DLLVM_ENABLE_ZLIB=FORCE_ON
2021-06-01 23:26:53 -07:00
Evan Haas
a9dd8d7543 translate-c: Fix performance hazard in transPreprocessorEntities
Fixes O(N^2) behavior of `transPreprocessorEntities` due to repeated calls to
`mem.len`

Closes #8959
2021-06-02 09:12:45 +03:00
Veikka Tuominen
c6a0a4e728 translate-c: support designated initializers in macros 2021-06-01 23:40:43 -04:00