Оптимизированные сборки Tor 0.3.2.9 для Windows, а также tor2web версия и отладочные символы ко всем файлам.
tor-win32-0.3.2.9.7z
sha256: 0FD7EEE9F5444A344F4865CD6523436DA17C8F8CCB8CE702F6E1EE3214DA9C0B
tor-win64-0.3.2.9.7z
sha256: 85020AD75BA9ED788A89F5346608B64329DAC6CC48D97A84018CDD9C2E460DF4
Заклинание для самостоятельной сборки (в полной форме, кастуется в MSYS2 MinGW):
# install and update required msys packages
pacman -Syu --noconfirm
pacman -S --needed --noconfirm msys/make msys/tar msys/python2 msys/perl
pacman -S --needed --noconfirm msys/liblzma-devel msys/libevent-devel msys/openssl-devel msys/zlib-devel
pacman -S --needed --noconfirm msys/pkg-config msys/diffutils msys/binutils
if [[ "$MSYSTEM" == "MINGW32" ]]; then
pacman -S --needed --noconfirm mingw32/mingw-w64-i686-gcc mingw32/mingw-w64-i686-make
pacman -S --needed --noconfirm mingw32/mingw-w64-i686-pkg-config mingw32/mingw-w64-i686-diffutils mingw32/mingw-w64-i686-binutils
pacman -S --needed --noconfirm mingw32/mingw-w64-i686-libevent mingw32/mingw-w64-i686-openssl mingw32/mingw-w64-i686-zlib
pacman -S --needed --noconfirm mingw32/mingw-w64-i686-gettext mingw-w64-i686-python2
elif [[ "$MSYSTEM" == "MINGW64" ]]; then
pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-make
pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-pkg-config mingw64/mingw-w64-x86_64-diffutils mingw64/mingw-w64-x86_64-binutils
pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-libevent mingw64/mingw-w64-x86_64-openssl mingw64/mingw-w64-x86_64-zlib
pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-gettext mingw-w64-x86_64-python2
else
echo "Msys is not detected" >&2
exit 1
fi
# download and install cv2pdb tool
if [[ ! -x "$(command -v cv2pdb)" ]]; then
wget -O /usr/bin/cv2pdb.exe https://ci.appveyor.com/api/projects/rainers/visuald/artifacts/cv2pdb.exe?job=Environment%3A%20os%3DVisual%20Studio%202013%2C%20VS%3D12%2C%20APPVEYOR_BUILD_WORKER_IMAGE%3DVisual%20Studio%202015
fi
# creating build directory
[[ "$MSYSTEM" == "MINGW32" ]] && mkdir -p project32 && cd project32
[[ "$MSYSTEM" == "MINGW64" ]] && mkdir -p project64 && cd project64
# download and unpack source code
[[ ! -f tor-0.3.2.9.tar.gz ]] && wget https://www.torproject.org/dist/tor-0.3.2.9.tar.gz
[[ ! -f v1.3.3.tar.gz ]] && wget https://github.com/facebook/zstd/archive/v1.3.3.tar.gz
[[ ! -f xz-5.2.3.tar.gz ]] && wget https://tukaani.org/xz/xz-5.2.3.tar.gz
[[ ! -f openssl-1.1.0g.tar.gz ]] && wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
[[ ! -f libevent-2.1.8-stable.tar.gz ]] && wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
find *.tar.gz -type f -exec tar xzf '{}' \;
# =====================================================================
TARGETDIR="$PWD/install" && mkdir -p "$TARGETDIR"
export PKG_CONFIG_PATH="$TARGETDIR/lib/pkgconfig"
export CFLAGS="-march=core2 -mtune=corei7 -pipe -Ofast -g -ffunction-sections -fdata-sections -fomit-frame-pointer -flto -ffat-lto-objects -I$TARGETDIR/include"
export LDFLAGS="-Wl,--gc-sections,--as-needed,--nxcompat,--dynamicbase,--no-bind -L$TARGETDIR/lib"
export CXXFLAGS=$CFLAGS
[[ "$MSYSTEM" == "MINGW32" ]] && export LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
[[ "$MSYSTEM" == "MINGW64" ]] && export LDFLAGS="$LDFLAGS -Wl,--high-entropy-va"
*****U_COUNT=$(python -c 'import multiprocessing; print (multiprocessing.*****u_count());')
echo "$*****U_COUNT *****Us detected..."
echo "GCC opts: $CFLAGS"
echo "LD opts: $LDFLAGS"
# =====================================================================
# compile libzstd
cd zstd-*/lib/
***** Makefile Makefile.old
sed -i 's/,$(filter $(shell uname),Linux /,$(filter $(shell uname -o),Msys Linux /' Makefile
make install PREFIX="$TARGETDIR" -j$*****U_COUNT
***** zstd.h "$TARGETDIR/include/"
cd ../..
# compile liblzma
cd xz-*/
./configure --prefix="$TARGETDIR" --enable-static --disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts --disable-doc --enable-silent-rules --disable-nls --disable-rpath
make -j$*****U_COUNT
make check
make install
cd ..
# compile openssl
cd openssl-*/
OPENSSL_PARAMETERS="--prefix=$TARGETDIR --release no-shared no-dso no-zlib-dynamic no-poly1305 no-chacha $CFLAGS $LDFLAGS"
[[ "$MSYSTEM" == "MINGW32" ]] && OPENSSL_TARGET=mingw
[[ "$MSYSTEM" == "MINGW64" ]] && OPENSSL_TARGET=mingw64 && OPENSSL_PARAMETERS="$OPENSSL_PARAMETERS enable-ec_nistp_64_gcc_128"
echo "OPENSSL_TARGET: $OPENSSL_TARGET"
echo "OPENSSL_PARAMETERS: $OPENSSL_PARAMETERS"
make clean && make distclean
perl Configure $OPENSSL_TARGET $OPENSSL_PARAMETERS
make -j$*****U_COUNT
make test
make install
cd ..
# compile libevent
cd libevent-*/
./configure --prefix="$TARGETDIR" --enable-static --disable-shared --with-pic --disable-malloc-replacement --disable-debug-mode --disable-samples --enable-function-sections --disable-clock-gettime --disable-largefile --disable-libevent-regress
make -j$*****U_COUNT
make check
make install
cd ..
# now it is time to compile tor if everything is OK above
cd tor-*/
TOR_LIB_PATCHS="--with-libevent-dir=$TARGETDIR/lib --with-openssl-dir=$TARGETDIR/lib --with-zlib-dir=$MINGW_PREFIX/lib"
TOR_PARAMETERS="--exec-prefix=$TARGETDIR $TOR_LIB_PATCHS --enable-local-appdata=no --disable-system-torrc --disable-asciidoc --disable-gcc-hardening --disable-linker-hardening --enable-static-openssl --enable-static-libevent --enable-static-zlib --enable-lzma --enable-zstd"
export LIBS="-lcrypt32"
# compile Tor with enabled Tor2Web mode
make clean && make distclean
./configure $TOR_PARAMETERS --enable-static-tor --enable-tor2web-mode
make -j$*****U_COUNT
make install
mv ../install/bin/tor.exe ../install/bin/tor2web.exe
# compile normal Tor
make clean && make distclean
./configure $TOR_PARAMETERS --enable-static-tor
make -j$*****U_COUNT
rm -rf /tmp/* && make check
make install
cd ..
# extract debug information to .pdb files
find ./install/bin -type f \( -name *.exe -or -name *.dll \) -exec cv2pdb '{}' \;
Редактировался ЕУ (2018-02-16 22 ч.)