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
This commit is contained in:
Jonas Maebe 2023-01-22 22:19:52 +01:00
parent e54197e9d2
commit 305d34a8f6

View File

@ -1583,7 +1583,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