Jelajahi Sumber

Darwin: fix make cycle

unix.fpexecv takes a rawbytestring as first parameter, so inside the child
it was converting the pchar back to an ansistring and also converting it
to the OS file system code page. Since Darwin uses vfork/execv in
SysUtils.Executeprocess, this could result in (exception)stack corruption
and for some reason only since d1b2fe16 it actually caused issues.

Use execve instead, which takes a pchar as first argument and doesn't
do any further conversions

(cherry picked from commit 305d34a8f6fa2b873a5e0668210360e59a6d0a38)
Jonas Maebe 2 tahun lalu
induk
melakukan
cd83438cb0
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      rtl/unix/sysutils.pp

+ 1 - 1
rtl/unix/sysutils.pp

@@ -1408,7 +1408,7 @@ Begin
   if pid=0 then
    begin
    {The child does the actual exec, and then exits}
-      fpexecv(pchar(pointer(LPath)),Cmdline2);
+      fpexecve(pchar(pointer(LPath)),Cmdline2,envp);
      { If the execve fails, we return an exitvalue of 127, to let it be known}
      fpExit(127);
    end