jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.22k stars 1.74k forks source link

libgcc_s_dw2-1.dll #1060

Closed caobug closed 3 years ago

caobug commented 3 years ago

Hello, I use MSYS2+MinGW to compile the DLL file under the Windows platform, but it depends on "libgcc_s_dw2-1.dll".

I added "-static-libgcc -static-libstdc++" to CFLAGS and LDFLAGS, but it didn't work.

PIC

#! /bin/sh

NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
PROCESSORS=${NPROCESSORS:-3}

export CFLAGS="-Ofast -fomit-frame-pointer -m32 -march=pentium3 -mtune=westmere -static-libgcc -static-libstdc++"
export LDFLAGS="-static-libgcc -static-libstdc++"
export PREFIX="$(pwd)/libsodium-win32"

if (i686-w64-mingw32-gcc --version > /dev/null 2>&1) then
  echo MinGW found
else
  echo Please install mingw-w64-i686-gcc >&2
  exit
fi

./configure --prefix="$PREFIX" --exec-prefix="$PREFIX" \
            --host=i686-w64-mingw32 && \
make clean && \
make -j${PROCESSORS} && \
make install