summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2012-01-20 23:13:35 +0100
committerSebastian Hahn <sebastian@torproject.org>2012-01-20 23:30:53 +0100
commit1f5c5624f48b078e8c421874bf0015e84bda57f7 (patch)
tree14f9603931e1881c8b72a02b0fa7a7e01305fb27
parenta812e8b6a875241839e2fd367c31b9e446977dff (diff)
downloadtor-1f5c5624f48b078e8c421874bf0015e84bda57f7.tar.gz
tor-1f5c5624f48b078e8c421874bf0015e84bda57f7.zip
Use dead_strip to reduce binary size on OS X
This option seems to be supported all the way back to at least 10.4, so enabling it for OS X in general should be fine. If not, someone will yell. With no libs statically linked, that's a 3% win in binary size, with just libevent linked statically, this gives us an advantage of 5% in terms of binary size, and with libevent and openssl statically linked, we gain over 18% or over 500KB. Implements ticket 2915.
-rw-r--r--changes/osx_deadstrip5
-rw-r--r--configure.in5
2 files changed, 8 insertions, 2 deletions
diff --git a/changes/osx_deadstrip b/changes/osx_deadstrip
new file mode 100644
index 0000000000..f16eca4685
--- /dev/null
+++ b/changes/osx_deadstrip
@@ -0,0 +1,5 @@
+ o Minor features:
+ - Use the dead_strip option when building Tor on OS X. This reduces binary
+ size by almost 19% when linking openssl and libevent statically, which
+ we do for TBB.
+
diff --git a/configure.in b/configure.in
index f4a8e1ee19..de726c7046 100644
--- a/configure.in
+++ b/configure.in
@@ -1160,12 +1160,13 @@ else
fi
# OS X Lion started deprecating the system openssl. Let's just disable
-# all deprecation warnings on OS X.
+# all deprecation warnings on OS X. Also, to potentially make the binary
+# a little smaller, let's enable dead_strip.
case "$host_os" in
darwin*)
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
- ;;
+ LDFLAGS="$LDFLAGS -dead_strip" ;;
esac
# Add some more warnings which we use in development but not in the