20954 Commits

Author SHA1 Message Date
Cody Tapscott
bc33243650 stage2: Support modifiers in inline asm
These are supported using %[ident:mod] syntax. This allows requesting,
e.g., the "w" (32-bit) vs. "x" (64-bit) views of AArch64 registers.

See https://llvm.org/docs/LangRef.html#asm-template-argument-modifiers
2023-01-09 14:00:11 -07:00
Andrew Kelley
48798da29b Merge pull request #13074 from topolarity/stage2-opt
stage2: Miscellaneous fixes to vector arithmetic and copy elision
2023-01-09 13:59:04 -07:00
Jacob Young
b931889c65 Sema: avoid breaking hash contract when instantiating generic functions
* Add tagName to Value which behaves like @tagName.
 * Add hashUncoerced to Value as an alternative to hash when we want to
   produce the same hash for value that can coerce to each other.
 * Hash owner_decl instead of module_fn in Sema.instantiateGenericCall
   since Module.Decl.Index is not affected by ASLR like *Module.Fn was,
   and also because GenericCallAdapter.eql was already doing this.
 * Use Value.hashUncoerced in Sema.instantiateGenericCall because
   GenericCallAdapter.eql uses Value.eqlAdvanced to compare args, which
   ignores coersions.
 * Add revealed missing cases to Value.eqlAdvanced.

Without these changes, we were breaking the hash contract for
monomorphed_funcs, and were generating different hashes for values that
compared equal.  This resulted in a 0.2% chance when compiling
self-hosted of producing a different output, which depended on
fingerprint collisions of hashes that were affected by ASLR.  Normally,
the different hashes would have resulted in equal checks being skipped,
but in the case of a fingerprint collision, the truth would be revealed
and the compiler's behavior would diverge.
2023-01-09 13:58:52 -07:00
Jakub Konka
52f8de0194 Merge branch 'jcmoyer-lld-explicit-pdb' 2023-01-09 13:58:02 -07:00
Jakub Konka
84f5843178 Merge pull request #13495 from ziglang/macho-dsym
stage2: misc DWARF debug info fixes and additions for x86_64 and aarch64
2023-01-09 13:57:34 -07:00
Veikka Tuominen
95ecd521b8 Merge pull request #13418 from ryanschneider/signal-alignment-13216
std.os: fix alignment of Sigaction.handler_fn
2023-01-09 13:56:41 -07:00
IntegratedQuantum
11c1ddfc97 Handle sentinel slices in std.mem.zeroes
Fixes #13256
2023-01-09 13:56:20 -07:00
Veikka Tuominen
c1fc15f913 llvm: implement packed unions
Closes #13340
2023-01-09 13:56:14 -07:00
bfredl
a0dd11c479 Fixes to linux/bpf/btf.zig
- the meaning of packed structs changed in zig 0.10. adjust accordingly.
  Use "extern struct" for the cases that directly map to C structs.

- Add new type info kinds, like enum64 and DeclTag

- change the Type enum to use the canonical names from libbpf.
  This is more predictable when comparing with external BPF
  documentation (than invented synonyms that need to be guessed)
