Jakub Konka
2c0c86944e
test/link/macho: upgrade and migrate headerpad test
2024-01-24 12:34:40 +01:00
Jakub Konka
9533628ca0
test/link/macho: test setting correct weak* flags in the header
2024-01-24 12:34:40 +01:00
Jakub Konka
5142d92c51
test/link/macho: test hello world in C
2024-01-24 12:34:39 +01:00
Jakub Konka
0cc4dc615b
test/link/macho: test hello world in Zig
2024-01-24 12:34:39 +01:00
Jakub Konka
bf285c7e40
test/link/macho: test for correct handling of large __bss sections
2024-01-24 12:34:39 +01:00
Jakub Konka
faa1849f81
test/link/macho: test for correct handling of __mh_execute_header symbol
2024-01-24 12:34:39 +01:00
Jakub Konka
49c11e0c34
test/link/macho: upgrade and migrate needed_library test
2024-01-24 12:34:39 +01:00
Jakub Konka
d93a0763d4
test/link/link: pass build options to elf and macho tests
2024-01-24 12:34:39 +01:00
Jakub Konka
041f7d69f0
test/link/macho: test segment boundary symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
ffd7f7f642
test/link/macho: fix naming in entry-in-dylib test
2024-01-24 12:34:39 +01:00
Jakub Konka
6cdcf61a5c
test/link/macho: upgrade and migrate dead_strip test
2024-01-24 12:34:39 +01:00
Jakub Konka
aa50bca151
test/link/elf: make invalid input file test less janky
2024-01-24 12:34:39 +01:00
Jakub Konka
56303d770e
macho: fix invalid generation of FDE records
2024-01-24 12:34:39 +01:00
Jakub Konka
11524e4d0c
test/link/macho: migrate entry_in_dylib test to new test format
2024-01-24 12:34:39 +01:00
Jakub Konka
0a60e4448d
macho: preserve section name for code sections
2024-01-24 12:34:39 +01:00
Jakub Konka
ee68f35bfe
macho: fix section boundary symbols test
2024-01-24 12:34:39 +01:00
Jakub Konka
ee7a027059
macho: parse dependent dylibs
2024-01-24 12:34:39 +01:00
Jakub Konka
ef9aea75d0
macho: fix dead stripping logic to exclude debug sections
2024-01-24 12:34:39 +01:00
Jakub Konka
10a5536a7c
macho: re-instate build-obj codepath
2024-01-24 12:34:39 +01:00
Jakub Konka
c2a0a88284
macho: report duplicate symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
3968aea8ec
macho: write to file
2024-01-24 12:34:39 +01:00
Jakub Konka
98d6d40cd6
macho: allocate sections, segments and atoms
2024-01-24 12:34:39 +01:00
Jakub Konka
32ebceea95
macho: sort sections; use Atom.Alignment for alignment; init segments
2024-01-24 12:34:39 +01:00
Jakub Konka
0b2231998f
macho: init output and synthetic sections
2024-01-24 12:34:39 +01:00
Jakub Konka
f0119ce373
macho: report undefined symbols to the user
2024-01-24 12:34:39 +01:00
Jakub Konka
40e1bb11f8
macho: set dylib ordinals after pruning
2024-01-24 12:34:39 +01:00
Jakub Konka
eca9bc4c33
macho: dead strip dylibs
2024-01-24 12:34:39 +01:00
Jakub Konka
b28ff75f5d
macho: mark imports and exports
2024-01-24 12:34:39 +01:00
Jakub Konka
b0327ff233
macho: handle dead stripping of atoms
2024-01-24 12:34:39 +01:00
Jakub Konka
21e3bb38af
macho: claim unresolved symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
1b76779857
macho: convert tentative defs and create objc sections
2024-01-24 12:34:39 +01:00
Jakub Konka
6b617afe2a
macho: resolve synthetic symbols
2024-01-24 12:34:39 +01:00
Jakub Konka
8a1311733b
macho: resolve symbols and mark files live
2024-01-24 12:34:39 +01:00
Jakub Konka
b8f67d7985
macho: init InternalObject and add forced undefined globals
2024-01-24 12:34:39 +01:00
Jakub Konka
8c7a34ae68
macho: prep for dylib deps (no resolution yet)
2024-01-24 12:34:39 +01:00
Jakub Konka
c023b762cd
macho: parse tbds
2024-01-24 12:34:38 +01:00
Jakub Konka
d153bc2f0c
macho: parse dylibs
2024-01-24 12:34:38 +01:00
Jakub Konka
c5e509595a
macho: parse archives
2024-01-24 12:34:38 +01:00
Jakub Konka
d05e9c3792
macho: create scaffolding for parsing different input objects
2024-01-24 12:34:38 +01:00
Jakub Konka
0c171afab0
macho: parse an input object file!
2024-01-24 12:34:38 +01:00
Jakub Konka
7588eeccea
macho: re-enable --verbose-link
2024-01-24 12:34:38 +01:00
Jakub Konka
dd0addab1f
macho: get the ball rolling!
2024-01-24 12:34:38 +01:00
Jakub Konka
2f94dc939e
macho: copy over new implementation sources from zld
2024-01-24 12:34:38 +01:00
Andrew Kelley
92211135f1
Merge pull request #17155 from winterqt/ignore-nix-ldflags-linkage-directives
...
std.zig.system.NativePaths: ignore linkage directives in `NIX_LDFLAGS`
2024-01-24 00:01:23 -08:00
Andrew Kelley
9d5a133f18
Revert "Don't assume a write if an operand is not in function parameters"
...
This reverts commit 2ab78937dd29fbc299ac434f962a5ff41002cc43.
Premature merge - apologies for the disruption.
Reopens #15685
Reopens #17580
2024-01-23 20:24:58 -07:00
Rahul Prabhu
2ab78937dd
Don't assume a write if an operand is not in function parameters
...
Liveness assumes that if the operand is not in the parameters of
a function call it is being written to, resulting in pointless memcpies.
2024-01-23 18:32:34 -08:00
Krzysztof Wolicki
eff58d6c18
os.windows: Fix error 258 name in Win32Error
2024-01-23 18:06:23 -08:00
Andrew Kelley
f37513aa68
NativePaths: support -L and -l arguments in NIX_LDFLAGS
...
A slightly more robust parsing of these flags in case of a separate
argument appearing after "-L" in the flags.
2024-01-23 18:01:59 -07:00
Winter
6f3ee587ba
std.zig.system.NativePaths: ignore linkage directives in NIX_LDFLAGS
...
`NIX_LDFLAGS` typically contains just `-rpath` and `-L`, which we already
handle. However, at least one setup hook in Nixpkgs [0] adds a linkage
directive to it. To prevent library paths from being missed (as I've
observed myself with `NIX_LDFLAGS` being `-liconv ...`, making it so that
*all* paths are missed), let's just skip over them.
[0]: 08f615eb1b/pkgs/development/libraries/libiconv/setup-hook.sh
2024-01-23 17:49:25 -07:00
mlugg
06d8bb32e3
InternPool: introduce TrackedInst
...
It is problematic for the cached `InternPool` state to directly
reference ZIR instruction indices, as these are not stable across
incremental updates. The existing ZIR mapping logic attempts to handle
this by iterating the existing Decl graph for a file after `AstGen` and
update ZIR indices on `Decl`s, struct types, etc. However, this is
unreliable due to generic instantiations, and relies on specialized
logic for everything which may refer to a ZIR instruction (e.g. a
struct's owner decl). I therefore determined that a prerequisite change
for incremental compilation would be to rework how we store these
indices.
This commit introduces a `TrackedInst` type which provides a stable
index (`TrackedInst.Index`) for a single ZIR instruction in the
compilation. The `InternPool` now stores these values in place of ZIR
instruction indices. This makes the ZIR mapping logic relatively
trivial: after `AstGen` completes, we simply iterate all `TrackedInst`
values and update those indices which have changed. In future, if the
corresponding ZIR instruction has been removed, we must also invalidate
any dependencies on this instruction to trigger any required
re-analysis, however the dependency system does not yet exist.
2024-01-23 21:19:53 +00:00