aboutsummaryrefslogtreecommitdiffhomepage
path: root/protoc-artifacts
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-08-15 12:27:46 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-08-15 12:27:46 -0700
commitfa086c8a85f27b8b522478bce4a0e132372109a8 (patch)
tree953710a2c9997ed06eb1e9577cb48f765824f1c1 /protoc-artifacts
parenteaeca0d42b1fc4a8023a7f90d889631eda9360a3 (diff)
First try static linking pthread
Diffstat (limited to 'protoc-artifacts')
-rwxr-xr-xprotoc-artifacts/build-protoc.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh
index e31948e9..397933d9 100755
--- a/protoc-artifacts/build-protoc.sh
+++ b/protoc-artifacts/build-protoc.sh
@@ -215,8 +215,11 @@ fi
# Statically link libgcc and libstdc++.
# -s to produce stripped binary.
-# And they don't work under Mac.
-if [[ "$OS" != osx ]]; then
+if [[ "$OS" == windows && "$ARCH" == x86_64 ]]; then
+ # Also static link libpthread required by mingw64
+ LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -s"
+elif [[ "$OS" != osx ]]; then
+ # And they don't work under Mac.
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -s"
fi