Use /usr/local/bin/ape on Apple Silicon

This commit is contained in:
Justine Tunney 2023-11-05 14:48:00 -08:00
parent b893479417
commit f63c4d4f52
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 24 additions and 3 deletions

View file

@ -127,7 +127,11 @@ int sys_execve(const char *prog, char *const argv[], char *const envp[]) {
shargs[1] = (char *)"-";
shargs[2] = (char *)prog;
memcpy(shargs + 3, argv, (argc + 1) * sizeof(char *));
RetryExecve("/usr/bin/ape", shargs, envp);
if (IsXnuSilicon()) {
RetryExecve("/usr/local/bin/ape", shargs, envp);
} else {
RetryExecve("/usr/bin/ape", shargs, envp);
}
char *buf = alloca(PATH_MAX);
const char *name = "/.ape-" APE_VERSION_STR;
InitExecve();