31366 Commits

Author SHA1 Message Date
Robin Voetter
86b88ea7da
spirv: skip range switch tests
This is not yet implemented
2024-10-13 01:58:11 +02:00
Robin Voetter
c1132edd53
spirv: don't generate OpUnreachable after noreturn call
It seems that these are now automatically added to AIR in Sema.
2024-10-13 01:57:35 +02:00
Robin Voetter
973f846251
spirv: implement repeat and dbg_arg_inline 2024-10-13 01:57:06 +02:00
Robin Voetter
3cd19b8884
spirv: don't try to lower types which have no runtime bits 2024-10-13 01:56:33 +02:00
Jakub Konka
7e530c13b3 macho: create dummy atom of size 0 marking end of a section
Some compilers such as Go reference the end of a section (addr + size)
which cannot be contained in any non-zero atom (since then this atom
would exceed section boundaries). In order to facilitate this behaviour,
we create a dummy zero-sized atom at section end (addr + size).
2024-10-12 02:53:15 -07:00
Krzysztof Wolicki
008acd0547
Replace tidy with superhtml as HTML validator (#21664)
Also add `$HOME/local/bin` to `PATH` in linux CI
2024-10-11 21:27:30 -07:00
poypoyan
0367f18cb9
std.mem.readVarInt: assert ReturnType is large enough (#20946)
Fixes #20521
2024-10-11 19:32:10 +00:00
Andrew Kelley
13fb68c064 link: consolidate diagnostics
By organizing linker diagnostics into this struct, it becomes possible
to share more code between linker backends, and more importantly it
becomes possible to pass only the Diag struct to some functions, rather
than passing the entire linker state object in. This makes data
dependencies more obvious, making it easier to rearrange code and to
multithread.

Also fix MachO code abusing an atomic variable. Not only was it using
the wrong atomic operation, it is unnecessary additional state since
the state is already being protected by a mutex.
2024-10-11 10:36:19 -07:00
Andrew Kelley
5e53203e82
Merge pull request #21666 from ziglang/reduce-flush
link.Elf: fix phdr_gnu_stack_index not included in sortPhdrs
2024-10-11 10:34:17 -07:00
Andrew Kelley
38458c6f70 work around C backend bug 2024-10-11 10:33:54 -07:00
Andrew Kelley
05157e820a link.Elf.sortShdrs: tease out data dependencies
In order to reduce the logic that happens in flush() we need to see
which data is being accessed by all this logic, so we can see which
operations depend on each other.
2024-10-11 10:33:54 -07:00
Andrew Kelley
7b69738a06 link.Elf: fix merge sections namespacing
`link.Elf.merge_section.MergeSection` -> `link.Elf.Merge.Section`
2024-10-11 10:33:54 -07:00
Andrew Kelley
2c4e05eda7 link.Elf: group section indexes
so they cannot be forgotten when updating them after sorting them.
2024-10-11 10:33:54 -07:00
Andrew Kelley
c3148988a3 link.Elf.ZigObject: make resetShdrIndexes non generic 2024-10-11 10:33:54 -07:00
Andrew Kelley
4669269673 link.Elf: fix phdr_gnu_stack_index not included in sortPhdrs
Adds type safety for program header indexes.

Reduce the amount of state sortPhdrs has access to, helping make the
data dependencies clear.
2024-10-11 10:33:54 -07:00
Andrew Kelley
ec67d6e03a std.MultiArrayList: add empty initalizer value 2024-10-11 10:33:54 -07:00
Jan200101
41dbd0d0da cmake: correct PIE support detection, add error output for debugging
`check_pie_supported` only uses the `OUTPUT_VARIABLE` to to signify errors
if PIE is actually supported is signaled by `CMAKE_<lang>_LINK_PIE_SUPPORTED`.

Checking if `OUTPUT_VARIABLE` is empty is not enough either since the check
is bypassed if its results are cached but the output variable is not cached.
2024-10-11 17:07:54 +02:00
Jean-Baptiste "Jiboo" Lepesme
901f344be2 IoUring: fix an issue in tests where InvalidVersion might get thrown by skipKernelLessThan, due to some kernel versions not being SemVer compliant. 2024-10-11 17:07:34 +02:00
YANG Xudong
a9a88aa428 add loongarch valist support 2024-10-11 02:49:00 -07:00
Andrew Kelley
1340565e22
Merge pull request #21654 from ziglang/embrace-path-abstraction
link: fix false positive crtbegin/crtend detection
2024-10-10 22:30:04 -07:00
Alex Rønne Petersen
92ae5818d2 musl: Align _init/_fini symbols correctly on arm.
See upstream patch: https://www.openwall.com/lists/musl/2024/10/10/4
2024-10-11 03:20:39 +02:00
Alex Rønne Petersen
2309d07e20 std.os.linux: Use the Thumb-specific syscall helpers for thumbeb too.
Fixes a "write to reserved register r7" compile error for thumbeb-linux-*.
2024-10-11 02:38:30 +02:00
Andrew Kelley
2857a3bcb6 link.Elf tests: update for new static lib behavior
the new code in this branch correctly only stores basenames in the
static archive; update the test to reflect that.
2024-10-10 14:21:52 -07:00
Andrew Kelley
9fa0a44de9 linker tests: avoid trivially unnecessary allocation 2024-10-10 14:21:52 -07:00
Andrew Kelley
4000685557 Compilation: don't write cache manifest on failure
When errors occurred during flush(), incremental cache mode was still
writing a successful cache manifest, making subsequent compilations fail
because they would get a cache hit only to find invalid data.
2024-10-10 14:21:52 -07:00
Andrew Kelley
01aab9f6b3 std.Build.Step.CheckObject: display source file path
and upgrade to getPath3
2024-10-10 14:21:52 -07:00
Andrew Kelley
101d21a6dc std.Build.Cache.Path: fix single-quote escaping format 2024-10-10 14:21:52 -07:00
Andrew Kelley
14c8e270bb link: fix false positive crtbegin/crtend detection
Embrace the Path abstraction, doing more operations based on directory
handles rather than absolute file paths. Most of the diff noise here
comes from this one.

Fix sorting of crtbegin/crtend atoms. Previously it would look at all
path components for those strings.

Make the C runtime path detection partially a pure function, and move
some logic to glibc.zig where it belongs.
2024-10-10 14:21:52 -07:00
Samuel Fiedler
58349b2c8e arch/aarch64/Mir: fix spelling (pseudo instead of psuedo) 2024-10-10 13:25:52 -07:00
Andrew Kelley
8d872b018d no code owners
If you want to review code then pay attention.
2024-10-10 11:35:49 -07:00
mlugg
c96f9a017a Sema: implement @splat for arrays
Resolves: #20433
2024-10-10 11:22:49 +01:00
Ian Johnson
072e062443 zig fetch: update saved dependency with resolved URL
Closes #21645
2024-10-09 23:55:38 -07:00
Andrew Kelley
2e2927735d
Merge pull request #21629 from ziglang/elf-incr
elf: more incremental progress
2024-10-09 17:43:17 -07:00
Andrew Kelley
5d7ed61103
Merge pull request #21644 from ziglang/macho-issue-21598
link.MachO: fix reporting undefined implicit symbols and fix a typo in InternalObject.addObjcMethnameSection method
2024-10-09 17:31:28 -07:00
Andrew Kelley
c86a334d43 link.Elf.Object.initAtoms: reduce state access and indirection
The initAtoms function now only uses the `elf_file` parameter for
reporting linker error messages, making it easier to see that the
function has no data dependencies other than the Object struct itself,
making it easier to parallelize or otherwise move that logic around.

Also removed an indirect call via `addExtra` since we already know the
atom's file is the current Object instance. All calls to `Atom.addExtra`
should be audited for similar reasons.

Also removed unjustified use of `inline fn`.
2024-10-09 15:40:59 -07:00
Andrew Kelley
10cb578e4e
Merge pull request #21640 from jacobly0/dwarf-progress
Dwarf: progress
2024-10-09 14:09:18 -07:00
Jakub Konka
33401ff3bb test/link/macho: test reporting undefined special symbols 2024-10-09 21:39:45 +02:00
Jakub Konka
d43b0cb31f macho: fix a typo in InternalObject.addObjcMethnameSection 2024-10-09 21:39:45 +02:00
Jakub Konka
90aa68cbfc macho: report special symbols if undefined
Special symbols include explictly force undefined symbols passed via -u
flag, missing entry point symbol, missing 'dyld_stub_binder' symbol, or
missing '_objc_msgsend' symbol.
2024-10-09 21:39:44 +02:00
Jakub Konka
73c3b9b8ab elf: revert growing atoms in Dwarf.resize for standard alloc 2024-10-09 12:38:53 -07:00
Jakub Konka
e9d819a29e elf: clean up how we create un-allocated sections 2024-10-09 12:38:53 -07:00
Jakub Konka
e448fb9601 elf: change how we manage debug atoms in Dwarf linker 2024-10-09 12:38:53 -07:00
Jakub Konka
c92c72d08c elf: do not create atoms for section symbols that do not require it 2024-10-09 12:38:53 -07:00
Jakub Konka
ef7bac4aa5 elf: move setting section size back to Elf.growSection 2024-10-09 12:38:53 -07:00
Jakub Konka
3d315f45d8 elf: drastically simplify extracting section size logic 2024-10-09 12:38:53 -07:00
Jakub Konka
0e5cd112ef elf: clear dynamic relocs before resolving relocs in atoms
When resolving and writing atoms to file, we may add dynamic relocs
to the output buffer so clear the buffers before that happens.
2024-10-09 12:38:53 -07:00
Jakub Konka
cf2e462d91 elf: add some extra logging for created dynamic relocs 2024-10-09 12:38:48 -07:00
Jakub Konka
133aa709b0 elf: do not panic if we already have create a PLT entry for a symbol 2024-10-09 12:38:11 -07:00
Jakub Konka
906cf48e14 elf: fix creation of synthetic sections 2024-10-09 12:38:11 -07:00
Jakub Konka
887f9a29f3 elf: combine growAllocSection and growNonAllocSection into growSection 2024-10-09 12:38:11 -07:00