1404 Commits

Author SHA1 Message Date
Jakub Konka
12e34e7037 dwarf: pull out debug line program internals into DeclState helpers 2022-12-05 22:35:07 +01:00
Jakub Konka
8796da0283 dwarf: reuse getDbgInfoAtom helper in all of Dwarf.zig
We need to access it outside of `DeclState` too so why not reuse
the helper anyway.
2022-12-05 14:19:22 +01:00
Jakub Konka
3575048c0a
Merge pull request #13763 from ziglang/macho-dsym-incr
macho+dsym: refactor and reorganize file layout to support incremental DWARF updates
2022-12-05 13:48:12 +01:00
Andrew Kelley
db1819e8ed CBE: fix use-after-free of Type keys in free_locals map 2022-12-04 15:57:40 -07:00
Andrew Kelley
8d8b2c834d CBE: exploit Liveness analysis to reuse locals 2022-12-04 15:57:40 -07:00
Jakub Konka
899d7a771e dsym: dummy repush to check the linux CI 2022-12-04 18:15:14 +01:00
Jakub Konka
a84b67468c dsym: recalculate DWARF segment size when finalizing 2022-12-04 16:58:45 +01:00
Jakub Konka
280dad0283 dsym+dwarf: remove copyRangeAllOverlappingAlloc 2022-12-04 16:58:45 +01:00
Jakub Konka
aa8b26cf25 dsym: refactor API - do not store ptr to MachO 2022-12-04 16:58:45 +01:00
Jakub Konka
d67de87baa dsym: add helper for accessing dwarf seg pointer 2022-12-04 16:58:45 +01:00
Jakub Konka
73d76b26a2 dsym: rename updateLinkeditSegment to finalizeDwarfSegment
This is the checkpoint where we finalize the VM of the primary binary.
2022-12-04 16:58:45 +01:00
Jakub Konka
278426b851 dsym: make sure DWARF segment comes before LINKEDIT
This will greatly simplify incremental updates to DWARF sections
within the bundle.
2022-12-04 16:58:45 +01:00
Jacob Young
81c271cc62 cbe: don't emit extern decls that are already exported 2022-12-03 08:21:03 -05:00
Andrew Kelley
fdbb0fb7b9
Merge pull request #13744 from Vexu/stage2-fixes
Improve error messages, fix dependency loops
2022-12-03 00:42:11 -05:00
Veikka Tuominen
0e38cc16d5 Sema: fix comparisons between lazy and runtime values
Closes #12498
2022-12-03 00:09:23 +02:00
Jakub Konka
bfd36cbf97 dwarf: pass linker Tag and owner Decl.Index instead of *Atom 2022-12-02 13:17:52 +01:00
Jakub Konka
3ec0520bac dwarf: use common DI union object for arg and var gen 2022-12-02 12:22:17 +01:00
Jakub Konka
8fea84f77e dwarf: move Wasm specific dwarf gen out of codegen 2022-12-01 20:55:55 +01:00
Jakub Konka
4120332577 dwarf: fix typos after refactoring dbi gen 2022-12-01 17:23:28 +01:00
Jakub Konka
5bffc17c42 codegen: make LinkerLoad a common struct shared by backends 2022-12-01 16:32:09 +01:00
Jakub Konka
00016ab6a0 dwarf: extract common logic for generating func var dbg info 2022-12-01 15:28:22 +01:00
Jakub Konka
5ee99f862a dwarf: extract common logic for generating func arg dbg info 2022-12-01 14:06:24 +01:00
Luuk de Gram
090deae41d
wasm: enable behavior tests for packed structs 2022-11-30 21:01:09 +01:00
Luuk de Gram
3933a4bac5
codegen: support generating packed structs 2022-11-30 17:56:02 +01:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Robin Voetter
074ba69ba6
spirv: assembler
spirv: introduce SpvModule.Fn to generate function code into

spirv: assembler error message setup

spirv: runtime spec info

spirv: inline assembly tokenizer

spirv: inline assembly lhs result/opcode parsing

spirv: forgot to fmt

spirv: tokenize opcodes and assigned result-ids

spirv: operand parsing setup

spirv: assembler string literals

spirv: assembler integer literals

spirv: assembler value enums

spirv: assembler bit masks

spirv: update assembler to new asm air format

spirv: target 1.5 for now

Current vulkan sdk version (1.3.204) ships spirv tools targetting 1.5,
and so these do not work with binaries targetting 1.6 yet. In the
future, this version number should be decided by the target.

spirv: store operands in flat arraylist.

Instead of having dedicated Operand variants for variadic operands,
just flatten them and store them in the normal inst.operands list.
This is a little simpler, but is not easily decodable in the operand
data representation.

spirv: parse variadic assembly operands

spirv: improve assembler result-id tokenization

spirv: begin instruction processing

spirv: only remove decl if it was actually allocated

spirv: work around weird miscompilation

Seems like there are problems with switch in anonymous struct literals.

spirv: begin resolving some types in assembler

