ursachec / CPAProxy

A thin Objective-C wrapper around Tor.
Other
161 stars 49 forks source link

Fails to build for 64bit architectures #40

Closed rainwolf closed 7 years ago

rainwolf commented 8 years ago

OpenSSL builds for i386 and armv7 architectures, but Tor complains of a non-linkable OpenSSL for the arm64 and x86_64 architectures with XCode 7.3.

The specific error (when building Tor) is the following: 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

chrisballinger commented 8 years ago

Seeing this now too. It's definitely related to Xcode 7.3 but I have no idea why it's broken all of a sudden.

chrisballinger commented 8 years ago
conftest.c:69:25: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
RAND_add((void*)0,0,0); exit(0);
                        ^
conftest.c:69:25: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
| void RAND_add(const void *buf, int num, double entropy);
| int
| main ()
| {
| RAND_add((void*)0,0,0); exit(0);
|   ;
|   return 0;
| }

Looks like the latest version of clang complains about conftest.c missing #include <stdlib.h> because it's using exit(). Not sure why it would only complain on 64-bit archs.

chrisballinger commented 8 years ago

Ok so it can be fixed with a patch to configure.ac but it also requires you to have autoconf installed. I'll see if this is something that should be fixed upstream in Tor.

chrisballinger commented 8 years ago

Tracking upstream here: https://trac.torproject.org/projects/tor/ticket/18626#ticket

rainwolf commented 8 years ago

I used your suggested patch and incorporated it in my fork if others are interested. I'll remove it once the suggested patch (in the Tor ticket) makes it in the next Tor release.

mtigas commented 8 years ago

Just wanted to note that I’m seeing this here as well.

Looks like the fix landed for 0.2.8.2-alpha and that works just fine once you’ve updated your build to include the new 0.2.8 libs (https://github.com/OnionBrowser/iOS-OnionBrowser/commit/6b7be94de5750c2f8dee9dcd6ab727b4d0591d6b#diff-bf0359edc5b2b5cebe5e69a8cfdadcc8L253).

Per the Tor ticket, doesn’t look like it will be backported to 0.2.7 so folks needing stable will probably need to keep using the patch for now.