diff --git a/Makefile b/Makefile index b9a3ea2..96cf059 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,7 @@ build/config.BUILT: build: build/llvm.BUILT build/wasi-libc.BUILT build/compiler-rt.BUILT build/libcxxabi.BUILT build/libcxx.BUILT build/config.BUILT strip: build/llvm.BUILT - cd $(PREFIX)/bin; strip clang-* clang++-* lld llvm-ar + ./strip_symbols.sh $(PREFIX) package: build/package.BUILT diff --git a/strip_symbols.sh b/strip_symbols.sh new file mode 100755 index 0000000..b853501 --- /dev/null +++ b/strip_symbols.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +set -e + +DIRECTORY=${1:-/opt/wasi-sdk/bin} +EXECUTABLES=$(find ${DIRECTORY} -type f -executable) +for e in ${EXECUTABLES}; do + echo "Stripping symbols: ${e}" + strip ${e} || echo "Failed to strip symbols for ${e}; continuing on." +done