summaryrefslogtreecommitdiff
path: root/README.md
blob: 88d327dcb01cd18bb10b031c7050c110efdfc9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
This project helps build a static binary for Tor.

Some inspiration is taken from the
[tor-static](https://github.com/cretz/tor-static) Go library.

# Versions

This repo builds:

- Libevent 2.1.8
- OpenSSL 1.1.1b
- Tor 0.4.0.5
- zlib v1.2.11

# Requirements

- Linux or Windows+MSYS2
- A proper C compiler toolchain.
- Make
- Autotools

For Arch Linux & MSYS2-MinGW64: `pacman -S base-devel`

# Usage

- Make sure you have all the required dependencies..
- Run `./build.sh`
- Wait.
- Discover that you suddenly have a working `tor-static` binary.

The generated binary is not *entirely* static because it still links against
your system libc. Handy scripts are included for cross-compilation:

- `x86_64-linux-musl.sh` will build a fully static binary linked against musl
  libc. Requirements: musl-based cross compiler in `/opt/cross`, you can get
  these from [musl-cross](https://bitbucket.org/GregorR/musl-cross/) or
  [musl.cc](https://musl.cc/).
- `x86_64-w64-mingw32.sh` will cross-compile a Windows binary, requires a
  mingw32 cross compiler in `/opt/cross` ([musl.cc](https://musl.cc/) has
  these).

More targets TBD.