A friend and I are working on a project that includes Tor. It needs to be completely portable, including all libraries it needs. All I was able to find via research was building a static Tor binary, but 1. It was noted that this is very bad practice, and 2. when I try to , I get:

checking for event2/bufferevent_ssl.h... yes
checking for library containing pow... -lm  
checking for openssl directory... configure: WARNING: Could not find a linkable openssl.  If you have it installed somewhere unusual, you can specify an explicit path using --with-openssl-dir  
configure: WARNING: On Debian, you can install openssl using "apt-get install libssl-dev"    
configure: error: Missing libraries; unable to proceed.

Note that yes, I have installed libssl-dev using apt-get.

How do I either:

  1. Successfully compile a static binary that could be used in production, or
  2. Make the standard tor binary portable even on systems without the libraries (libevent, libssl, and zlib) without a static binary?

EDIT: I just realized that I'm using a 64-bit system, so when compiling I would get a 64-bit binary. I need a 32-bit one for portability.

  • If it wasn't already part of your research (I'm suspecting it probably was), have a look at this previous thread: tor.stackexchange.com/questions/645/… – Richard Horrocks Feb 2 '16 at 19:21
  • @RichardHorrocks That's exactly what I did. That is what says it's very bad practice, and those instructions give me this error. – Duncan X Simpson Feb 2 '16 at 19:23

Actually you need to link the binaries all-static except system libraries. I've tried to link it full-static, but the portability suffered greatly. That's how I ended with a portable build(for Raspberry Pi exactly) :

ldd /usr/tor/bin/tor
    /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6cbe000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6c2e000)
    libssl.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0 (0xb6bd5000)
    libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (0xb6a68000)
    libcap.so.2 => /lib/arm-linux-gnueabihf/libcap.so.2 (0xb6a54000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6a2c000)
    libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6a19000)
    libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb69f2000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb69c5000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6888000)
    /lib/ld-linux-armhf.so.3 (0x7f59c000)
    libattr.so.1 => /lib/arm-linux-gnueabihf/libattr.so.1 (0xb6872000)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.