21925 Commits

Author SHA1 Message Date
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 7287c7482a2c694c7c7f56b9f7c1744a7ae7905f 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 6d951aff7e32b1b0252d341e66517a9a9ee98a2d
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 3370d58956ecc744a004dff47b0437473f0ef7da.

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 55c3efcb58cc153fc3109a61c6949e470b57b81e.

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
Jeremy Volkman
b0bfde917b Add support for -undefined error
`-undefined dynamic_lookup` was added in #13991. `-undefined error` is the
opposite, and can be used to revert an `-undefined dynamic_lookup` flag
specified previously on the command line.
2022-12-27 08:18:04 -08:00
Jakub Konka
c0c5acf074 macho+zld: fix 32bit build 2022-12-27 17:04:57 +01:00
Jakub Konka
8d29c84d00 link-tests: test uuid on x86_64-macos too 2022-12-27 16:43:35 +01:00
Jakub Konka
6925ef0f1a zld: exclude strtab padding from uuid calculation 2022-12-27 16:43:35 +01:00
Jakub Konka
8adcc2258f link-tests: redo macho strict validation test to match libstuff 2022-12-27 16:43:35 +01:00
Jakub Konka
2620146834 macho+zld: align to 8 and pad out strtab 2022-12-27 16:43:35 +01:00
Jakub Konka
d83d39297c macho+zld: align to 8 and pad out dysymtab 2022-12-27 16:43:35 +01:00
Jakub Konka
0409dda46b zld: align to 8 and pad out function starts and data in code sections 2022-12-27 16:43:35 +01:00
Jakub Konka
246e3e0c75 macho+zld: align to 8 and pad out dyld info sections 2022-12-27 16:43:35 +01:00
Jakub Konka
a70cbe779a macho: add Zig wrapper for compact unwind encoding on arm64 2022-12-27 15:36:28 +01:00
Veikka Tuominen
a777373bb8 enable test on more targets
This was fixed by 8a0a6b7387fcd0017db85de14793abfd6ec7f6e5 for targets
without avx512
2022-12-27 15:34:19 +02:00
Veikka Tuominen
9c0f3163a8 value: fix bitcasting packed structs with u0 fields
Closes #13942
2022-12-27 15:33:27 +02:00
joachimschmidt557
485082064a
stage2 AArch64: implement field_parent_ptr 2022-12-27 21:26:18 +08:00
joachimschmidt557
d6e6162081
stage2 AArch64: unify callee-preserved regs on all targets
also enables many passing behavior tests
2022-12-27 21:17:52 +08:00
Veikka Tuominen
b7730c7478 update zig1.wasm to overflow arithmetic builtin changes 2022-12-27 15:13:14 +02:00