fix: inherit process environment and untrack libc objects

This commit is contained in:
2026-08-11 13:08:40 +02:00
parent 0a91131cb0
commit 3ef98a9fd5
26 changed files with 254 additions and 36 deletions
+6 -6
View File
@@ -66,12 +66,12 @@
prefix_from_env ("PATH", &path);
+#ifdef __montauk__
+ /* MontaukOS does not pass environment variables across spawn yet, so
+ COMPILER_PATH and PATH above are always empty. Derive the compiler
+ search path from argv[0] instead: the driver invokes collect2 by its
+ full path (the kernel provides the real exec path in argv[0]), and
+ `ld` lives in the same libexec directory. Also seed PATH with the
+ SDK bin directories so the nm/strip/tooldir fallbacks work. */
+ /* Keep a fallback for early boot and deliberately minimal environments.
+ Derive the compiler search path from argv[0]: the driver invokes
+ collect2 by its full path (the kernel provides the real exec path in
+ argv[0]), and `ld` lives in the same libexec directory. Also seed PATH
+ with the SDK bin directories when the caller did not provide one. */
+
+ if (cpath.plist == NULL && argv[0] != NULL)
+ {
+ const char *slash = strrchr (argv[0], '/');