Commit Graph

30253 Commits

Author SHA1 Message Date
Alex Rønne Petersen
714e743393
start: Align the stack on aarch64 just in case.
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-24 21:56:52 +02:00
Alex Rønne Petersen
38c492bb53
std.os.linux.start_pie: Add hexagon support. 2024-07-24 20:12:38 +02:00
Alex Rønne Petersen
a0b2b987c8
std.os.linux.start_pie: Add arc support. 2024-07-24 20:12:38 +02:00
Alex Rønne Petersen
bc054a713e
std.os.linux.start_pie: Add csky support. 2024-07-24 20:12:38 +02:00
Alex Rønne Petersen
2dabb7ec77
std.os.linux.start_pie: Handle armeb, thumb, thumbeb, and aarch64_be too. 2024-07-24 20:12:38 +02:00
Alex Rønne Petersen
9771390f89
start: Simplify the sparc64 inline asm a bit. 2024-07-24 20:12:14 +02:00
Alex Rønne Petersen
58e38ff1f8
start: Add a comment explaining the sparc64 stack bias. 2024-07-24 20:12:14 +02:00
Alex Rønne Petersen
5c96192c19
start: Add a comment explaining our paranoid stance on ABI guarantees. 2024-07-24 20:12:14 +02:00
Andrew Kelley
4de8bba648
Merge pull request #20749 from alexrp/start-pie
`std.os.linux.start_pie`: Implement `getDynamicSymbol()` for loongarch64, m68k, and s390x
2024-07-24 10:27:20 -07:00
Alex Rønne Petersen
557c4f04c2 start: Handle loongarch32 together with loongarch64.
Nothing bitness-specific about this startup code.
2024-07-24 10:25:51 -07:00
Andrew Kelley
75cf7fca90
Merge pull request #20767 from ziglang/emit-options
add "trace pc guard" as optional additional coverage instrumentation
2024-07-24 07:36:21 -07:00
Lucas Santos
1e74904aa2 Replace some dynamic functions with static ones.
PR [19271](https://github.com/ziglang/zig/pull/19271) added some static function implementations from kernel32, but some parts of the library still used the dynamically loaded versions.
2024-07-24 01:04:38 -07:00
Andrew Kelley
fa95c89a71
Merge pull request #20758 from pavelverigo/stage2-wasm-compiler-rt-test-pass
stage2-wasm: pass compiler_rt test suite
2024-07-23 20:42:25 -07:00
Andrew Kelley
399f4fe7d6
Merge pull request #20719 from alexrp/misc-porting
`std.os.linux`: A handful of random porting fixes, mostly for `armeb` and `thumbeb`
2024-07-23 20:04:26 -07:00
Andrew Kelley
26d2a7960e default "trace pc guard" coverage off
* Add -f(no-)sanitize-coverage-trace-pc-guard CLI flag which defaults to
  off. This value lowers to TracePCGuard = true (LLVM backend) and -Xclang
  -fsanitize-coverage-trace-pc-guard. These settings are not
  automatically included with -ffuzz.
* Add `Build.Step.Compile` flag for sanitize_coverage_trace_pc_guard
  with appropriate documentation.
* Add `zig cc` integration for the respective flags.
* Avoid crashing in ELF linker code when -ffuzz -femit-llvm-ir used
  together.
2024-07-23 17:30:53 -07:00
Andrew Kelley
33d4742456 LLVM: more fine-grained sancov emit options
Exposes sanitizer coverage flags to the target machine emit function.
Makes it easier to change sancov options without rebuilding the C++
files.

This also enables PCTable = true for sancov which is needed by AFL, and
adds the corresponding Clang flag.
2024-07-23 16:04:58 -07:00
Alex Rønne Petersen
1c6bee0834
std.os.linux.start_pie: Add s390x support. 2024-07-24 00:28:08 +02:00
Alex Rønne Petersen
6fac71ec74
std.os.linux.start_pie: Add m68k support. 2024-07-24 00:28:07 +02:00
Alex Rønne Petersen
1fd45766a7
std.os.linux.start_pie: Add loongarch support. 2024-07-24 00:27:46 +02:00
Jakub Konka
7aaebd1774
Merge pull request #20751 from Rexicon226/riscv-eflags
elf: add riscv eflag collisions
2024-07-23 22:29:57 +02:00
Frank Denis
2e8acdf6fa
Fix compilation issues in crypto.bccrypt and poly1305 (#20756) 2024-07-23 19:45:24 +00:00
Alex Rønne Petersen
be1e1fa180 std.Build.Step.Run: Fix invocation syntax for Wasmtime 14+.
https://github.com/bytecodealliance/wasmtime/issues/7384
2024-07-23 12:39:40 -07:00
Alex Rønne Petersen
2d4fc1bb7a
std.os.linux.tls: Fix setThreadPointer() for armeb and thumbeb. 2024-07-23 21:17:29 +02:00
Pavel Verigo
ba8522e6c7 stage2-wasm: fix bigint div and trunc 2024-07-23 21:17:04 +02:00
Alex Rønne Petersen
0473457b68
std.os.linux.tls: Set some constants correctly for powerpcle. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
c631110f5c
std.os.linux.tls: Set tls_tcb_size correctly for thumbeb. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
d694ddd279
std.os.linux.tls: Set tls_variant correctly for thumbeb. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
d2d325a862
std.os.linux.AUDIT: Fix s390x; add loongarch64 and xtensa. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
93311d6bca
std.os.linux: Also define O for armeb and thumbeb. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
92bc802033
std.os.linux: Also define MAP for armeb and thumbeb. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
fcbb192b49
std.os.linux: Define (MIN)SIGSTKSZ for all supported Linux architectures. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
b21de4de5e
std.os.linux: Define syscalls for armeb and thumbeb too. 2024-07-23 21:14:19 +02:00
Alex Rønne Petersen
b3e82b899f
std.os.linux: Import arch bits for armeb and thumbeb too. 2024-07-23 21:14:19 +02:00
Andrew Kelley
718f8d5314
Merge pull request #20706 from alexrp/sigaction-nosys
`std.posix`: Make `sigaction()` infallible
2024-07-23 11:49:43 -07:00
Pat Tullmann
e8503ecb65 Default std.posix.system.ucontext_t is void
PR https://github.com/ziglang/zig/pull/20679 ("std.c reorganization")
switched feature-detection code to use "T != void" checks in place of
"@hasDecl".  However, the std.posix.system struct is empty, so
compile-time feature detection against symbols in there (specifically
`std.posix.system.ucontext_t` in this case), fail at compile time on
freestanding targets.

This PR adds a void ucontext_t into the std.posix.system default.

This PR also adds pseudo-"freestanding" variation of the StackIterator
"unwind" test.  It is sort of hacky (its freestanding, but assumes it can
invoke a Linux exit syscall), but it does detect this problem.

Fixes #20710
2024-07-23 11:47:29 -07:00
Andrew Kelley
33c7984183 add std.testing.random_seed
closes #17609
2024-07-23 11:43:12 -07:00
Andrew Kelley
6f3e9939d0
Merge pull request #20725 from ziglang/fuzz
initial support for integrated fuzzing
2024-07-23 11:39:19 -07:00
Jakub Konka
255547d7a6
Merge pull request #20731 from ziglang/parallel-macho-2
The tale of parallel MachO: part 2
2024-07-23 19:14:38 +02:00
Ryan Liptak
ac2459327f autodoc: Preserve whitespace in inline code spans
Fixes #20754
2024-07-23 10:02:54 -07:00
Pavel Verigo
8fd1f01f2a compiler_rt: disable test for stage2_wasm 2024-07-23 17:10:36 +02:00
Pavel Verigo
d71312d104 stage2-wasm: mul_sat 32 bits <=, i64, i128 2024-07-23 17:06:18 +02:00
Jakub Konka
f1af53f68e macho: use pread syscall when loading tapi file
This avoids mixing preads with reads which do not mix well especially
on Windows.
2024-07-23 10:33:02 +02:00
Andrew Kelley
8a8a7ba35b
Merge pull request #20733 from alexrp/start-porting
`start`: Add startup code for loongarch64, m68k, and s390x
2024-07-22 18:25:24 -07:00
Veikka Tuominen
05a8c4796f
Merge pull request #18962 from fifty-six/master
std.builtin.panic(uefi): usability improvements
2024-07-23 04:06:30 +03:00
David Rubin
782a9d16c7
elf: add riscv eflag collisions 2024-07-22 18:01:26 -07:00
Frank Denis
d2c9a51d1e
Fix function definition: ChaCha20With64BitNonce counter is u64 (#20734)
Fixes #20732
2024-07-22 23:04:32 +00:00
Andrew Kelley
61ad1be6bd fix macho linker integration with libfuzzer 2024-07-22 14:26:17 -07:00
Andrew Kelley
1cb994899d Compilation: fix regression in addCCArgs
`-fno-sanitize=function` must come after `-fsanitize=undefined` or it
has no effect.
2024-07-22 14:26:17 -07:00
Andrew Kelley
ae09f9bbce std.mem: delete workaround now that zig1.wasm is updated 2024-07-22 14:26:17 -07:00
Andrew Kelley
af7b6713d9 update zig1.wasm 2024-07-22 14:26:17 -07:00