summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--template/Makefile.in2
-rwxr-xr-xtool/darwin-ar5
3 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a2a0c1e387..56c335a37a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -433,6 +433,12 @@ AS_CASE(["$build_os"],
])
rm -fr conftest*
])
+AS_CASE(["$build_os"],
+ [darwin*], [
+ AC_SUBST(X_WRAPPER_AR, "`cd -P "${tooldir}" && pwd`/darwin-ar $AR")
+ ], [
+ AC_SUBST(X_WRAPPER_AR, "$AR")
+ ])
AS_CASE(["$target_os"],
[wasi*], [
# Clang linker automatically uses wasm-opt with -O if it found.
diff --git a/template/Makefile.in b/template/Makefile.in
index 72aba2d3e9..c4d05ef243 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -230,7 +230,7 @@ RMALL = @RMALL@
LN_S = @LN_S@
TOUCH = touch
NM = @NM@
-AR = @AR@
+AR = @X_WRAPPER_AR@
ARFLAGS = @ARFLAGS@$(empty)
RANLIB = @RANLIB@
AS = @AS@
diff --git a/tool/darwin-ar b/tool/darwin-ar
new file mode 100755
index 0000000000..08e4aadb96
--- /dev/null
+++ b/tool/darwin-ar
@@ -0,0 +1,5 @@
+#!/bin/bash
+exec 2> >(exec grep -v \
+ -e 'has no symbols$' \
+ >&2)
+exec "$@"