From fa3937db6af1ce2e337b72920853834e2b07f36e Mon Sep 17 00:00:00 2001 From: Mitch Date: Tue, 28 Jul 2026 19:04:26 +0100 Subject: [PATCH] Add MacOS silicon build support --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index eaa0baf..9a4c759 100755 --- a/install.sh +++ b/install.sh @@ -287,8 +287,11 @@ build_target() { fi local out_path="${outdir}/${out_name}${exe_suffix}" local build_cmd=(go build -o "$out_path") - if [ "$t" = "native" ]; then + if [ "$t" = "native" ] && [ "$(uname -s)" = "Linux" ]; then # Static-link libgcc so binaries run on minimally-versioned hosts. + # This is a GNU/GCC linker flag; Apple's clang (the native linker on + # macOS) rejects -static-libgcc, and there's no libgcc to link there + # anyway, so only do this on Linux. build_cmd+=(-ldflags '-linkmode external -extldflags "-static-libgcc"') fi build_cmd+=("./tools/${tool}")