--- src/platform/posix/process.c.orig	2023-03-09 14:03:49.000000000 +0800
+++ src/platform/posix/process.c	2023-07-22 02:41:02.000000000 +0800
@@ -59,7 +59,13 @@
 iDefineObjectConstruction(Process)
 iDefineClass(Process)
 
-extern char **environ; /* The environment variables. */
+/* The environment variables. */
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
+ extern char **environ;
+#endif
 
 void init_Process(iProcess *d) {
     d->pid     = 0;
