David Rubin
a1f6a8ef90
riscv: airAsm rewrite
...
with this rewrite we can call functions inside of
inline assembly, enabling us to use the default start.zig logic
all that's left is to implement lr/sc loops for atomically manipulating
1 and 2 byte values, after which we can use the segfault handler logic.
2024-07-26 04:19:55 -07:00
David Rubin
ba58b7b881
heap: create a work-around page-allocator
...
the risc-v backend doesn't have `@cmpxchg*` implemented and so it can't use the hint that the current page-allocator uses.
this work-around branch can be removed when I implement the atomic built-in.
2024-07-26 04:05:41 -07:00
David Rubin
c78ebeb44c
riscv: implement ptr_slice_ptr_ptr
...
just one step closer to allocation
2024-07-26 04:05:40 -07:00
David Rubin
8d30fc45c4
riscv: implement more operators
...
we can run `std.debug.print` now, with both run-time strings and integers!
2024-07-26 04:05:39 -07:00
Andrew Kelley
f2bf6c1b11
Merge pull request #20776 from alexrp/start-pie-more-arches
...
`std.os.linux.start_pie`: Add arc, csky, and hexagon support (and arm variants)
2024-07-25 19:33:54 -07:00
Alex Rønne Petersen
2458e53e73
std.zig.target: Handle m68k in muslArchName().
2024-07-25 19:31:39 -07:00
Andrew Kelley
a3c74aca99
add --debug-rt CLI arg to the compiler + bonus edits
...
The flag makes compiler_rt and libfuzzer be in debug mode.
Also:
* fuzzer: override debug logs and disable debug logs for frequently
called functions
* std.Build.Fuzz: fix bug of rerunning the old unit test binary
* report errors from rebuilding the unit tests better
* link.Elf: additionally add tsan lib and fuzzer lib to the hash
2024-07-25 18:52:21 -07:00
Andrew Kelley
b501adccbe
std.Build.Fuzz: fix progress node hierarchy
2024-07-25 18:52:21 -07:00
Andrew Kelley
bce3b1efb0
build runner sends a start_fuzzing message to test runner
2024-07-25 18:52:21 -07:00
Andrew Kelley
711ed56ce3
build runner: extract logic to std.Build.Fuzz
2024-07-25 18:52:21 -07:00
Andrew Kelley
047640383e
add --fuzz CLI argument to zig build
...
This flag makes the build runner rebuild unit tests after the pipeline
finishes, if it finds any unit tests.
I did not make this integrate with file system watching yet.
The test runner is updated to detect which tests are fuzz tests.
Run step is updated to track which test indexes are fuzz tests.
2024-07-25 18:52:20 -07:00
Andrew Kelley
6f3767862d
implement std.testing.fuzzInput
...
For now this returns a dummy fuzz input.
2024-07-25 18:52:20 -07:00
Andrew Kelley
5058beb179
implement std.testing.fuzzInput
...
for the -fno-fuzz case. The other case will take more work in libfuzzer.
2024-07-25 18:52:20 -07:00
Eugene-Dash
81a172a506
Add std.json.ParseOptions.parse_numbers to preserve float precision ( #20744 )
2024-07-25 20:55:06 -04:00
Andrew Kelley
ed847b85c2
Merge pull request #20777 from alexrp/start-abi-hardening
...
`start`: Harden against program interpreters that don't adhere fully to the ABI
2024-07-25 16:29:08 -07:00
Julian Vesper
3344ed8b8f
aarch64: reenable tests that are no longer regressed
...
Closes #12012
2024-07-25 20:23:23 +03:00
Andrew Kelley
94f4f9c4ef
add sub-compilation cache inputs to parents in whole mode
...
closes #20782
2024-07-24 19:40:54 -07:00
Alex Rønne Petersen
fff5ce053f
start: Align the stack on sparc64 just in case.
...
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-25 00:55:52 +02:00
Alex Rønne Petersen
ebefee6088
start: Fix mips stack alignment value (should be 8, not 16).
2024-07-25 00:55:36 +02:00
Alex Rønne Petersen
5478b0eb38
start: Simplify mips and mips64 startup code.
...
Switches from using r1 as a temporary to r2. That way, we don't have to set the
`noat` assembler option. (r1 is the scratch register used by the assembler's
pseudoinstructions; the assembler warns when code uses that register explicitly
without `noat` set.)
2024-07-25 00:55:00 +02:00
Alex Rønne Petersen
be56c67b14
std.coff: Add missing entries to MachineType.
...
Sources:
* https://learn.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants
* 88a28aa575/include/winnt.h (L2720-L2758)
2024-07-24 15:02:55 -07:00
Alex Rønne Petersen
47c0464e86
start: Explicitly clear the link register on mips and mips64 just in case.
...
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-24 21:56:54 +02:00
Alex Rønne Petersen
1b13d7477d
start: Properly escape percent signs in the s390x inline asm.
...
Silly mistake in 8ffc41f74705246e61f3c02c253d40b1464ea2bf.
2024-07-24 21:56:54 +02:00
Alex Rønne Petersen
ce81525f3f
start: Align the stack on s390x just in case.
...
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-24 21:56:54 +02:00
Alex Rønne Petersen
52653ec82b
start: Align the stack on powerpc just in case.
...
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-24 21:56:54 +02:00
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
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
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
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
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