From 10d8ddaf35f6ecf6c661b0b801447a49501f9701 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 6 Apr 2020 14:39:06 -0700 Subject: [PATCH] strip_symbols.sh: make it work on mac as well --- strip_symbols.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/strip_symbols.sh b/strip_symbols.sh index b853501..c161f60 100755 --- a/strip_symbols.sh +++ b/strip_symbols.sh @@ -1,8 +1,14 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash 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: +EXECUTABLES=$(find ${DIRECTORY} -type f -perm +111) +else EXECUTABLES=$(find ${DIRECTORY} -type f -executable) +fi for e in ${EXECUTABLES}; do echo "Stripping symbols: ${e}" strip ${e} || echo "Failed to strip symbols for ${e}; continuing on."