Skip to content

Reimplement crt0 code in Zig for vendored libcs #23875

Open
@alexrp

Description

@alexrp

SLoC for crt0 code in some of the libcs we vendor:

  • FreeBSD libc: 825
  • MinGW-w64: 524
  • musl: 321
  • NetBSD libc: 467
  • wasi-libc: 56

(glibc is a bit harder to quantify because its organization is incredibly horrible, which results in us having a bunch of probably unnecessary code in lib/libc/glibc. I would be surprised if it's actually more than 2-3k lines of necessary crt0 code after pruning.)

This is really not a lot of code, so rewriting it in Zig would make a lot of sense, and would make progress towards #16270.

A secondary benefit would be finding any areas of the language that make writing this sort of code harder than it should be. In that regard, I can list these upfront:

Metadata

Metadata

Assignees

Labels

enhancementSolving this issue will likely involve adding new logic or components to the codebase.libcIssues related to libzigc and Zig's vendored libc code.os-freebsdos-linuxos-netbsdos-wasios-windows

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions