Commit Graph

27852 Commits

Author SHA1 Message Date
MrDmitry
834f8d45ba Rewrite replace_variables with CMake-specific version
Behavior matches CMake's CMP0053 policy that is the current standard for
variable expansion for `configure_file()`
2024-01-26 13:33:17 -05:00
MrDmitry
2ce32e4497 Extend standalone tests for cmakedefine 2024-01-26 13:33:17 -05:00
Meghan Denny
8a0429e885
test: add behavior coverage for global setter in function liveness 2024-01-26 15:26:37 +02:00
Tobias Simetsreiter
20abf1394a align naming and fix module creation from TranslateC 2024-01-26 15:25:52 +02:00
Zachary Raineri
b36dd55af5 std.os.wasi | Fix comment links
Branch was renamed: master -> main
Preview 1 was moved to legacy
2024-01-26 15:24:07 +02:00
Krzysztof Wolicki
61ba225709
Sema: tuples have no names to be used for reporting errors in finishStructInit 2024-01-26 15:22:15 +02:00
Jacob Young
bea958df4d Compilation: preserve "builtin" as the first dependency
Previously, sorting dependencies would reorder the builtin dependency
and cause `Package.Module.getBuiltinDependency` to stop working.
2024-01-25 22:20:34 -08:00
Jakub Konka
ce58f68903 elf: merge all mergeable string rodata sections into one 2024-01-26 05:48:32 +01:00
Jakub Konka
dcaf43674e
Merge pull request #18576 from ziglang/new-macho
macho: upstream a complete rewrite of the MachO linker
2024-01-24 20:05:03 +01:00
Jakub Konka
0fd0b765fa macho: set __DATA_CONST* segments flags to SG_READ_ONLY 2024-01-24 12:48:22 +01:00
Jakub Konka
5226705b32 std.macho: add segment flags 2024-01-24 12:48:12 +01:00
Jakub Konka
47dd8d0cf7 macho: clean up logic for deciding if needs __stub_helper 2024-01-24 12:40:01 +01:00
Jakub Konka
508ff1dd14 macho: add misc fixes targeting macos 11 2024-01-24 12:34:42 +01:00
Jakub Konka
8fd4c36bf9 build: bump max_rss for building the compiler again 2024-01-24 12:34:42 +01:00
Jakub Konka
e69ffcd8c1 macho: set filename as ident in code signature 2024-01-24 12:34:42 +01:00
Jakub Konka
46bc91ade5 macho: skip -r when single input object file
This is to ensure we don't unnecessarily strip debug info from
the final relocatable input file, so just copy the file out for now.
2024-01-24 12:34:42 +01:00
Jakub Konka
f2dce0c337 macho: exclude symbols from empty sections when parsing unwind info 2024-01-24 12:34:42 +01:00
Jakub Konka
82628dd151 macho: synthesise unwind records from __eh_frame even if no __compact_unwind 2024-01-24 12:34:42 +01:00
Jakub Konka
fe19d1e09b macho: allocate segments in sep step and tweak sorting logic 2024-01-24 12:34:42 +01:00
Jakub Konka
c57e77a455 build: bump max_rss for building the compiler again 2024-01-24 12:34:42 +01:00
Jakub Konka
d726538494 test/link/macho: ensure we do not run testStackSize on foreign host 2024-01-24 12:34:42 +01:00
Jakub Konka
06224c23b7 macho: fix 32bit compilation issues 2024-01-24 12:34:42 +01:00
Jakub Konka
67ea039426 macho: do not enforce platform check for now 2024-01-24 12:34:42 +01:00
Jakub Konka
ead0237814 build: bump maxrss 2024-01-24 12:34:42 +01:00
Jakub Konka
060406a526 macho: ensure we zero-out regions after copying them over
This is to ensure that the loader correctly zeroes-out zerofill
sections when mapping them. For context, Apple's loader dyld
will map the regions where any zerofill would theoretically reside
as belonging to zerofill section.
2024-01-24 12:34:42 +01:00
Jakub Konka
3a6410959c macho: actually lower TLS variables 2024-01-24 12:34:42 +01:00
Jakub Konka
411c7f6669 macho: fix wrong symbol type for TLV vars 2024-01-24 12:34:42 +01:00
Jakub Konka
5c4db4e578 x86_64: emit MachO TLV sequence 2024-01-24 12:34:42 +01:00
Jakub Konka
080ad94249 x86_64: save TLS to stack for MachO 2024-01-24 12:34:42 +01:00
Jakub Konka
6ad4062bf2 macho: save TLS variables in ZigObject 2024-01-24 12:34:42 +01:00
Jakub Konka
c02a603b63 macho: get start index of Zig sections when allocating other sections 2024-01-24 12:34:42 +01:00
Jakub Konka
55f57ceb2e macho: prep for lowering TLS variables 2024-01-24 12:34:42 +01:00
Jakub Konka
5c30c23fc4 macho: get rid of allocateSegments 2024-01-24 12:34:42 +01:00
Jakub Konka
aef2c91d9f macho: move incr Zig sections in file if overlap nonincr sections 2024-01-24 12:34:42 +01:00
Jakub Konka
a531ecf9dc macho: refactor segment creation logic 2024-01-24 12:34:42 +01:00
Jakub Konka
eaf4bb4423 macho: fix not resetting __got_zig sect index after sorting headers 2024-01-24 12:34:42 +01:00
Jakub Konka
8f74d2519f macho: resolve relocs pointing at __got_zig 2024-01-24 12:34:41 +01:00
Jakub Konka
a112241f64 macho: re-read atom code from ZigObject when resolving relocs 2024-01-24 12:34:41 +01:00
Jakub Konka
7647db3273 macho: reserve space for __got_zig rebase opcodes 2024-01-24 12:34:41 +01:00
Jakub Konka
16b66588f0 macho: allocate __LINKEDIT in a separate pass 2024-01-24 12:34:41 +01:00
Jakub Konka
f4da814535 macho: init linkedit segment separately 2024-01-24 12:34:41 +01:00
Jakub Konka
1bdcb23b13 macho: allocate sections and segments that need it 2024-01-24 12:34:41 +01:00
Jakub Konka
0143dd8fdc macho: fix '_' prefixing rules for exports 2024-01-24 12:34:41 +01:00
Jakub Konka
5c951cd211 macho: again fix symbol index dereference in codegen wrt ZigObject 2024-01-24 12:34:41 +01:00
Jakub Konka
a8629fb850 macho: fix symbol index dereference in codegen wrt ZigObject
This is incredibly confusing and I really need to simplify it.
Elf also possesses this shortcoming so once I get Coff up to speed
it should hopefully become clear on how to refactor this.
2024-01-24 12:34:41 +01:00
Jakub Konka
30b7d3e45f macho: implement resolveSymbols in ZigObject 2024-01-24 12:34:41 +01:00
Jakub Konka
5ef63e333a macho: set atom_index for newly created Atom in ZigObject 2024-01-24 12:34:41 +01:00
Jakub Konka
5d0ea3fd27 macho: let us dump some state and debug! 2024-01-24 12:34:41 +01:00
Jakub Konka
9a78173ee0 macho: implement ZigObject.flushModule 2024-01-24 12:34:41 +01:00
Jakub Konka
a79a038e61 codegen: implement more missing bits 2024-01-24 12:34:41 +01:00