fix: inherit process environment and untrack libc objects
This commit is contained in:
@@ -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], '/');
|
||||
|
||||
Reference in New Issue
Block a user