Skip to content

Commit bcf0800

Browse files
Japabuclaude
andcommitted
The track says clang and LLD run in a guest, and the loader's refusal of them is closed
#836 relocates an executable in userland, so the kernel reads no table its dynamic section names and allocates nothing a file declares: the loader issue's second half holds, and hosted_clang_hello gets past both spawns, its first. That issue was this branch's own and is cited nowhere else. toyos-builds-itself.md's M2 paragraph said no guest had run either binary. It now says what hosted_clang_hello shows, and what M2's exit still waits on: the driver's link, which starts LLD as a child, and pkg's install. The test's header cited an "M2a" the track never named; it cites M2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cSFvbD35xJ2kGANVdm23C
1 parent 90a594e commit bcf0800

3 files changed

Lines changed: 14 additions & 51 deletions

File tree

‎issues/the-program-loader-refuses-clang-and-lld-whose-elf-tables-pass-one-kernel-allocation.md‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎issues/toyos-builds-itself.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,25 @@ memory beyond what 2 MiB process pages allow
119119

120120
**No linker runs inside ToyOS** (owner, 2026-10-04: "Just get rid of toyos
121121
ld"). `/system/bin/toyos-ld` went with its crate, its `[programs]` row and its
122-
host tests, and nothing replaced it: a ToyOS process cannot link an object, and
122+
host tests, and no image ships a linker: `ld.lld` links inside ToyOS only
123+
where `hosted_clang_hello` stages it, and
123124
the ToyOS-hosted rustc names no linker the guest has
124125
(`issues/the-hosted-rustc-names-a-linker-toyos-does-not-have.md`). *Exit*: the
125126
commit that lands M2's compile-and-run test, which links inside the guest.
126127

127-
**What stops M2: clang and lld running inside ToyOS.** `cargo run --
128+
**What stops M2: the driver's link and the install.** `cargo run --
128129
--hosted-clang` makes a clang and an `ld.lld` for `x86_64-unknown-toyos`,
129130
static PIEs that name no library (`src/hostedclang.rs`): 147.5 MB and
130-
85.6 MB, 121.9 MB and 70.9 MB stripped. No guest has run either.
131-
- Run: what `issues/libc-refuses-what-toyos-cannot-yet-answer.md` lists, and
132-
`issues/libc-has-no-pread-or-pwrite.md`.
131+
85.6 MB, 121.9 MB and 70.9 MB stripped. Both run in a guest:
132+
`hosted_clang_hello` (`tests/common/hostedclang.rs`, run on demand) stages them
133+
on ROOT, compiles `hello.c` with `clang -c`, links it by running `ld.lld` on the
134+
line the driver gives it, runs the program, and both products are the host's
135+
bytes.
136+
- Link through the driver: `clang hello.c` starts LLD as a child, which libc
137+
cannot (`issues/a-childs-end-is-an-event-and-a-parent-takes-its-children-down.md`).
138+
- Install: `pkg` installs neither (**To build**, "`pkg` installs a toolchain").
139+
- Run past `hello.c`: what `issues/libc-refuses-what-toyos-cannot-yet-answer.md`
140+
lists, and `issues/libc-has-no-pread-or-pwrite.md`.
133141

134142
**What M3 adds: a rustc that carries that LLVM**, after all of M2's.
135143
- Build: `issues/rustc-llvm-cannot-build-for-a-toyos-host.md`, and

‎tests/common/hostedclang.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! clang and LLD built for ToyOS (`src/hostedclang.rs`), run inside a guest:
2-
//! M2a of `issues/toyos-builds-itself.md`.
2+
//! M2 of `issues/toyos-builds-itself.md`.
33
//!
44
//! The binaries, clang's resource headers and the C sysroot's headers and
55
//! `libtoyos_c.a` go on the ROOT of `tests/hostedclangcase`, as fixtures

0 commit comments

Comments
 (0)