Problem
Native binaries are not production-grade: Linux output is a fixed-address ET_EXEC (no ASLR); x86_64 Mach-O sets only MH_NOUNDEFS (no MH_PIE); no DWARF is written anywhere so debuggers can't map to source; macOS output makes raw syscalls, whose ABI Apple does not guarantee; and there is no .o output for linking with C.
Evidence (origin/main @ d4b219507)
packages/codegen/src/elf.zig:76packages/codegen/src/aarch64_native_codegen.zig:244packages/codegen/src/macho.zig:208-209packages/codegen/src/native_codegen.zig:4687-4714
Scope
- Emit position-independent code and
ET_DYN/MH_PIEexecutables. - Emit DWARF line tables (at minimum) and symbols.
- Link libSystem on macOS instead of raw syscalls; optional libc on Linux.
--emit=objto produce relocatable objects.
Acceptance criteria
readelf -hshowsDYN; checksec reports PIE on Linux and macOS.- lldb/gdb can break on a Home source line.
- An
--emit=objobject links withccinto a working program.