[tor-bugs] #6623 [Core Tor/Tor]: --enable-static-tor cannot succeed

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 6 01:12:35 UTC 2020


#6623: --enable-static-tor cannot succeed
-------------------------------------------------+-------------------------
 Reporter:  tmpname0901                          |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.3.20-rc
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-relay, autotools, build, link,   |  Actual Points:
  static, 032-unreached-backport,                |
  035-deferred-20190115, 041-proposed, 033       |
  -unreached-backport                            |
Parent ID:                                       |         Points:
 Reviewer:  nickm                                |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by teor):

 Replying to [comment:32 werd]:
 > I want to build tor, not download it from somewhere else. My computer is
 on wifi so that prevents me from being an acceptable relay or bridge, best
 I can tell.  But after I copy over the binaries I made, to a computer with
 ethernet to the router, and run tor I get this:
 >
 > {{{
 > dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib
 >   Referenced from: /path/to/tor/bin/tor
 >   Reason: image not found
 > Abort trap: 6
 > }}}
 >
 > So it seems tor is relying on a library burried deep in xcode.

 This is the clang address sanitizer library. We don't recommend using it
 for relays or bridges, because it makes them crash on some non-fatal
 errors.

 You can disable this library by removing --enable-expensive-hardening or
 --enable-fragile-hardening from your configure command-line.

 > I've already built zlib, libevent, and libressl/openssl as static. My
 tor configure line informs tor of this. But as soon as I add {{{--enable-
 static-tor}}} and ./configure, the checking stops (as noted above in
 comment 21) here:
 >
 > {{{
 > checking whether free(NULL) works... no
 > configure: error: Your libc implementation doesn't allow free(NULL), as
 required by C99.
 > }}}
 >
 > Based on my reading of this ticket and others, it seems there is
 something out of order, but my attempts to mimic what others said worked
 for them, has not worked for me.
 >
 > I changed the order as noted in the patch here: #27802, (lines 169 &
 222), but the same error happened.

 Does macOS ship with a static C library?

 As far as I remember, it's not possible to build a truly static binary on
 macOS, because some of the lower-level OS libraries are dynamic. But you
 can get close.

 And I think you're actually trying to solve a slightly different problem,
 which is transferring a binary from one macOS to another. That shouldn't
 require a static tor, Tor Browser compiles a single binary that works on
 multiple macOS versions.

 Have you tried passing -mmacosx-version-min=version to your C compiler?
 That will disable any features that aren't available on newer macOS.

 Have you tried building all the dynamic libraries, and then copying them
 across with the binary? You may need to set the library paths correctly in
 the binary, or set LD_LIBRARY_PATH before launching it.

 You might also be happier if you use a package manager like HomeBrew to
 build from source on the wired Mac. It should have package definitions and
 debugging output that let you modify and verify the build.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6623#comment:33>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list