spirv: improve instruction processing

spirv: rename some types + process OpTypeInt

spirv: process OpTypeVector

spirv: process OpTypeMatrix and OpTypeSampler

spirv: add opcode class to spec, remove @exclude'd instructions

spirv: process more type instructions

spirv: OpTypeFunction

spirv: OpTypeOpaque

spirv: parse LiteralContextDependentNumber operands

spirv: emit assembly instruction into right section

spirv: parse OpPhi parameters

spirv: inline assembly inputs

spirv: also copy air types

spirv: inline assembly outputs

spirv: spir-v address spaces

spirv: basic vector constants/types and shuffle

spirv: assembler OpTypeImage

spirv: some stuff

spirv: remove spirv address spaces for now
2022-11-23 19:17:58 +01:00
David Gonzalez Martin
79bba5a9e6 uefi: Delete unneeded alignment and use default 4K
Closes #7484. Right now for UEFI targets an alignment
of 32 is being used for no reason other than support
a rare bytecode. As this is far from the standard case,
removing this alignment and using the default one,
as most toolchains do, should be the desired behavior.
2022-11-20 18:11:43 -05:00
Casey Banner
f746e11879
linker: fail the compilation if there were linker errors
There was no check for linker errors after flushing,
which meant that if the link failed the build would
continue and try to copy the non-existant exe, and
also write the manifest as if it had succeeded.

Also adds parsing of lld output, which is surfaced at the
end of the compilation with the other errors instead
of via stderr
2022-11-19 15:57:08 +02:00
Stevie Hryciw
04f3067a79 run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
Guillaume Wenzek
699e7f721b fix Nvptx backend outputing files at the top level of zig-cache 2022-11-16 18:49:04 -05:00
Andrew Kelley
77e7d97725 C backend: improve ergonomics of zig.h a little bit
Partially implements #13528. Enough to unblock the wasi-bootstrap
branch.
2022-11-13 16:50:16 -07:00
Jakub Konka
04b8ce5fd3 Merge branch 'jcmoyer-lld-explicit-pdb' 2022-11-10 16:52:43 +01:00
Jakub Konka
1357790ec9 win: combine PDB fixes into one changeset 2022-11-10 14:03:11 +01:00
J.C. Moyer
dd8df1caf3 Windows: Explicitly pass PDB paths to lld-link
On Windows, lld-link resolves PDB output paths using `/` and embeds the
result in the final executable, which breaks some native tooling like
WPR/WPA. This commit overrides the default behavior of lld-link by
explicitly setting the output PDB filename and binary-embedded path.
2022-11-10 13:43:35 +01:00
Jakub Konka
0914e0a4ec dwarf: do not assume unsigned 64bit integer for the enum value 2022-11-10 09:36:45 +01:00
Jakub Konka
7007ecdc05 macho: create dSYM bundle directly in the emit dir 2022-11-09 18:35:06 +01:00
Jakub Konka
188ad31cf3 macho: fix 32bit build 2022-11-08 21:21:25 +01:00
Jakub Konka
9db63d4f1d macho: fix handling of DW_FORM_block* forms 2022-11-08 17:45:28 +01:00
Jakub Konka
7145064efd macho: fix parsing len of DW_FORM_string 2022-11-08 15:45:15 +01:00
Jakub Konka
351031b6c7 macho: parse weak symbols in tbds
However, we will treat them as standard imports rather than refs
to weak imports until I investigate more how it actually works
underneath.
2022-11-06 15:19:17 +01:00
Jakub Konka
1aeef29733 coff: move relocation in its own module 2022-11-06 08:41:43 +01:00
Jakub Konka
5ef33e7c7e
Merge pull request #13459 from ziglang/issue-13457
macho: do not zero-out file if there are no nonzerofill sects
2022-11-06 08:39:13 +01:00
Jakub Konka
76fb3e0621 macho: do not zero-out file if there are no nonzerofill sects
If the `__DATA` segment comprises of only zerofill sections, do not
accidentally zero out all of file.
2022-11-06 00:36:27 +01:00
Jakub Konka
165ae04a03 coff: use .x86 instead of .i386 2022-11-05 10:35:04 +01:00
Jakub Konka
59fa0499c9 coff: tentatively handle Obj in getImageBase() func 2022-11-05 10:15:01 +01:00
Jakub Konka
9618fdc8a2 coff: circumvent stage1 inference problems 2022-11-05 10:15:01 +01:00
Jakub Konka
83d89a05b7 coff: compile and link simple exit program on arm64
* make image base target dependent
* fix relocs to imports
2022-11-05 10:15:01 +01:00
Jakub Konka
205421c311 coff: implement handling of arm64-specific relocs 2022-11-05 10:15:00 +01:00
Jakub Konka
d80203b55d coff: clean up relocation handling between x86 and arm64 2022-11-05 10:15:00 +01:00
Jakub Konka
53a9661c1a coff: generate relocations for branch, GOT, direct refs 2022-11-05 10:15:00 +01:00