Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Issue 806533003: android: don't export unnecessary symbols. (Closed)

Created:
5 years, 11 months ago by Torne
Modified:
5 years, 10 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

android: don't export unnecessary symbols. Android binaries were relying on -Wl,--exclude-libs=ALL to prevent unnecessary symbols from being exported in the final shared libraries built in Chromium, however several changes were submitted that actually disabled this linker flag in virtually all binaries, and thus it was not really being used and many symbols were exported by mistake. Remove --exclude-libs=ALL entirely from the Android build, as well as all the places which were previously having to unset it, and instead exclude the specific libraries which incorporate visible symbols that we don't want: the NDK libraries which we statically link into the binary, and a number of components of chromium which contain assembly code which has not yet been fixed to set symbol visibilities correctly. This reduces the number of exported symbols in the shared libraries to only the ones we intended to export, which saves ~120KB binary size. The GN build does not build the same set of things as static libraries, so the list is slightly different there and several more symbols are left in the final binaries which shouldn't be there, but are not pulled in via a static library and so no --exclude-libs flag will ever fix it; the symbol visibilities will need to be fixed at source. BUG=448386 TBR=ben@chromium.org Committed: https://crrev.com/813edf0d362baf1a2b01fe54bc27ff4601d59713 Cr-Commit-Position: refs/heads/master@{#317027}

Patch Set 1 #

Patch Set 2 : Remove --exclude-libs=ALL completely #

Patch Set 3 : Update GN build to match gyp build #

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -26 lines) Patch
M build/common.gypi View 1 2 3 3 chunks +14 lines, -6 lines 0 comments Download
M build/config/compiler/BUILD.gn View 1 2 3 1 chunk +9 lines, -2 lines 0 comments Download
M mojo/mojo_public_gles2_for_loadable_module.gypi View 1 1 chunk +0 lines, -11 lines 0 comments Download
M testing/android/native_test.gyp View 1 1 chunk +0 lines, -7 lines 0 comments Download

Messages

Total messages: 32 (8 generated)
Torne
Hi Chris, I'm not sure what to do about the GN build here; mojo doesn't ...
5 years, 11 months ago (2015-01-19 17:42:05 UTC) #2
Torne
also +primiano as we discussed this some offline
5 years, 11 months ago (2015-01-21 12:29:10 UTC) #4
cjhopman
lgtm. I wonder, though, what behavior we really want. Should the default for every target ...
5 years, 11 months ago (2015-01-21 19:36:15 UTC) #5
Torne
On 2015/01/21 19:36:15, cjhopman wrote: > lgtm. We definitely need to also update the gn ...
5 years, 11 months ago (2015-01-22 10:39:46 UTC) #6
cjhopman
On 2015/01/22 10:39:46, Torne wrote: > On 2015/01/21 19:36:15, cjhopman wrote: > > lgtm. > ...
5 years, 11 months ago (2015-01-22 19:31:24 UTC) #7
Torne
On 2015/01/22 19:31:24, cjhopman wrote: > What are the symbols that mojo libraries want to ...
5 years, 11 months ago (2015-01-23 12:00:01 UTC) #8
Torne
I'm not sure I can think of a better way to do this, and it ...
5 years, 10 months ago (2015-01-29 13:40:42 UTC) #9
Torne
...although having just posted that, the exported symbols have already regressed since I updated this ...
5 years, 10 months ago (2015-01-29 18:10:20 UTC) #10
Torne
Updated the patch to completely remove --exclude-libs=ALL since it turns out that it has actually ...
5 years, 10 months ago (2015-02-17 10:38:19 UTC) #11
Torne
Oh, also there are still unwanted symbols exported from boringssl, but boringssl is a component ...
5 years, 10 months ago (2015-02-17 10:39:28 UTC) #12
Torne
OK, this should be ready to go now; I've updated the GN build to match, ...
5 years, 10 months ago (2015-02-18 10:49:28 UTC) #13
Primiano Tucci (use gerrit)
LGTM. Torne and I had some long discussion offline. This seem to have the very ...
5 years, 10 months ago (2015-02-18 12:03:50 UTC) #14
Torne
+ben for mojo/ OWNERS
5 years, 10 months ago (2015-02-18 12:22:14 UTC) #16
Torne
On 2015/02/18 12:22:14, Torne wrote: > +ben for mojo/ OWNERS Ben, there are also various ...
5 years, 10 months ago (2015-02-18 12:31:03 UTC) #17
Torne
TBRing ben@ as the mojo change is just a cleanup of the now-obsolete setting in ...
5 years, 10 months ago (2015-02-19 10:15:18 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/806533003/40001
5 years, 10 months ago (2015-02-19 10:16:09 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/43796)
5 years, 10 months ago (2015-02-19 10:20:28 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/806533003/60001
5 years, 10 months ago (2015-02-19 10:25:19 UTC) #25
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 10 months ago (2015-02-19 11:21:47 UTC) #26
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/813edf0d362baf1a2b01fe54bc27ff4601d59713 Cr-Commit-Position: refs/heads/master@{#317027}
5 years, 10 months ago (2015-02-19 11:22:44 UTC) #27
Nico
do you have a check for the exported symbols somewhere? on mac, we have a ...
5 years, 10 months ago (2015-02-24 17:12:38 UTC) #29
Torne
On 2015/02/24 17:12:38, Nico wrote: > do you have a check for the exported symbols ...
5 years, 10 months ago (2015-02-24 17:27:15 UTC) #30
Nico
What were the objections against a whitelist? On Tue, Feb 24, 2015 at 9:27 AM, ...
5 years, 10 months ago (2015-02-24 17:32:43 UTC) #31
Torne
5 years, 10 months ago (2015-02-24 17:47:12 UTC) #32
Message was sent while issue was closed.
On 2015/02/24 17:32:43, Nico wrote:
> What were the objections against a whitelist?

Oh, sorry, the objections were not on this CL, but on this one:
https://codereview.chromium.org/843103003/

See earlier versions of the patch (versions 1-3) and the comments before I
changed approach.

> On Tue, Feb 24, 2015 at 9:27 AM, <mailto:torne@chromium.org> wrote:
> 
> > On 2015/02/24 17:12:38, Nico wrote:
> >
> >> do you have a check for the exported symbols somewhere? on mac, we have a
> >> whitelist of allowed symbols and this gets checked at compile time.
> >> (without
> >> such a check, this will break again)
> >>
> >
> > No, we don't. Having a whitelist was explicitly objected to by several
> > people
> > (the original version of this patch used a whitelist at link time).
> >
> > The linked bug mentions our intention to have some kind of monitoring for
> > this
> > but we haven't put it in place yet or worked out exactly what it should
> > look
> > like. I was imagining something like the monitoring for static initialisers
> > based on the count, rather than a specific whitelist, but maybe that's not
> > the
> > best approach?
> >
> > https://codereview.chromium.org/806533003/
> >
> 
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to mailto:chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698