ReviewOS

home-lang/home

feat(codegen): production executable format — PIE, DWARF, libc linkage, object output

#796
Open chris opened this 9 days ago ·
9 days ago

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)

Scope

  • Emit position-independent code and ET_DYN / MH_PIE executables.
  • Emit DWARF line tables (at minimum) and symbols.
  • Link libSystem on macOS instead of raw syscalls; optional libc on Linux.
  • --emit=obj to produce relocatable objects.

Acceptance criteria

  • readelf -h shows DYN; checksec reports PIE on Linux and macOS.
  • lldb/gdb can break on a Home source line.
  • An --emit=obj object links with cc into a working program.

Related: #15 Part of #814.

Sign in to comment on this issue.