소스 검색

First try static linking pthread

Jisi Liu 8 년 전
부모
커밋
fa086c8a85
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      protoc-artifacts/build-protoc.sh

+ 5 - 2
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