Commit Graph

28211 Commits

Author SHA1 Message Date
Jakub Konka
2ad2e2f6f5 link+riscv: use riscv64/bits.zig to implement write helpers 2024-02-21 23:34:05 +01:00
Jakub Konka
ddb33baa11 test/link/elf: test static linking C riscv64-musl 2024-02-21 23:08:29 +01:00
Jakub Konka
720dd80007 elf+riscv: implement enough to get basic hello world in C working 2024-02-21 23:04:43 +01:00
Jakub Konka
ca6f41ee30 elf+riscv: skip parsing .riscv.attributes section for now 2024-02-21 22:50:55 +01:00
Jakub Konka
d19001abac elf: skip STT_NOTYPE only if SHN_UNDEF from symtab inclusion 2024-02-21 22:49:58 +01:00
Jakub Konka
9fd112804f link: commit missing files 2024-02-21 22:48:19 +01:00
Jakub Konka
8ba31ed39a elf: sort input relocs if targeting riscv64 2024-02-21 22:47:52 +01:00
Jakub Konka
55dadc3d85 test/link/elf: test static linking C aarch64-musl 2024-02-21 22:40:03 +01:00
Jakub Konka
7fd4576596 elf+aarch64: resolve .eh_frame relocs 2024-02-21 22:28:02 +01:00
Jakub Konka
7aeba3a3d1 elf+aarch64: implement some resolveRelocNonAlloc logic 2024-02-21 22:25:25 +01:00
Jakub Konka
887709ed5c elf+aarch64: implement some resolveRelocAlloc logic 2024-02-21 22:22:40 +01:00
Jakub Konka
d7d47a2c0c elf+aarch64: implement some scanReloc logic 2024-02-21 22:07:51 +01:00
Jakub Konka
ee364d542a link: introduce common set of aarch64 abstractions 2024-02-21 22:00:28 +01:00
Jakub Konka
60a8f9b989 elf: make GOT arch aware when resolving relocs 2024-02-21 20:58:43 +01:00
Jakub Konka
775a161794 elf: simplify logic for resolving .eh_frame relocs on different arches 2024-02-21 20:50:29 +01:00
Jakub Konka
06c191a4ff elf: simplify logic for resolving nonalloc relocs on different arches 2024-02-21 20:29:56 +01:00
Jakub Konka
4cde47a169 elf: simplify logic for resolving alloc relocs on different arches 2024-02-21 20:11:32 +01:00
Jakub Konka
60bc2e7616 elf: simplify logic for handling scanning relocs on different arches 2024-02-21 19:06:10 +01:00
Jakub Konka
1ca004176f elf+riscv: resolve synthetic __global_pointer$ symbol 2024-02-21 18:09:23 +01:00
garrison hinson-hasty
955fd65cb1
Sema: fix peer type resolution for arrays of coercible elements 2024-02-21 00:55:29 +00:00
Jacob Young
ec7293422d llvm: fix c abi for structs not passed in registers
Closes #18916
2024-02-20 23:36:47 +01:00
Jacob Young
2291560424 c_import: extract behavior tests that use @cImport
This introduces the new test step `test-c-import`, and removes the
ability of the behavior tests to `@cImport` paths relative to `test`.
This allows the behavior tests to be run without translate c.
2024-02-20 18:44:43 +01:00
Techatrix
556db2ca36
json: make std.json.stringifyAlloc return a mutable slice (#19013) 2024-02-20 09:03:00 -05:00
mlugg
65a87ff299 Liveness: do not elide safety-checked instructions
Resolves: #19012
2024-02-20 12:10:29 +00:00
Jacob Young
97290e0bfc cbe: make more use of InternPool.Index.Slice
Attempts to fix the current CI failures introduced by #18983.
2024-02-19 19:32:06 -08:00
mlugg
7461309b73 Sema: validate that runtime-known inferred alloc does not have comptime-only type
Resolves: #18997
2024-02-19 21:48:50 +00:00
Ian Johnson
80f3ef6e14 Package.Fetch: fix Git package fetching
This commit works around #18967 by adding an `AccumulatingReader`, which
accumulates data read from the underlying packfile, and by keeping track
of the position in the packfile and hash/checksum information separately
rather than using reader composition. That is, the packfile position and
hashes/checksums are updated with the accumulated read history data only
after we can determine what data has actually been used by the
decompressor rather than merely being buffered.

The only addition to the standard library APIs to support this change is
the `unreadBytes` function in `std.compress.flate.Inflate`, which allows
the user to determine how many bytes have been read only for buffering
and not used as part of compressed data.

These changes can be reverted if #18967 is resolved with a decompressor
that reads precisely only the number of bytes needed for decompression.
2024-02-19 13:43:32 -08:00
Tristan Ross
5c25ad0fda std.zig.system.linux: detect risc-v 2024-02-19 10:12:17 +02:00
Andrew Kelley
7775e46e81
Merge pull request #18983 from jacobly0/dwarf-rewrite
dwarf: optimize dwarf parsing for speed
2024-02-18 12:41:37 -08:00
Jacob Young
247e4ac3cc dwarf: optimize dwarf parsing for speed
This code is run when printing a stack trace in a debug executable, so
it has to be fast even without compiler optimizations.

Adding a `@panic` to the top of `main` and running an x86_64 backend
compiled compiler goes from `1m32.773s` to `0m3.232s`.
2024-02-18 14:11:06 +01:00
Jacob Young
57b2b3df52 Dwarf: use a user tag for padding 2024-02-18 14:11:03 +01:00
Carl Åstholm
3cafb9655a zig fmt: Preserve trailing comma after single-item switch case 2024-02-18 12:36:04 +02:00
Alex Kladov
ab6317d32b std: fix copy-paste typo in spawnWindows 2024-02-17 21:49:00 -08:00
Jakub Konka
f3bd177723
Merge pull request #18976 from ziglang/elf-misc-fixes
elf: misc fixes
2024-02-18 00:43:33 +01:00
Igor Anić
3e8cb153ea fix flate regression
Until now literal and distance code lengths where treated as two
different arrays. But according to rfc they can overlap:

  The code length repeat codes can cross from HLIT + 257 to the
  HDIST + 1 code lengths.  In other words, all code lengths form
  a single sequence of HLIT + HDIST + 258 values.

Now code lengths are decoded in single array which is then split
to literal and distance part.
2024-02-17 15:31:13 -08:00
Jakub Konka
99584906bb elf: fix typo in resolving @"32" and @"32S" relocs on x86_64 2024-02-17 19:39:11 +01:00
Jakub Konka
57e71ce189 elf: @"64" is equivalent to GLOB_DAT on riscv 2024-02-17 19:39:11 +01:00
Jakub Konka
79e99c401c
Merge pull request #18973 from ziglang/elf-riscv
lib/std/elf: refactor relocation types + add RISCV relocs
2024-02-17 19:35:09 +01:00
Robin Voetter
dd4d320eb9
Merge pull request #18948 from alichraghi/vector
spirv: use extended instructions whenever possible
2024-02-17 14:01:07 +01:00
Jakub Konka
d1429a8fa9 lib/std/elf: refactor reloc enum values 2024-02-17 13:13:03 +01:00
Jakub Konka
509c7149b9 elf: fix formatting of relocs when reloc can be Zig specific 2024-02-17 12:35:16 +01:00
Jakub Konka
5fb54736df lib/std/elf: fix typo in R_RISCV_TLSDESC 2024-02-17 12:06:33 +01:00
Jakub Konka
9542ee9bf8 elf: create Zig specific reloc type shared across ISAs 2024-02-17 11:46:01 +01:00
Jakub Konka
ace1a69a55 elf: add new R_RISCV_TLSDESC reloc type 2024-02-17 11:41:18 +01:00
Jakub Konka
975862aca9 elf: add riscv dynamic relocs 2024-02-17 11:29:06 +01:00
Michael Dusan
50330ec22a cbe: do not set execute bits on emitted file 2024-02-17 10:50:46 +01:00
Jakub Konka
601aa10b82 elf: add riscv64 dynamic relocs mapping 2024-02-17 09:04:06 +01:00
Jakub Konka
5122a3d2d9 lib/std/elf: use enums for relocs 2024-02-17 08:50:53 +01:00
Jakub Konka
70a5dca13e elf: add riscv reloc types 2024-02-17 08:45:42 +01:00
Jakub Konka
fc7dd3e285 elf: enable adding support for additional cpu archs 2024-02-16 21:54:43 +01:00