Andrew Kelley
b7a1ef3e19
Merge pull request #21075 from ziglang/fuzz
...
fix several debug info bugs
2024-08-14 04:55:32 -07:00
Jakub Konka
f26573fddf
elf: re-use old atom slot for a trampoline to that atom
...
This is the initial implementation of Jacob Young's idea of
re-using old function slots as trampolines for new function's
location. This way the trampoline is guaranteed to be aligned
to the function's alignment.
The only edge case is if an incremental update further overaligns
the function in which case we skip/delete the trampoline and
re-evaluate all references.
2024-08-14 12:10:40 +02:00
Alex Rønne Petersen
b470d2a7de
std.debug: Support sparc32 in StackIterator.init().
2024-08-13 23:54:20 -07:00
Alex Rønne Petersen
dc77d1b66d
std.Thread: Merge riscv32/riscv64 assembly in freeAndExit().
2024-08-13 23:53:57 -07:00
Alex Rønne Petersen
55cc9dda66
ci: Enable -Dtest-slow-targets.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
927bc55629
build/test: Add a test-modules step for running all the per-target tests.
...
This is useful during porting work where you're mainly concerned with tests that
e.g. run under QEMU. Combine with the new -Dtest-target-filter for an even more
streamlined workflow.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
b6009a7416
build/test: Add -Dtest-slow-targets and move mips module tests behind it.
...
The idea is that these tests are just too slow to include by default on a
contributor's local machine. If they want to run these, they need to opt in.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
3b51b43dc8
build/test: Add -Dtest-target-filter for filtering module tests by target triple.
...
This is useful during porting work where you're not interested in running all
targets all the time while iterating on changes.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
4a2b23c2be
build: Use the new b.addFail() for the update-mingw step.
...
This is precisely the kind of use case it was added for.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
019c0fc184
test: Re-enable mips(el)-linux-gnueabihf tests.
...
Closes #4927 .
2024-08-14 06:52:05 +02:00
Andrew Kelley
72768bddcd
std.Build.Fuzz.WebServer: sort pcs before source location lookup
...
Unfortunately, the PCs do not get sorted during linking.
2024-08-13 19:30:22 -07:00
Andrew Kelley
a726e09389
std.debug.Coverage.resolveAddressesDwarf: assert sorted
2024-08-13 19:29:55 -07:00
Robin Voetter
1018cdc0a8
Merge pull request #21030 from Snektron/nv-gpu-builtins
...
nvptx: add implementations for GPU builtins
2024-08-14 04:14:34 +02:00
Andrew Kelley
022bca9b06
std.debug.Dwarf: better source location information
...
Two fixes here:
Sort by addresses after generating the line table. Debug information in
the wild is not sorted and the rest of the implementation requires this
data to be sorted.
Handle DW.LNE.end_sequence correctly. When I originally wrote this code,
I misunderstood what this opcode was supposed to do. Now I understand
that it marks the *end* of an address range, meaning the current address
does *not* map to the current line information.
This fixes source location information for a big chunk of ReleaseSafe
code.
2024-08-13 18:04:23 -07:00
Andrew Kelley
a9e7fb0e01
avoid a branch in resolveAddressesDwarf
2024-08-13 15:02:53 -07:00
Andrew Kelley
e8e49efe21
ZigLLVMTargetMachineEmitToFile: put sanitizers in registerOptimizerLastEPCallback
...
matching the default of clang's behavior. I originally put them in
registerOptimizerEarlyEPCallback because I thought clang was doing that,
but I see now it is behind the flag `--sanitizer-early-opt-ep` which is
disabled by default.
2024-08-13 15:02:53 -07:00
Andrew Kelley
b5398180d6
std.debug.Coverage.resolveAddressesDwarf: fix broken logic
...
The implementation assumed that compilation units did not overlap, which
is not the case. The new implementation uses .debug_ranges to iterate
over the requested PCs.
This partially resolves #20990 . The dump-cov tool is fixed but the same
fix needs to be applied to `std.Build.Fuzz.WebServer` (sorting the PC
list before passing it to be resolved by debug info).
I am observing LLVM emit multiple 8-bit counters for the same PC
addresses when enabling `-fsanitize-coverage=inline-8bit-counters`. This
seems like a bug in LLVM. I can't fathom why that would be desireable.
2024-08-13 15:02:53 -07:00
Alex Rønne Petersen
819fe51a7e
llvm: Disable f128 on powerpc*-aix.
...
https://github.com/llvm/llvm-project/issues/101545
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
2f101e2b6e
llvm: Disable f128 on mips64(el).
...
https://github.com/llvm/llvm-project/issues/96432
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
18e94c355e
llvm: Also disable f16/f128 on aarch64_be with soft float.
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
f1af9eb836
std.zig.system: Support qemu-xtensa in getExternalExecutor().
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
8e75ade253
std.zig.system: Support qemu-mipsn32(el) for mips with n32 ABI in getExternalExecutor().
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
0e4263893c
std.zig.system: Support qemu-sparc32plus for sparc32 with v9 in getExternalExecutor().
2024-08-13 23:30:43 +02:00
Jakub Konka
1bd54a55fa
fix compile errors in other codegen backends
2024-08-13 21:52:40 +02:00
Andrew Kelley
0b5ea2b902
Merge pull request #21053 from alexrp/mips-tests
...
`test`: Re-enable `mips(el)-linux(-musl)` tests.
2024-08-13 11:48:33 -07:00
Robin Voetter
bcfc7cf13c
nvptx: add implementations for GPU builtins
2024-08-13 20:07:23 +02:00
YANG Xudong
76f062690c
add getcontext
2024-08-13 10:11:17 -07:00
Jakub Konka
97ab420dcf
elf: do not emit zig jump table in relocatables
2024-08-13 13:30:24 +02:00
Jakub Konka
49d78cc793
elf: only apply zig jump table indirection to function calls (PLT32)
2024-08-13 13:30:24 +02:00
Jakub Konka
9daf5e81c4
elf: commit non-indirected symbol address to symtab
2024-08-13 13:30:24 +02:00
Jakub Konka
df80ccf760
elf: pretty print alingment when pretty printing atoms
2024-08-13 13:30:24 +02:00
Jakub Konka
39ee346681
elf: make .text.zig bigger now that jump table is part of it
2024-08-13 13:30:24 +02:00
Jakub Konka
afaec5c3e4
x86_64: fix generating lazy symbol refs
2024-08-13 13:30:24 +02:00
Jakub Konka
edd72c75eb
elf: fix circular dep loop in zig jump table
2024-08-13 13:30:24 +02:00
Jakub Konka
57f7209508
elf: replace use of linker_extern_fn with more generic Immediate.reloc
2024-08-13 13:30:24 +02:00
Jakub Konka
ce8886d57d
elf: make zig jump table indirection implicit via Symbol.address
2024-08-13 13:30:24 +02:00
Jakub Konka
d25c93a868
x86_64: emit call rel32 for near calls with linker reloc
2024-08-13 13:30:24 +02:00
Jakub Konka
ffcf0478fe
x86_64: remove handling of .call since it's unused for now
2024-08-13 13:30:24 +02:00
Jakub Konka
78b1c73602
elf: rename OffsetTable to JumpTable
2024-08-13 13:30:24 +02:00
Jakub Konka
e1ce9a7065
elf: add poorman's reporting tool for unallocated NAVs/UAVs
2024-08-13 13:30:24 +02:00
Jakub Konka
e3f6ebaea9
x86_64+elf: fix jump table indirection for functions
2024-08-13 13:30:24 +02:00
Jakub Konka
16abf51cee
x86_64: handle lea_symbol returned by genNavRef
2024-08-13 13:30:24 +02:00
Jakub Konka
f968dd0cb1
comp: actually report codegen errors
2024-08-13 13:30:24 +02:00
Jakub Konka
5fd53dc36f
x86_64: start converting away from .got.zig knowledge
2024-08-13 13:30:24 +02:00
Jakub Konka
d7c5fbce92
elf: emit a jump table in place of offset table for functions
2024-08-13 13:30:24 +02:00
Jakub Konka
d328140858
elf: nuke ZigGotSection from existence
2024-08-13 13:30:24 +02:00
Jakub Konka
4c2b34e8ab
elf: relax R_X86_64_32 into jump table indirection if zig_offset_table set
2024-08-13 13:30:24 +02:00
Jakub Konka
7556b32840
elf: indirect via offset table in the linker away from backend
2024-08-13 13:30:24 +02:00
Jakub Konka
97a65ea0d5
elf: dirty offset table entry on moving Atom in off/addr space
2024-08-13 13:30:24 +02:00
Jakub Konka
24b915c9f2
elf: write offset table entry if dirty
2024-08-13 13:30:24 +02:00