Commit Graph

21940 Commits

Author SHA1 Message Date
Luuk de Gram
e4869eeac1
test/link: linker tests for all export cases
Adds a linker test case for each possible export case. This means
one where no exports are done (i.e. no flags set), when the -dynamic
flag is set, and finally when --export=<value> flag(s) are set.
2023-01-02 18:36:17 +01:00
Luuk de Gram
9932372fae
wasm-linker: support export flags
Adds support for both the `-rdynamic` and the `--export=<value>`
flags. Support is added to both the incremental linker as well as
the traditional linker (zld).
2023-01-02 18:36:14 +01:00
Ganesan Rajagopal
4172c29166
Fix typo (#14149) 2023-01-01 15:57:05 +00:00
Ryan Liptak
aadd1b252e ChildProcess: fix false positives in windowsCreateProcessSupportsExtension
Previously, the implementation would essentially check `startsWith` instead of `eql` (e.g. it would return true for `.exec` because it erroneously 'matched' `.exe`).

Follow up to #13993
2022-12-31 20:51:56 -05:00
Veikka Tuominen
58c1d98c14 add tests for fixed stage1 bugs
Closes #4144
Closes #4255
Closes #4372
Closes #4375
Closes #4380
Closes #4417
Closes #4423
Closes #4476
Closes #4528
Closes #4562
Closes #4572
Closes #4597
Closes #4639
Closes #4672
Closes #4782
Closes #4955
Closes #4984
Closes #4997
Closes #5010
Closes #5114
Closes #5166
Closes #5173
Closes #5276
2022-12-31 20:49:02 -05:00
Frank Denis
1c711b0a64
Happy new year! 🎉 (#14143) 2022-12-31 18:13:00 +00:00
Veikka Tuominen
af197d4954
Merge pull request #14130 from Vexu/debug-info
Debug info fixes
2022-12-31 11:47:56 +02:00
Frank Denis
d86685ac96
sha3: define block_length as the rate, not as the state size (#14132)
In sponge-based constructions, the block size is not the same as
the state size. For practical purposes, it's the same as the rate.

Size this is a constant for a given type, we don't need to keep
a copy of that value in the state itself. Just use the constant
directly. This saves some bytes and may even be slightly faster.

More importantly:
Fixes #14128
2022-12-30 22:15:25 +00:00
Manlio Perillo
e2d7b2bf33 ci: remove extra whitespace 2022-12-30 15:01:54 -05:00
Manlio Perillo
2419061246 x86_64: remove extra whitespace
Remove extra whitespace at the end of a line in Emit.zig, in regions
where zig fmt is off.
2022-12-30 15:01:19 -05:00
Veikka Tuominen
bd711dfd25 llvm: do not pad vector element debug types 2022-12-30 21:24:40 +02:00
Brendan Burns
c679fdee7f Fix bug in WASI envmap handling. 2022-12-30 17:23:31 +02:00
Manlio Perillo
f8f1c6ac06 parser: ensure the documented grammar matches grammar.y
Move the parsing of Root from the parse function to the Parser.parseRoot
method.

Add an empty line between each rule, for consistency with grammar.y.

Ensure that normal doc-comments are always on the top, for consistency.

Add extract-grammar.zig to the tools directory; it is used to extract
the PEG grammar from parse.zig, so that it can be compared with
grammar.y.
2022-12-30 17:11:59 +02:00
Veikka Tuominen
f874b5e1e0 llvm: work around lldb bugs
Closes #14122
2022-12-30 17:00:50 +02:00
Veikka Tuominen
67316e2eab AstGen: fix dbg_block_end being inserted before last instruction in block
Closes #14125
2022-12-30 17:00:50 +02:00
Veikka Tuominen
4e64373fc0 fix generic function arg debug info referencing wrong parameter
Closes #14123
2022-12-30 17:00:50 +02:00
Andrew Kelley
4b5fc5239c std.heap.raw_c_allocator: fix illegal alignment cast
See the comment added in this commit for more details.

closes #14090
2022-12-29 20:25:40 -07:00
Andrew Kelley
40ba4d4a89
Merge pull request #14102 from Luukdegram/wasm-undefined-symbols
WebAssembly: remove unconditional --allow-undefined flag
2022-12-29 17:59:44 -05:00
Frank Denis
0d83487dd0 hkdf: add prk_length and extractInit()
The HKDF extract function uses HMAC under the hood, but requiring
applications to directly use HMAC functions reduces clarity and
feels like the wrong abstraction.

So, in order to get the PRK length, add a `prk_length` constant
that applications can use directly.

Also add an `extractInit()` function for cases where the keying
material has to be provided as multiple chunks.
2022-12-29 17:56:50 -05:00
Andrew Kelley
9b665a59f2
Merge pull request #14101 from Vexu/stage1
add tests for fixed stage1 bugs
2022-12-29 15:33:45 -05:00
Jason Phan
94780f7cd1
std: Expose Int parameter in std.PackedInt[Array,Slice] 2022-12-29 19:11:05 +02:00
IntegratedQuantum
c557f0c32b Replace tabs with spaces when printing a line for trace output. 2022-12-29 12:50:31 +02:00
Veikka Tuominen
e0b6140009 Type: fix printing of default alignment on non-byte aligned pointers 2022-12-29 12:47:11 +02:00
Veikka Tuominen
8a6295fcba AstGen: make type sentinel expressions implicitly comptime 2022-12-29 12:43:02 +02:00
Veikka Tuominen
9a0c593a54 add tests for fixed stage1 bugs
Closes #1957
Closes #1994
Closes #2140
Closes #2746
Closes #2802
Closes #2855
Closes #2895
Closes #2981
Closes #3054
Closes #3158
Closes #3234
Closes #3259
Closes #3371
Closes #3376
Closes #3387
Closes #3529
Closes #3653
Closes #3750
Closes #3778
Closes #3882
Closes #3915
Closes #3929
Closes #3961
Closes #3988
Closes #4123
Closes #7448
2022-12-29 12:42:44 +02:00
joachimschmidt557
1caf56c5fb stage2 AArch64: implement errUnion{Err,Payload} for registers 2022-12-29 11:12:08 +01:00
Andrew Kelley
34887cf136 powerpc does not have a red zone
This will prevent unused argument warnings when compiling C objects
targeting powerpc.
2022-12-29 00:19:00 -05:00
Walther Chen
ff1eff9979
std: stop using LinearFifo in BufferedReader (#14029)
See also commit 7287c7482a where
LinearFifo is removed from BufferedWriter

Basically, LinearFifo does extra work via copying bytes and increasing
an offset.
2022-12-28 21:44:58 -05:00
Andrew Kelley
7350f0d9b5 mingw: add missing vscprintf.c file
closes #13733

Thanks to @kcbanner for finding this.
2022-12-28 12:33:55 -07:00
Jacob Young
74b14edea8 link: fix memory leaks
* Fix linker memory leaks found while running `zig build test-cases`.
 * Add missing target to test manifest.
2022-12-28 14:24:27 -05:00
Andrew Kelley
70ac9fc7af
Merge pull request #14092 from ziglang/ci-llvm-assert
CI: update x86_64 and aarch64 LLVM tarballs with assertions enabled
2022-12-28 14:08:32 -05:00
Andrew Kelley
0be6157a23 disable failing compile errors test
tracking issue #14105
2022-12-28 12:08:03 -07:00
Luuk de Gram
8403612adc
test/link: update linker tests
Force importing symbols to show the correct functions are being
imported from the host environment.
2022-12-28 16:49:36 +01:00
Jakub Konka
101c259da7
Merge pull request #14087 from jvolkman/issue-14046
Add support for -undefined error
2022-12-28 16:27:42 +01:00
Luuk de Gram
4bffe645c6
std: remove hack in test step
This hack was initially introduced as we would export all symbols
unconditionally, including non-function definitions. This would cause
an error from the Wasmtime runtime engine, which this flag would
suppress. As we now properly export symbols, this flag is no longer
needed and any user running into this error can manually include it.

This commit also adds the `--import-symbols` ability to build.zig
2022-12-28 15:57:19 +01:00
Luuk de Gram
30f2bb8464
compiler-rt: Set the symbol visibility
When we're compiling compiler_rt for any WebAssembly target, we do
not want to expose all the compiler-rt functions to the host runtime.
By setting the visibility of all exports to `hidden`, we allow the
linker to resolve the symbols during linktime, while not expose the
functions to the host runtime. This also means the linker can
properly garbage collect any compiler-rt function that does not get
resolved. The symbol visibility for all target remains the same as
before: `default`.
2022-12-28 14:57:17 +01:00
Luuk de Gram
4aab8118a7
WebAssembly: don't append --export for functions
No longer automatically append the `--export` flag for each exported
function unconditionally. This was essentially a hack to prevent
binary bloat caused by compiler-rt symbols being always included in
the final binary as they were exported and therefore not garbage-
collected. This is no longer needed as we now support the ability to
set the visibility of exports.
This essentially reverts 6d951aff7e
2022-12-28 14:41:27 +01:00
Andrew Kelley
e2e96eb13b CI: update x86_64 and aarch64 LLVM tarballs with assertions enabled 2022-12-27 23:13:34 -07:00
Andrew Kelley
a1d82352d2 disable failing C var arg behavior tests
See tracking issue #14096
2022-12-27 23:13:03 -07:00
Andrew Kelley
5ca1753ff1 Revert "aarch64: reenable tests that are no longer regressed"
This reverts commit 3370d58956.

This commit was done with an LLVM build that did not have assertions
enabled. There are LLVM assertions being triggered due to this commit.

Reopens #10627
Reopens #12013
Reopens #12027
2022-12-27 20:54:27 -07:00
Andrew Kelley
3f1cfcbea8
Merge pull request #14091 from ziglang/stage1-test-coverage
add more behavior test coverage
2022-12-27 21:47:17 -05:00
Andrew Kelley
b1207b3293 Revert "cmake: check llvm-config in separate function"
This reverts commit 55c3efcb58.

This caused a regression when building Zig with Homebrew.
Also I don't like that it prints a message on success. Only when there
is a problem should an error message be printed.

closes #14093
2022-12-27 19:21:33 -07:00
Andrew Kelley
357235d9de add behavior test for ptrcasted function pointers
See #2626. The runtime case is solved but comptime is not.
2022-12-27 15:19:00 -07:00
Andrew Kelley
6e9fbc83ca add behavior test for comptime pointer casting
comptime `@ptrCast` a subset of an array, then write through it

closes #2444
2022-12-27 14:44:04 -07:00
Andrew Kelley
f4b067743f add behavior test for optional error union return type
closes #1814
2022-12-27 13:46:57 -07:00
Jakub Konka
601ab9a251
Merge pull request #14086 from ziglang/issue-14082
macho: ensure LINKEDIT layout follows Apple strict validation rules
2022-12-27 21:39:05 +01:00
Andrew Kelley
19056cb682
Merge pull request #14024 from Vexu/overflow-arithmetic
Make overflow arithmetic builtins return tuples
2022-12-27 13:57:49 -05:00
Eric Joldasov
55c3efcb58 cmake: check llvm-config in separate function 2022-12-27 13:53:46 -05:00
Jeremy Volkman
50a8afd242 Handle -undefined error when passed as linker arg 2022-12-27 10:47:27 -08:00
Jakub Konka
aea3460cf5
Merge pull request #14084 from joachimschmidt557/stage2-aarch64
stage2 AArch64: small improvements
2022-12-27 18:59:59 +01:00