Skip to content

Commit 40b2337

Browse files
The Web leg of examples/portable is a boundary, and the linker says where it is (#30)
`openkal-emscripten 0.1.0` is in the index, so the Web line now resolves. It does not build, and that is the mechanism rather than a gap. Measured, with the dependency resolved and every translation unit compiled: wasm-ld: error: obj/main.o: undefined symbol: kal_process_spawn wasm-ld: error: obj/main.o: undefined symbol: kal_process_wait wasm-ld: error: obj/main.o: undefined symbol: kal_process_close wasm-ld: error: obj/main.o: undefined symbol: kal_task_start wasm-ld: error: obj/main.o: undefined symbol: kal_task_join wasm-ld: error: obj/main.o: undefined symbol: kal_task_wait wasm-ld: error: obj/main.o: undefined symbol: kal_task_wake Seven names, each one this program uses and this platform does not have. There is no fork, no exec and no second address space under Emscripten, so `openkal.process`, `openkal.exec` and `openkal.space` are absent from that implementation -- and this program uses two of the three. THE CRITERION WAS WRONG AND THE MEASUREMENT IS WHAT SAID SO. The design record asked for this example to build "for all five platforms it names". It cannot, and neither way of making it could is acceptable: `#ifdef`-ing the one file in this ecosystem that exists to contain no platform awareness, or having `openkal-emscripten` provide operations it cannot perform, which is the shape clause 6.2 forbids -- present and always failing, which the caller cannot tell from a condition. So the line stays and the example is better for it. A program about portability that also shows where portability stops is worth more than one that stops at four platforms and says nothing about the fifth. The README and the manifest carry the linker's own output as the evidence, and note that `openkal.task` is a second question with the same answer here: the four `kal_task_*` names resolve under that implementation's `threads` feature, and the three `kal_process_*` names never will. The other three legs are measured and unchanged: host `0 observations that did not hold`, and both Android ABIs build over `openkal-linux` unchanged. Co-authored-by: speak-agent <x.d2learn.org@gmail.com>
1 parent 029cad6 commit 40b2337

2 files changed

Lines changed: 50 additions & 11 deletions

File tree

examples/portable/README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ different ways:
3535
| macOS | `cfg(os = "macos")` | `openkal-macos` |
3636
| iOS, both simulator arches | `cfg(os = "ios")` | `openkal-macos`, unchanged |
3737
| Windows | `cfg(windows)` | `openkal-windows` |
38-
| Web (Emscripten) | `cfg(os = "emscripten")` | `openkal-emscripten` |
38+
| Web (Emscripten) | `cfg(os = "emscripten")` | `openkal-emscripten`, which provides twelve of fifteen |
3939

4040
**Android needs no line of its own**, because `aarch64-linux-android` has
4141
`os = "linux"`: the kernel IS Linux, bionic is a C library above it, and an
@@ -48,12 +48,40 @@ same call numbers, the same calling convention — and what differs between macO
4848
and iOS is the SDK and the deployment-target flag, which belong to the build
4949
tool. So one `cfg` line selects the macOS implementation for all three iOS rows.
5050

51-
**The Web needed new software.** Emscripten has no kernel to issue a call to,
52-
so an implementation there cannot be written beneath a C library and has to sit
53-
above one. `openkal-emscripten` provides twelve of the fifteen interfaces; this
54-
program uses eight, all of which are among them. A program that used
55-
`openkal.process` would fail at link naming the symbol, which is how a partial
56-
surface reports itself.
51+
**The Web needed new software, and this program does not fit on it.**
52+
Emscripten has no kernel to issue a call to, so an implementation there cannot
53+
be written beneath a C library and has to sit above one. `openkal-emscripten`
54+
is that implementation, and it provides twelve of the fifteen interfaces: there
55+
is no fork, no exec and no second address space on this platform, so
56+
`openkal.process`, `openkal.exec` and `openkal.space` are absent. This program
57+
uses `openkal.process` and `openkal.task`.
58+
59+
So the Web line is here to show the BOUNDARY, and the boundary is a link error.
60+
Measured:
61+
62+
```
63+
$ mcpp build --target wasm32-emscripten
64+
wasm-ld: error: obj/main.o: undefined symbol: kal_process_spawn
65+
wasm-ld: error: obj/main.o: undefined symbol: kal_process_wait
66+
wasm-ld: error: obj/main.o: undefined symbol: kal_process_close
67+
wasm-ld: error: obj/main.o: undefined symbol: kal_task_start
68+
wasm-ld: error: obj/main.o: undefined symbol: kal_task_join
69+
wasm-ld: error: obj/main.o: undefined symbol: kal_task_wait
70+
wasm-ld: error: obj/main.o: undefined symbol: kal_task_wake
71+
```
72+
73+
Seven names, each one the program used and the platform does not have. That is
74+
clause 6.2's second time and it is the mechanism rather than a defect: the
75+
dependency RESOLVED, the compile succeeded, and the report arrived at the
76+
earliest moment the information existed. An implementation that had provided
77+
those seven so that they returned an error would have produced a program that
78+
links, runs, and fails somewhere a reader cannot connect to a missing facility.
79+
80+
`openkal.task` is a second question on this platform and has the same answer
81+
here. It is carried by `openkal-emscripten`'s `threads` feature, because
82+
`-pthread` selects a different C library build and memory model; with that
83+
feature the four `kal_task_*` names above resolve. The three `kal_process_*`
84+
names never will.
5785

5886
## The version pins here are a claim, and they were wrong
5987

examples/portable/mcpp.toml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,20 @@ openkal-macos = "0.9.0"
6666
# ABOVE one, which clause 2 permits. `openkal-emscripten` is that
6767
# implementation.
6868
#
69-
# It provides twelve of the fifteen interfaces. This program uses eight, all of
70-
# which are among them; a program that used `openkal.process` would fail at
71-
# LINK naming the symbol, which is clause 6.2's second time and is how a
72-
# partial surface reports itself.
69+
# IT PROVIDES TWELVE OF THE FIFTEEN INTERFACES, AND THIS PROGRAM DOES NOT FIT
70+
# ON IT. There is no fork, no exec and no second address space on this
71+
# platform, so `openkal.process`, `openkal.exec` and `openkal.space` are
72+
# absent -- and this program uses `openkal.process` and `openkal.task`.
73+
#
74+
# The line stays, because what it demonstrates is the BOUNDARY. Measured:
75+
#
76+
# wasm-ld: error: obj/main.o: undefined symbol: kal_process_spawn
77+
# ... and six more, one per name the program used and the platform lacks
78+
#
79+
# The dependency resolved and the compile succeeded; the report arrived at the
80+
# earliest moment the information existed, which is clause 6.2's second time.
81+
# An implementation that had provided those names so that they returned an
82+
# error would have produced a program that links, runs, and fails where a
83+
# reader cannot connect it to a missing facility. See the README.
7384
[target.'cfg(os = "emscripten")'.dependencies]
7485
openkal-emscripten = "0.1.0"

0 commit comments

Comments
 (0)