Alex Rønne Petersen
d633b35f35
start: Always inline the call to std.os.linux.pie.relocate().
...
At this stage, we're not ready to make calls yet on some architectures (e.g. MIPS).
2024-07-29 10:08:34 +02:00
Alex Rønne Petersen
d6c637c36b
start: Set std.os.linux.elf_aux_maybe after PIE relocations.
...
Accesses to this global variable can require relocations on some platforms (e.g.
MIPS). If we do it before PIE relocations have been applied, we'll crash.
2024-07-29 10:05:28 +02:00
Alex Rønne Petersen
e33af8e902
start: Perform the posixCallMainAndExit() call with jalr on mips.
...
It's actually important for the ABI that r25 (t9) contains the address of the
called function, so that this standard prologue sequence works:
lui $2, %hi(_gp_disp)
addiu $2, $2, %lo(_gp_disp)
addu $gp, $2, $t9
(This is a bit similar to the ToC situation on powerpc that was fixed in
7bc78967b400322a0fc5651f37a1b0428c37fb9d.)
2024-07-29 10:05:25 +02:00
Alex Rønne Petersen
77fc3b88fb
start: Set up the gp register on mips and mips64.
2024-07-29 10:04:54 +02:00
Alex Rønne Petersen
66b71273a2
std.os.linux: Fix default value for perf_event_attr.clockid field.
...
Closes #20810 .
2024-07-26 18:21:10 -07:00
Andrew Kelley
eab934814f
docs: ArrayHashMap: warn against the shrink footgun
2024-07-26 15:24:25 -07:00
Karim Mk
3b3c9d2081
Fix typo in init files.
2024-07-26 14:33:59 -07:00
Andrew Kelley
5d3a1cfdf5
update init template
...
* add fuzz example
* explain that you might want to delete main.zig or root.zig
2024-07-26 12:18:23 -07:00
kcbanner
2a0238e5e3
zig.h: fixup pointer atomic load definitions
2024-07-26 10:42:10 -04:00
Jakub Konka
1240134c8b
Merge pull request #20788 from alexrp/elf-dt
...
`std.elf`: Add some definitions for the newer RELR relocations
2024-07-26 15:02:19 +02: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
688c2df646
fuzzer: use the cmp values
...
seems to provide better scoring
2024-07-25 18:52:21 -07:00
Andrew Kelley
6a63372053
fuzzer: basic implementation
...
just some experimentation. I didn't expect this to be effective so
quickly but it already can find a comparison made with mem.eql
2024-07-25 18:52:21 -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
90dfd86ebe
test runner: always report fuzz tests
...
This way they can be smoke tested.
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
7366b4b9e2
test runner: handle start_fuzzing message
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
Alex Rønne Petersen
d0557a699e
std.elf: Add Elf32_Relr and Elf64_Relr definitions.
2024-07-26 00:40:41 +02:00
Julian Vesper
3344ed8b8f
aarch64: reenable tests that are no longer regressed
...
Closes #12012
2024-07-25 20:23:23 +03:00
Alex Rønne Petersen
c009264f5b
std.elf: Add some newer dynamic tag types.
2024-07-25 18:55:08 +02: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 8ffc41f747
.
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
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