There were seven ways to log, each invented where the previous one was not
reachable:
OnionHEN_log libonion_platform, the only one with a file sink
shellui_log libonion_ipc, klog only — because it did not depend on
libonion_platform
game_log same body as shellui_log
onion_ipc_log same body again
logf libonion_ipc's IPC server, with a sink the host had to
register
log_msg onion_elfldr_server
crash_log util's fault handler, plus a second copy in common/
boot_log bootstrapper's fault handler
klog_printf / klog_puts / printf / puts, called directly
A message's destination therefore depended on which module happened to emit
it: ShellUI's ~300 records went to volatile klog and never reached a log file,
while the daemon's went to klog, stdout and disk.
Everything now goes through the LOG_* macros. All seven legacy entry points
are gone, and klog_printf survives only as a sink inside log.c.
The bare -nostdlib libraries deliberately did not get their own backend. Those
flags only affect the static library's own link step; each is linked into a
host with full libc and pthread, which is why they already called vsnprintf.
A second backend would have recreated the split this removes.
Levels were inferred from message text rather than applied uniformly — the old
entry points carried no severity, so a blanket mapping would either bury real
failures at debug or promote routine chatter to error. Result: 291 error, 63
warn, 140 info, 309 debug.
Consequences worth noting:
* ShellUI records now reach the log file, so a user report finally contains
what the injected process did. In release builds most of them are debug
and compile out, so this costs nothing on a retail unit.
* The IPC server's log-sink injection is gone; both servers registered the
same forwarder.
* common/backtrace.cpp and backtrace.hpp are deleted. That was a third copy
of the frame walking plus its own crash_log, and every caller of
printBacktrace/printBacktraceForCrash had already been commented out.
* Fault handlers use onion_log_emergency, so crash records go to the same
file as everything else instead of a separate crash log.
The shared entry point carries a printf format attribute, which the old
shellui_log explicitly avoided. That attribute found seven real format
defects: %p given typed pointers, %lx given a MonoObject*, %p given a
uint64_t, and %u given an unsigned long. Four of them only compile in debug
builds, so they had gone unnoticed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All 17 module CMakeLists repeated the same prologue: language standards, the
PS5 SDK header paths, a clang check, the cross-compile triple, the output
directory layout and an objcopy strip step. The triple appeared 17 times and
the strip block 6 times, each needing manual sync.
Add source/cmake/OnionTarget.cmake with onion_module_prologue,
onion_output_dirs and onion_strip_debug. Language standards stay opt-in
arguments because the loader-side C modules are C17 while the rest are C11,
and a shared default would silently downgrade them. Per-module compiler flags
are left alone since the modules genuinely differ.
Drop IS_SUBPROJECT and IS_CLANG, which were assigned in 11 and 6 modules
respectively and never read anywhere.
Add CONFIGURE_DEPENDS to the seven source-listing globs that lacked it, so a
newly added source file triggers a re-configure instead of being silently
omitted from the build.
Hoist -DDEBUG onto the shared C flags in the five modules that only passed it
to C++, so both languages in a target see the same macros. No .c file keys
off DEBUG today, so this changes no behaviour.
Compile and link flags were captured from build.ninja before and after: all
132 compile edges and 17 link edges are unchanged except for the intended
-DDEBUG addition.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Require user payloads to launch through :9020 with an exact PID response, removing the :9021 fallback and process-snapshot PID inference.
Supervise the private loader from daemon, recover it through :9021 before restarting util through :9020, and protect synchronous launches with a bounded busy marker.
Add strict loader tests, update runtime documentation, and remove obsolete elfldr and process-snapshot compatibility APIs.
Snapshot candidate processes around 9021 launch so homebrew that keeps
payload.elf as ki_comm still gets a correct PID file. Never write or
ForceKill pid 0/1 (legacy unknown sentinel hung ShellUI on TerminateProcess(1)).
Rename product, namespaces, libraries, paths, and assets from Orion/orion
to Onion/onion across the tree. TCP stack-shutdown magic is now ONIO
(0x4F4E494F) to match the corrected branding.