From bbfb9736af53ad40197a92058ec77ac7248c5ac7 Mon Sep 17 00:00:00 2001 From: Kian Cross Date: Wed, 6 Sep 2023 15:45:27 +0100 Subject: [PATCH] Do not use GNU find features on FreeBSD (#345) 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)