aboutsummaryrefslogtreecommitdiffhomepage
path: root/protoc-artifacts/build-protoc.sh
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-08-18 16:25:35 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-08-18 16:25:35 -0700
commit139775ccc040a07e07c5407e34834dab27928cbc (patch)
treec500f4eabfea9d2e059f18b7d612c6e2a2db3ad5 /protoc-artifacts/build-protoc.sh
parent1825d6d8f0aedcd7966c5c137a71e46ae650b3da (diff)
parent26ac3e8e242f1cd6de15291a9973905a14b546ba (diff)
Merge remote-tracking branch 'origin/3.4.x' into mergemaster
Diffstat (limited to 'protoc-artifacts/build-protoc.sh')
-rwxr-xr-xprotoc-artifacts/build-protoc.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh
index e31948e9..57523a41 100755
--- a/protoc-artifacts/build-protoc.sh
+++ b/protoc-artifacts/build-protoc.sh
@@ -185,8 +185,6 @@ elif [[ "$(uname)" == Linux* ]]; then
fi
elif [[ "$OS" == windows ]]; then
# Cross-compilation for Windows
- # TODO(zhangkun83) MinGW 64 always adds dependency on libwinpthread-1.dll,
- # which is undesirable for repository deployment.
CONFIGURE_ARGS="$CONFIGURE_ARGS"
if [[ "$ARCH" == x86_64 ]]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32"
@@ -215,8 +213,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 ]]; 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