From 60a762a791b331736217912cd0d253994557a65e Mon Sep 17 00:00:00 2001 From: Kian Cross Date: Fri, 1 Sep 2023 20:18:35 +0100 Subject: [PATCH] Do not use GNU find features on FreeBSD FreeBSD (like MacOS) does not support the `-executable` argument for `find`. This commit checks if the OS is FreeBSD, and if so, uses the same workaround as already in place on MacOS. --- strip_symbols.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/strip_symbols.sh b/strip_symbols.sh index c161f60..effd300 100755 --- a/strip_symbols.sh +++ b/strip_symbols.sh @@ -2,9 +2,9 @@ set -e DIRECTORY=${1:-/opt/wasi-sdk/bin} -if [[ "$OSTYPE" == "darwin"* ]]; then -# macos find doesnt support -executable so we fall back on having a permission -# bit to execute: +if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then +# macos and freebsd find do not support -executable so we fall back on +# having a permission bit to execute: EXECUTABLES=$(find ${DIRECTORY} -type f -perm +111) else EXECUTABLES=$(find ${DIRECTORY} -type f -executable)