[tor-bugs] #32200 [- Select a component]: only include required bits of OpenSSL in Android builds

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Oct 22 19:30:16 UTC 2019


#32200: only include required bits of OpenSSL in Android builds
---------------------------------+--------------------------------------
 Reporter:  eighthave            |          Owner:  (none)
     Type:  enhancement          |         Status:  new
 Priority:  Medium               |      Component:  - Select a component
  Version:                       |       Severity:  Normal
 Keywords:  Android, tbb-mobile  |  Actual Points:
Parent ID:                       |         Points:
 Reviewer:                       |        Sponsor:
---------------------------------+--------------------------------------
 I've been doing some experiments to make the Android ''libtor.so''
 binaries smaller.  One of them is building OpenSSL with as many things as
 possible turned off.  This does make the resulting binary smaller.  Here's
 what I tried:

 {{{
 $ ./Configure \
         no-comp no-dtls no-ec2m no-psk no-srp no-ssl2 no-ssl3 \
         no-camellia no-idea no-md2 no-md4 no-mdc2 no-rc2 no-rc4 no-rc5 no-
 rmd160 no-whirlpool \
         no-dso no-engine no-hw no-ui-console \
         no-shared no-unit-test \
 }}}

 The open question is whether the test coverage is good enough to know
 whether this breaks anything.

 Additionally, I think Android ''ndk-build'' used to 'gcc' "gc sections" to
 mark unused code blocks which were then stripped out at the end.  They
 seemed to have stopped doing this with ''clang'', but I don't know why.
 In the past, I have seen the "gc sections" stripping reduce binary size
 quite a bit.

 Also related: I tried building with `-Os` and `-Oz` instead of `-O2`.
 That made a big difference:
 https://github.com/guardianproject/tor-android/issues/18

 This is related to #28764

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


More information about the tor-bugs mailing list