You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-5Lines changed: 49 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,17 @@
2
2
3
3
Cross-host builds of `qemu-system-x86_64` for the mcpp/xlings package index.
4
4
5
-
**Status: a question being asked, not a package.** Nothing here is published,
6
-
and nothing here should be added to the index until the workflow is green on
7
-
all five hosts.
5
+
**Status: published.**`9.2.4-1` is released here, mirrored to
6
+
`xlings-res/qemu-x86` on GitCode, and admitted to the index as `xim:qemu-x86`
7
+
(openxlings/xim-pkgindex#665).
8
+
9
+
```
10
+
xlings install qemu-x86 -y
11
+
```
12
+
13
+
⭐ The reason it exists is `mcpplibs/openarch`: its `examples/switch` now boots
14
+
on `x86_64-none-elf` through `mcpp run` and prints `switch ok`, which is the one
15
+
claim a working `--version` does not make.
8
16
9
17
## Why this repository exists
10
18
@@ -41,9 +49,8 @@ Linux leg does.
41
49
42
50
|||
43
51
|---|---|
44
-
| An index descriptor | Admission is a separate decision, made after five green legs |
45
52
| Committed binaries | The workflow builds what it checks, so nothing here is a blob whose provenance has to be trusted |
46
-
|A mirror upload | Mirroring an artifact that has not been shown to run would publish the untested thing faster|
53
+
|Firmware pruning | Which `pc-bios` blob a machine type loads is a runtime question. Answering it by deleting until something breaks is how a payload ends up missing one blob on somebody else's machine — this was attempted once during development and reverted|
47
54
48
55
## What "it works" means here
49
56
@@ -70,3 +77,40 @@ resulting size.
70
77
71
78
The version is pinned to the series `qemu-arm` and `qemu-riscv` already carry, so
72
79
that a user who installs all three gets one QEMU generation rather than two.
80
+
81
+
## The payload is self-contained, and that was measured rather than assumed
82
+
83
+
The first build produced binaries that ran on the machine that built them and
84
+
nowhere else: the Linux legs left `libpixman-1`, the glib family, `libz` and
85
+
`libzstd` to the host, and the darwin legs hardcoded `/opt/homebrew/opt/...`.
86
+
87
+
Every non-system shared library is now bundled beside the emulator and reached
88
+
through `$ORIGIN/../lib` (linux), `@loader_path/../lib` (darwin) or the
89
+
executable's own directory (win32, where PE has no runtime search path). The
90
+
workflow asserts it: what remains outside the payload must be core libc and
91
+
system frameworks, nothing else.
92
+
93
+
Measured on the released linux-x64 asset — fifteen objects resolve, twelve from
94
+
the payload's own `lib/`, and the two that cross the boundary are `libc.so.6`
95
+
and `libm.so.6`. That measurement is what lets `xim:qemu-x86` declare no `deps`.
96
+
97
+
⚠️ **The first attempt at that measurement measured nothing.** It was written as
98
+
`ldd <bin> 2>/dev/null | grep -v <payload>`, which printed nothing and read
99
+
exactly like "nothing escapes" — the `ldd` on the PATH was a shell script that
100
+
failed to parse, and it failed on stderr. The numbers above come from
101
+
`LD_TRACE_LOADED_OBJECTS=1` invoked on the loader directly.
102
+
103
+
⚠️ **Bundling also broke the macOS leg silently.** Its pipelines end in `grep`,
104
+
an empty-matching `grep` returns 1, `pipefail` promotes it and `errexit` turns
105
+
it into an exit — so the leg exited 1 after reporting `1564/1564`. `set +e`
106
+
around the bundling blocks fixes it.
107
+
108
+
## Archive layout
109
+
110
+
The archives are flat: `bin/` and `share/` at the top level, no wrap directory.
111
+
112
+
⚠️ That is a choice the consumer has to know about. xim extracts in place, into
113
+
a directory it also uses for other things, so a descriptor cannot move the
114
+
extraction directory wholesale the way `qemu-arm`'s can — `xim:qemu-x86` moves
115
+
the two entries by name, and asserts the emulator *before* the move rather than
0 commit comments