2023-01-09 13:55:53 -07:00
Jakub Konka
eb21b20949 Merge pull request #13487 from ziglang/zld-dwarf-string
macho: misc DWARF parser fixes
2023-01-09 13:55:25 -07:00
Andrew Kelley
4efb197f90 CI: stop using cloud.drone.io
This service stopped working two days ago for unknown reasons. Until it
is determined how to get it working again, or we switch to a different
CI provider for aarch64, this CI test coverage is disabled so that
we can continue to use the CI for other targets.
2023-01-09 13:55:16 -07:00
Ganesan Rajagopal
1be11e230a langref.html.in: Simplify printing types in examples
zig stdlib fmt has a formatter for types which prints the type name.  So,
just use @TypeOf(type) instead of the longer @typeInfo(@TypeOf(type)).
2023-01-09 13:53:37 -07:00
Veikka Tuominen
6ea3d3e19f Merge pull request #13446 from Vexu/stage2-fixes
Stage2 bug fixes
2023-01-09 13:52:37 -07:00
Frank Denis
6a94bcbbc6 crypto.core.aes: process 6 block in parallel instead of 8 on aarch64 (#13473)
* crypto.core.aes: process 6 block in parallel instead of 8 on aarch64

At least on Apple Silicon, this is slightly faster than 8 blocks.

* AES: add parallel blocks for tigerlake, rocketlake, alderlake, zen3
2023-01-09 13:52:02 -07:00
Frank Denis
30d392a87e crypto.salsa20: make the number of rounds a comptime parameter (#13442)
...instead of hard-coding it to 20.

- This is consistent with the ChaCha implementation
- NaCl and libsodium, that this API is designed to interop with,
also support 8 and 12 round variants. The 12 round variant, in
particular, provides the same security level as the 20 round variant,
but is obviously faster.
- scrypt currently uses its own non optimized version of Salsa, just
because it use 8 rounds instead of 20. This will help remove code
duplication.

No behavior nor public API changes. The Salsa20 and XSalsa20 still
represent the 20-round variant.
2023-01-09 13:51:56 -07:00
Jakub Konka
8d488246da Merge pull request #13463 from ziglang/fix-13056
macho: parse weak imports in tbd descriptors
2023-01-09 13:51:02 -07:00
r00ster91
5f74bec076 std.os.linux.T: translate more MIPS values
This fixes the broken terminal for me and thus fixes #13198.
2023-01-09 13:50:39 -07:00
Jakub Konka
2593d4d7d6 Merge pull request #13459 from ziglang/issue-13457
macho: do not zero-out file if there are no nonzerofill sects
2023-01-09 13:50:08 -07:00
delitako
3608b1d036 Improve doc comments for two functions (#13456)
* std.heap: fix function name in doc comment

* std.mem: document return value of `replace`
2023-01-09 13:49:43 -07:00
Andrew Kelley
faca0e4220 CI: add stage3/stage4 determinism check
Makes sure that #12183 will not regress.
2023-01-09 13:49:15 -07:00
Veikka Tuominen
b511231f95 Merge pull request #13338 from Vexu/stage2-compile-errors
Improve some error messages
2023-01-09 13:48:34 -07:00
Micah Switzer
8d95b713c5 Sema: resolve lazy align in zirReify for union fields
Closes #13435
2023-01-09 13:48:15 -07:00
Jacob Young
6165de9a61 Sema: make InferredErrorSet deterministic
Empirically, this `AutoHashMapUnmanaged` -> `AutoArrayHashMapUnmanaged`
change fixes all non-determinism in `ReleaseFast` build artifacts.

Closes #12183
2023-01-09 13:47:41 -07:00
Andrew Kelley
0848d33d78 Merge pull request #13430 from ziglang/stack-probe-msvc
Miscellaneous arm64 windows fixes
2023-01-09 13:47:09 -07:00
Yujiri
d8970de510 Add docstrings to some functions in std.meta 2023-01-09 13:46:58 -07:00
Frank Denis
72199c26b9 std.crypto.pwhash.bcrypt: inline the Feistel network function (#13416)
std/crypto/benchmark.zig results:

* Intel i5

before: 3.144 s/ops
 after: 1.922 s/ops

* Apple M1

before: 2.067 s/ops
 after: 1.373 s/ops
2023-01-09 13:46:46 -07:00
Nathan Bourgeois
ab4b538d91 Translate-C Remainder Macro Fix 2023-01-09 13:45:42 -07:00
Veikka Tuominen
a7b8d011a3 Merge pull request #13420 from jacobly0/c-backend
cbe: enough fixes to bootstrap a compiler with a working c backend
2023-01-09 13:45:06 -07:00
Frank Denis
ee8af8cffb std.crypto.ed25519 incremental signatures: hash the fallback noise (#13643)
If the noise parameter was null, we didn't use any noise at all.

We unconditionally generated random noise (`noise2`) but didn't use it.

Spotted by @cryptocode, thanks!
2022-12-22 23:06:28 +01:00
Cody Tapscott
3ee5cf627f stage2: Ensure f128 alignment matches c_longdouble alignment
On platforms where c_longdouble is 128-bits, interop with C code
is simplified by making f128 match the alignment of c_longdouble.

I intended to make this change as part of #13257, but I missed this
part.
2022-11-02 14:11:40 -07:00
Andrew Kelley
a0ac10d903 Merge pull request #13389 from jacobly0/fix-only-c
cbe: enough fixes for `-Donly-c` to be able to produce an executable
2022-11-02 14:11:31 -07:00
Andrew Kelley
5f11e341d8 Merge pull request #13396 from Luukdegram/fix-12880
llvm: mangle extern function names for Wasm target
2022-11-02 14:11:10 -07:00
Cody Tapscott
f354ad638a stage2 llvm: Respect alignment for .union_init
Resolves #13232.
2022-11-02 14:11:00 -07:00
Joachim Schmidt
99b1eaaac4 Merge pull request #13404 from joachimschmidt557/stage2-aarch64
stage2 aarch64: enable printing test results in the test runner
2022-11-02 14:10:52 -07:00
Jakub Konka
54bdc0108a cli: set sysroot when --sysroot option was passed
Fixes regression introduced in 0b47e69b7c
2022-11-02 14:10:16 -07:00
Andrew Kelley
57caec8585 Merge pull request #13368 from jacobly0/fix-aarch64-c 2022-11-02 14:09:45 -07:00
mnordine
5aa146c2d2 Fix variable name in documentation sample (#13391) 2022-11-02 14:09:30 -07:00
Frank Denis
5e4000ee69 ed25519: recommend using the seed to recover a key pair 2022-11-02 14:09:24 -07:00
Frank Denis
26e7d4c9a3 Ed25519.KeyPair.fromSecretKey() didn't compile after the API changes (#13386)
Fixes #13378
2022-11-02 14:09:18 -07:00
Andrew Kelley
f366f381f5 ci: add 0.10.0 release data 2022-11-02 14:08:18 -07:00
Andrew Kelley
455d583d30 stage2: fix compilation on 32-bit arm 2022-11-02 14:08:10 -07:00
Andrew Kelley
08b42705ab start the 0.10.x branch 2022-10-31 10:26:50 -07:00
Andrew Kelley
0c1701768d Release 0.10.0 0.10.0 2022-10-31 10:24:38 -07:00
Cody Tapscott
049e6025f2 stage2: Add explicit type qualifier to workaround #13366
Depending on how #13366 is resolved, this code should arguably have
been rejected with a compile error in the first place.
2022-10-31 13:13:11 -04:00
Cody Tapscott
6f2408aab8 link/MachO: Avoid depending on host PATH_MAX
Repeat of a4eb221b9 for the newly-synchronized zld code.

Restores ability to compile Zig for WASI.
2022-10-31 13:12:37 -04:00
Andrew Kelley
d02242661e std.heap: make wasm32 PageAllocator handle large allocation
When a number of bytes to be allocated is so great that alignForward()
is not possible, return `error.OutOfMemory`.

Companion commit to 3f3003097cbf5a6ad9e0dfc29b2cafbe2e35dded.
2022-10-30 19:28:26 -07:00
Andrew Kelley
ef761c2cbc
Merge pull request #13360 from topolarity/comptime-bool-binops
Make `x and false` and `x or true` comptime-known
2022-10-30 22:11:44 -04:00
Andrew Kelley
6d999abba0 mingw-w64: add gdiplus def files
closes #13192
2022-10-30 19:04:00 -07:00
Andrew Kelley
d4f668b241
Merge pull request #13361 from jacobly0/while-cont-scope
AstGen: avoid access to capture defined in an inner scope from a continue expression
2022-10-30 21:44:07 -04:00
Andrew Kelley
3e126102b7 compiler_rt: fix gnu_f16_abi for i386-windows
closes #13333
2022-10-30 18:42:59 -07:00