Make $prog.ape more reliable on Apple Silicon (#1071)

Now it doesn't matter what argv `$prog.ape` is invoked with. We just get
our executable path the Apple way.
This commit is contained in:
Jōshin 2024-01-07 10:13:20 -05:00 committed by GitHub
parent c4205f8305
commit aa37a327ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 81 deletions

View file

@ -58,8 +58,7 @@ void SetUpOnce(void) {
skiptests = IsOpenbsd() || (IsXnu() && !IsXnuSilicon());
}
} else {
skiparg0 =
!(IsXnuSilicon() || (getauxval(AT_FLAGS) & AT_FLAGS_PRESERVE_ARGV0));
skiparg0 = !(getauxval(AT_FLAGS) & AT_FLAGS_PRESERVE_ARGV0);
}
fprintf(stderr, loaded ? "loaded\n" : "not loaded\n");
if (skiptests) {