From 3d3cdcf27649b67713aa2e86938799a8b0c7e64b Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Fri, 10 Nov 2023 12:23:09 -0800 Subject: [PATCH] Fix APE uname direction Fixes #942 --- ape/ape.S | 5 +++-- tool/build/apelink.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ape/ape.S b/ape/ape.S index d92863b9bed..25d5b199a4a 100644 --- a/ape/ape.S +++ b/ape/ape.S @@ -592,8 +592,9 @@ ape_disk: #ifdef APE_IS_SHELL_SCRIPT apesh: .ascii "\n@\n#'\"\n" // sixth edition shebang - .ascii "m=\"$(/bin/uname -m >/dev/null)\" || " - .ascii "m=\"$(/usr/bin/uname -m)\"\n" + .ascii "m=$(/bin/uname -m 2>/dev/null) || " + .ascii "m=$(/usr/bin/uname -m 2>/dev/null) || " + .ascii "m=x86_64\n" .ascii "if [ \"$m\" = x86_64 ] || [ \"$m\" = amd64 ]; then\n" // Until all operating systems can be updated to support APE, diff --git a/tool/build/apelink.c b/tool/build/apelink.c index efad1c41c30..5807ac1073b 100644 --- a/tool/build/apelink.c +++ b/tool/build/apelink.c @@ -1944,8 +1944,9 @@ int main(int argc, char *argv[]) { } // otherwise this is a fresh install so consider the platform - p = stpcpy(p, "m=\"$(/bin/uname -m >/dev/null)\" || " - "m=\"$(/usr/bin/uname -m)\"\n"); + p = stpcpy(p, "m=$(/bin/uname -m 2>/dev/null) || " + "m=$(/usr/bin/uname -m 2>/dev/null) || " + "m=x86_64\n"); if (support_vector & _HOSTXNU) { p = stpcpy(p, "if [ ! -d /Applications ]; then\n"); }