Lines Matching +full:x86_64 +full:- +full:w64 +full:- +full:mingw32
4 # protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe
6 # Usage: ./build-protoc.sh <OS> <ARCH> <TARGET>
8 # <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH>
11 # cygwin windows x86_32 Requires: i686-w64-mingw32-gcc
12 # cygwin windows x86_64 Requires: x86_64-w64-mingw32-gcc
13 # linux linux aarch_64 Requires: g++-aarch64-linux-gnu
15 # linux linux x86_64
16 # linux windows x86_32 Requires: i686-w64-mingw32-gcc
17 # linux windows x86_64 Requires: x86_64-w64-mingw32-gcc
19 # macos osx x86_64
21 # mingw windows x86_64
36 protoc-gen-javalite)
67 if [ -z "$lineno" ]; then
80 # Usage: checkArch <path-to-protoc>
86 format="$(objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")"
89 host_machine="$(uname -m)";
91 assertEq $format "elf32-i386" $LINENO
92 elif [[ "$ARCH" == x86_64 ]]; then
93 assertEq $format "elf64-x86-64" $LINENO
95 assertEq $format "elf64-little" $LINENO
98 assertEq $format "elf64-powerpcle" $LINENO
100 assertEq $format "elf64-little" $LINENO
108 assertEq $format "pei-i386" $LINENO
109 elif [[ "$ARCH" == x86_64 ]]; then
110 assertEq $format "pei-x86-64" $LINENO
116 format="$(file -b "$1" | grep -o "[^ ]*$")"
120 elif [[ "$ARCH" == x86_64 ]]; then
121 assertEq $format "x86_64" $LINENO
133 # Usage: checkDependencies <path-to-protoc>
137 dump_cmd='objdump -x '"$1"' | fgrep "DLL Name"'
140 host_machine="$(uname -m)";
143 white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2"
144 elif [[ "$ARCH" == x86_64 ]]; then
145 …white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2"
148 dump_cmd='objdump -p '"$1"' | grep NEEDED'
150 …white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libz\.so\.1\|ld64\.s…
152 dump_cmd='objdump -p '"$1"' | grep NEEDED'
153 white_list="libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1"
156 dump_cmd='otool -L '"$1"' | fgrep dylib'
159 if [[ -z "$white_list" || -z "$dump_cmd" ]]; then
160 fail "Unsupported platform $OS-$ARCH."
163 eval $dump_cmd | grep -i "$white_list" || fail "doesn't show any expected dependencies"
165 eval $dump_cmd | grep -i -v "$white_list"
179 CONFIGURE_ARGS="--disable-shared"
185 # Override the default value set in configure.ac that has '-g' which produces
187 CXXFLAGS="-DNDEBUG"
192 # Use mingw32 compilers because executables produced by Cygwin compiler
194 if [[ "$ARCH" == x86_64 ]]; then
195 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32"
197 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-pc-mingw32"
201 elif [[ "$(uname)" == MINGW32* ]]; then
206 assertEq "$ARCH" x86_64 $LINENO
209 if [[ "$ARCH" == x86_64 ]]; then
210 CXXFLAGS="$CXXFLAGS -m64"
212 CXXFLAGS="$CXXFLAGS -m32"
214 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=aarch64-linux-gnu"
216 CXXFLAGS="$CXXFLAGS -m64"
217 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=powerpc64le-linux-gnu"
222 # Cross-compilation for Windows
224 if [[ "$ARCH" == x86_64 ]]; then
225 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32"
227 CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-w64-mingw32"
237 CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.7"
238 if [[ "$ARCH" == x86_64 ]]; then
239 CXXFLAGS="$CXXFLAGS -m64"
241 CXXFLAGS="$CXXFLAGS -m32"
250 # -s to produce stripped binary.
253 LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -s"
256 LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -s"
268 mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" &&
270 cd src && make $MAKE_TARGET -j8 &&
271 cd "$WORKING_DIR" && mkdir -p $(dirname $TARGET_FILE) &&
276 # Since Mac linker doesn't accept "-s", we need to run strip