Skip to content

A statically linked Tor build for Windows — no DLLs, no dependencies. Includes build guide and verified precompiled binary.

License

Notifications You must be signed in to change notification settings

masterman331/tor-static-windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🧱 Tor Static for Windows

A fully statically linked Tor build for Windows — no external DLLs, no dependencies, no setup hassle.
Built with MSYS2 + MinGW64, this binary runs completely standalone on Windows.

⚠️ Note: This project is not affiliated with or endorsed by the Tor Project.
It’s a community-built version meant for educational and convenience purposes only.
Always verify any binary you download.


🧩 Why This Exists

If you’ve ever tried compiling Tor on Windows… you know.
Static linking is possible — but painful. Dependency hell, path quirks, library conflicts, and random build errors that make you question life choices.

So, I decided to go through that pain once, get it working cleanly, and share both:

  • A ready-to-use static build (tor.exe)
  • A step-by-step guide on how to build it yourself

⚙️ Build Environment

This static build was produced using:

  • Windows 10/11 (x64)
  • MSYS2 (MINGW64 shell)
  • gcc (MinGW-w64)
  • OpenSSL, libevent, and zlib — statically linked
  • No shared .dll dependencies

You can verify that by running:

ldd tor.exe

If you see “not a dynamic executable”, it’s fully static.


🧰 How to Build It Yourself

If you want to recreate it (or just trust your own binary), here’s how I did it.

1. Install MSYS2

Grab it from https://www.msys2.org Open MSYS2 MINGW64 terminal after installing.

2. Install dependencies

pacman -Syu
pacman -S git make autoconf automake libtool mingw-w64-x86_64-gcc \
    mingw-w64-x86_64-openssl mingw-w64-x86_64-zlib \
    mingw-w64-x86_64-libevent pkg-config

3. Clone and configure Tor

git clone https://git.torproject.org/tor.git
cd tor
./autogen.sh
./configure --enable-static-tor --disable-asciidoc \
    --disable-system-torrc \
    --with-libevent-dir=/mingw64 \
    --with-openssl-dir=/mingw64 \
    --with-zlib-dir=/mingw64 \
    LDFLAGS="-static"

4. Build it

make -j$(nproc)

If you get a /tmp/tor_lib_combining error, rebuild single-threaded:

make clean && make -j1

5. Find your build

Output will be at:

src/app/tor.exe

To copy it to your desktop:

cp src/app/tor.exe /c/Users/$(whoami)/Desktop/

🧪 Verify the Build

Check version:

tor.exe --version

Check static linking:

ldd tor.exe

It should respond:

not a dynamic executable

You can also upload it to VirusTotal — static Tor binaries often trigger false positives (because of network behavior and static linking), but they’re harmless if built from source.


🧾 License & Credits

  • Tor is licensed under BSD-3-Clause — original source: https://git.torproject.org/tor.git
  • This repository’s scripts and instructions are under GPL-3.0
  • Built and maintained by [YourNameHere]

💬 Notes

This repo includes:

  • /build/tor.exe — prebuilt static binary
  • /docs/BUILD.md — this guide
  • /scripts/ — build scripts used in the process

If you want to rebuild, you can simply rerun the commands or use the build_static_tor.sh script.


🚀 Quick Summary

Step Command Description
Install deps pacman -S ... Get everything you need
Clone source git clone https://git.torproject.org/tor.git Get Tor code
Configure ./configure ... LDFLAGS="-static" Enable static build
Build make -j$(nproc) Compile it
Verify ldd tor.exe Confirm static linking

❤️ Why Share It

Because nobody deserves to lose a weekend fighting MinGW just to build one static binary. If this saves someone a few hours (or gray hairs), it was worth it.


⭐ If you found this useful

Give it a star on GitHub or contribute improvements — let’s make Tor easier for Windows users.


About

A statically linked Tor build for Windows — no DLLs, no dependencies. Includes build guide and verified precompiled binary.

Resources

License

Stars

Watchers

Forks

Packages

No packages published