Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#3643 closed defect (fixed)

Building Tor on Mac OS X Lion

Reported by: runa Owned by: erinn
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: infowolfe+tor@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Attached is the log of Tor being compiled with --enable-gcc-warnings during configure on Mac OS X Lion. Looks like Tor works as expected. Thanks to @infowolfe on Twitter for helping with this.

Child Tickets

Attachments (3)

tor.log.bz2 (6.2 KB) - added by runa 8 years ago.
tor-lion-config.log (34.7 KB) - added by edmanm 8 years ago.
OS X Lion / Xcode 4.1 (4B110) / Tor 0.2.3.2-alpha-dev
config.log.bz2 (13.8 KB) - added by edmanm 8 years ago.

Download all attachments as: .zip

Change History (20)

Changed 8 years ago by runa

Attachment: tor.log.bz2 added

comment:1 Changed 8 years ago by edmanm

This doesn't jive with my experience trying to build Tor on OS X Lion. Perhaps infowolfe and I have different Xcode versions. I installed Xcode 4.1 (4B110) from the App Store after installing Lion.

In any case, Apple seems to have deprecated a boatload of OpenSSL APIs, so Tor fails to build with --enable-gcc-warnings (log attached). For example:

cc1: warnings being treated as errors
crypto.c: In function ‘crypto_log_errors’:
crypto.c:173: warning: ‘ERR_get_error’ is deprecated (declared at /usr/include/openssl/err.h:266)
crypto.c:174: warning: ‘ERR_reason_error_string’ is deprecated (declared at /usr/include/openssl/err.h:283)
crypto.c:175: warning: ‘ERR_lib_error_string’ is deprecated (declared at /usr/include/openssl/err.h:281)
crypto.c:176: warning: ‘ERR_func_error_string’ is deprecated (declared at /usr/include/openssl/err.h:282)

The corresponding function prototype for ERR_get_error(), for example, in /usr/include/openssl/err.h looks like this:

unsigned long ERR_get_error(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;

All the other referenced deprecated functions have the same annotation. Indeed, most (if not all) of OpenSSL seems deprecated in Lion:

[edmanm:/usr/include/openssl]$ grep DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *.h |wc -l
    2667

I have no clue what these have all been deprecated in favor of, though.

Changed 8 years ago by edmanm

Attachment: tor-lion-config.log added

OS X Lion / Xcode 4.1 (4B110) / Tor 0.2.3.2-alpha-dev

comment:2 Changed 8 years ago by infowolfe

Cc: infowolfe+tor@… added

The only way to get Apple's gcc (llvm-gcc) onto your Lion box is via XCode 4.1 (4B110) which is free on the App Store.

helios:~/Code/tor$ which gcc
/usr/bin/gcc
helios:~/Code/tor$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You're welcome to compare our versions to verify that yours is the same as mine. I'd really like a look at your config.log, please attach it at your earliest convenience.

comment:3 in reply to:  2 Changed 8 years ago by runa

Replying to infowolfe:

You're welcome to compare our versions to verify that yours is the same as mine. I'd really like a look at your config.log, please attach it at your earliest convenience.

There is a tor-lion-config.log attached to this ticket.

comment:4 Changed 8 years ago by infowolfe

If what I asked for was already there, I wouldn't have asked for it. What I want is the config.log file generated automatically by ./configure which is typically located in the same directory as ./configure.

comment:5 Changed 8 years ago by edmanm

My gcc version is identical to yours, but I don't think that's really the most important thing. You could've just looked at your OpenSSL headers in /usr/local/include to see if they had the same DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER declaration on some/all of the API functions. If not, then the question is really how you ended up with weird OpenSSL headers (e.g., maybe messing with MacPorts or something similar). You also have an extra -I/opt/local/include in your gcc output. Perhaps there's another set of OpenSSL headers living in there? In any case, config.log is attached.

Changed 8 years ago by edmanm

Attachment: config.log.bz2 added

comment:6 Changed 8 years ago by cypherpunks

Yup, looks very much like infowolfe is using macports and a macports-provided openssl here.

-- Sebastian

comment:7 Changed 8 years ago by Sebastian

Component: Tor bundles/installationTor Client
Milestone: Tor: 0.2.2.x-final
Priority: normalmajor
Type: taskdefect

We have a couple of options here. The two acceptable ones I can come up with are: Either we can selectively disable the warning and ignore the deprecation for now, or we can fail during configure and ask people to install an openssl of their own and not use the one shipped with OS X. I am in favor of just disabling the warning, because that means people don't have to hunt for an openssl while their OS still provides one, but I can also see merit in making sure people use their own version of openssl (which would be 1.0x instead of the 0.9x that OS X provides).

nickm?

comment:8 in reply to:  6 Changed 8 years ago by infowolfe

Replying to cypherpunks:

Yup, looks very much like infowolfe is using macports and a macports-provided openssl here.

-- Sebastian

Yah, macports' openssl leaked in with libevent unfortuantely. I'm kinda wondering why edmanm is making noise over something that still isn't technically broken or to be removed immediately. Apple sometimes takes a very long time (10.5 -> 10.6 for instance) to actually act on deprecation notices. Without specifying --enable-gcc-warnings, tor builds fine, macports or not.. and if you add -advisory onto the end like so: "--enable-gcc-warnings-advisory" then the build STILL succeeds and tor still acts as expected.

Anyway, hope to see some of you in Vegas tomorrow. I vote that this bug be closed as "not a bug."

comment:9 Changed 8 years ago by edmanm

Errm. The question was whether or not Tor builds correctly on OS X Lion with --enable-gcc-warnings. Your claim was that it does when in fact that's not true on a standard Lion/Xcode install. I was just pointing out that your claim is not actually true, since you didn't realize you were building with a non-standard OpenSSL (or if you did, you omitted that fact). If that's "making noise", then so be it.

In the short-term, though, yes I do think ignoring it is just fine for now. No claims were made to the contrary.

comment:10 Changed 8 years ago by nickm

I say, disable the warnings if possible.

If OSX eventually stops shipping OpenSSL, then we'll need to start saying "first install OpenSSL for OSX" as part of our build instructions, but for now, suppressing the warnings is fine.

Porting to NSS or GnuTLS or whatever would also be ducky, but that's a bigger job for a later date -- possibly much later!

comment:11 Changed 8 years ago by cypherpunks

Will put up the patch to disable it once I'm back.

--Sebastian

comment:12 Changed 8 years ago by Sebastian

Status: newneeds_review

bug3643 in my repo

comment:13 Changed 8 years ago by nickm

looks ok but needs a changes file.

comment:14 Changed 8 years ago by Sebastian

right you are, sorry. Updated.

comment:15 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

merging, thanks!

comment:16 Changed 7 years ago by nickm

Keywords: tor-client added

comment:17 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.