@@ -253,12 +253,29 @@ sources = [
253253
254254 # The standard library.
255255 " llvm/libcxx/src/*.cpp" ,
256- # openkal has no source of entropy and this port does not invent one, so the
257- # configuration sets _LIBCPP_HAS_RANDOM_DEVICE to 0 --- and the source that
258- # defines std::random_device must then not be compiled, which is what libc++'s
259- # own build does with the same switch. A program that names random_device is
260- # told by the linker, which is clause 6.1's report.
261- " !llvm/libcxx/src/random.cpp" ,
256+ # ⭐ AND `random.cpp` IS BUILT, BECAUSE openkal NOW HAS A SOURCE OF ENTROPY.
257+ #
258+ # It used to be excluded, paired with `_LIBCPP_HAS_RANDOM_DEVICE 0`, and the
259+ # note here said openkal had no source and this port would not invent one.
260+ # That was accurate: a clock reading is unpredictable to a reader of the
261+ # source and not to an adversary, and openkal.fs deliberately cannot open
262+ # `/dev/urandom` --- a capability-oriented filesystem hands over roots rather
263+ # than the whole namespace.
264+ #
265+ # ⚠️ Neither bypassing the interface layer nor inventing entropy was
266+ # acceptable, so the layer gained an interface: `openkal.random`. The chain
267+ # now runs entirely inside it:
268+ #
269+ # std::random_device → getentropy → getrandom → kal_random_fill → backend
270+ #
271+ # ⚠️ THE BACKEND IS SELECTED EXPLICITLY IN `__config_site`. libc++ falls back
272+ # to `_LIBCPP_USING_DEV_RANDOM` for anything it does not recognise, and that
273+ # one opens `/dev/urandom` by absolute path. `_LIBCPP_USING_GETENTROPY` needs
274+ # no descriptor and no path.
275+ #
276+ # ⚠️ The freestanding configuration keeps the switch at 0: a bare-metal
277+ # backend provides `openkal.random` only if its board has a source, and
278+ # clause 6.1 reports the absence at link time rather than here.
262279 " llvm/libcxx/src/filesystem/*.cpp" ,
263280 " llvm/libcxx/src/ryu/*.cpp" ,
264281 " llvm/libcxx/src/support/runtime/*.cpp" ,
0 commit comments