Opened 8 months ago

Last modified 2 months ago

#32200 new enhancement

only include required bits of OpenSSL in Android builds

Reported by: eighthave Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, tbb-rbm, Android, openssl, cipher, TorBrowserTeam202006
Cc: Actual Points:
Parent ID: Points: 2
Reviewer: Sponsor:

Description

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

Child Tickets

Change History (10)

comment:1 Changed 8 months ago by nickm

For what it's worth, I believe that OpenSSL is pretty good about disabling identifiers in the headers when you disable them. If Tor compiles with it, you probably didn't disable anything crucial.

comment:2 Changed 8 months ago by gk

Component: - Select a componentApplications/Tor Browser
Keywords: tbb-rbm added; Android removed
Owner: set to tbb-team
Parent ID: #28704

comment:3 Changed 7 months ago by eighthave

Keywords: Android openssl cipher added

comment:5 Changed 7 months ago by sysrqb

Keywords: TorBrowserTeam202001 added

comment:6 Changed 6 months ago by pili

Points: 2

comment:7 Changed 4 months ago by pili

Keywords: TorBrowserTeam202002 added; TorBrowserTeam202001 removed

Moving tickets to February

comment:8 Changed 4 months ago by pili

Keywords: TorBrowserTeam202006 added; TorBrowserTeam202002 removed

do this post ESR migration

comment:9 Changed 2 months ago by sysrqb

This is not a blocker of #28704

comment:10 Changed 2 months ago by sysrqb

Parent ID: #28704
Note: See TracTickets for help on using tickets.