From 4c6f928fbf274dd0f8cdd81790f41a2799a4c25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sun, 24 Dec 2023 19:43:32 -0500 Subject: [PATCH] Disable argv[0] tests on non-XnuSilicon (#1015) Adds a TODO explaining the correct condition. --- test/libc/calls/getprogramexecutablename_test.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/libc/calls/getprogramexecutablename_test.c b/test/libc/calls/getprogramexecutablename_test.c index 8e480f960bb..0de855239fa 100644 --- a/test/libc/calls/getprogramexecutablename_test.c +++ b/test/libc/calls/getprogramexecutablename_test.c @@ -36,10 +36,15 @@ void SetUpOnce(void) { __attribute__((__constructor__)) static void Child(int argc, char *argv[]) { static bool skiparg0tests; - if (!__program_executable_name && !IsFreebsd() && !IsNetbsd()) { + if (!IsXnuSilicon()) { + /* TODO(mrdomino): these tests only pass on XnuSilicon right now because + __sys_execve fails there, so the ape loader is used. + the correct check here is "we have been invoked either + as an assimilated binary or via the ape loader, and not + via a raw __sys_execve." */ skiparg0tests = true; if (argc < 2) { - fprintf(stderr, "warning: old/no loader; skipping argv[0] tests\n"); + fprintf(stderr, "warning: skipping argv[0] tests\n"); } } if (argc >= 2 && !strcmp(argv[1], "Child")) {