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

Issue 843103003: android: Hide JNI exports by default. (Closed)

Created:
5 years, 11 months ago by Torne
Modified:
5 years, 10 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), jbudorick+watch_chromium.org, klundberg+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yfriedman+watch_chromium.org, yzshen+watch_chromium.org, jamesr, qsr
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

android: Hide JNI exports by default. Hide JNI exported functions in Android binaries by default, unless the target in question has explicitly set "use_native_jni_exports" to indicate that it relies on the JVM's automatic symbol lookup mechanism. The functions are simply demoted to hidden visibility; the code will remain unless the linker determines that it is unreferenced and strips it via --gc-sections. This ensures that binaries by default actually test the explicit JNI registration codepaths, which are required for compatibility with the crazy linker, while still allowing binaries that do not require crazy linker compatibility to choose to use the automatic mechanism in future. BUG=442327 Committed: https://crrev.com/9d90d85f73ca46847047ccbda270f25b637ccc86 Cr-Commit-Position: refs/heads/master@{#316896}

Patch Set 1 #

Patch Set 2 : Fix AOSP build, fix GL functor library, and generally make it nicer #

Patch Set 3 : Add missing comma. #

Patch Set 4 : Use a blacklist instead of a whitelist #

Total comments: 2

Patch Set 5 : Added gn support #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -24 lines) Patch
M android_webview/android_webview_tests.gypi View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M build/android/android_exports.gyp View 1 2 3 2 chunks +8 lines, -4 lines 0 comments Download
M build/android/android_exports.lst View 1 2 3 1 chunk +0 lines, -15 lines 0 comments Download
A build/android/android_no_jni_exports.lst View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
A + build/android/android_webview_export_whitelist.lst View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M build/common.gypi View 1 2 3 4 3 chunks +18 lines, -4 lines 0 comments Download
M build/config/BUILDCONFIG.gn View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M build/config/android/BUILD.gn View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M tools/android/memconsumer/memconsumer.gyp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (7 generated)
Torne
Not finished yet, just FYI. This probably doesn't work yet as I've not done anything ...
5 years, 11 months ago (2015-01-09 18:51:52 UTC) #2
Torne
Ben, James, can either of you comment on what symbols mojo might need exported from ...
5 years, 11 months ago (2015-01-12 16:10:57 UTC) #4
Primiano Tucci (use gerrit)
LGTM with two notes. 1) Can you please reword a bit the commit message to ...
5 years, 11 months ago (2015-01-12 18:30:36 UTC) #5
jamesr
5 years, 11 months ago (2015-01-12 18:56:57 UTC) #7
jamesr
On 2015/01/12 16:10:57, Torne wrote: > Ben, James, can either of you comment on what ...
5 years, 11 months ago (2015-01-12 18:58:50 UTC) #8
qsr
Does this break android gn builds? I do not see any related change in gn ...
5 years, 11 months ago (2015-01-12 18:58:53 UTC) #9
qsr
On 2015/01/12 18:58:53, qsr wrote: > Does this break android gn builds? I do not ...
5 years, 11 months ago (2015-01-12 19:01:10 UTC) #10
Torne
On 12 Jan 2015 6:58 pm, <jamesr@chromium.org> wrote: > > On 2015/01/12 16:10:57, Torne wrote: ...
5 years, 11 months ago (2015-01-12 19:07:30 UTC) #11
Torne
On 12 Jan 2015 7:01 pm, <qsr@chromium.org> wrote: > > On 2015/01/12 18:58:53, qsr wrote: ...
5 years, 11 months ago (2015-01-12 19:08:37 UTC) #12
qsr
> Apparently they don't, at least as far as we have test coverage in the ...
5 years, 11 months ago (2015-01-12 19:09:16 UTC) #13
Torne
How do you plan to control which symbols are exported from those libraries? The current ...
5 years, 11 months ago (2015-01-12 19:12:57 UTC) #14
jamesr
On other platforms we rely on annotations to control visibility, i.e. __attribute__((visibility("default"))). What's different on ...
5 years, 11 months ago (2015-01-12 19:20:20 UTC) #15
Torne
Hundreds of symbols in the build are marked visible when they shouldn't be, and so ...
5 years, 11 months ago (2015-01-12 19:30:18 UTC) #16
Torne
Also, the original reason for writing this CL is to allow final linked binaries to ...
5 years, 11 months ago (2015-01-12 19:32:09 UTC) #17
jamesr
I believe all the mojo-specific symbols we need to export will match the pattern Mojo*, ...
5 years, 11 months ago (2015-01-12 20:55:26 UTC) #18
Torne
On 2015/01/12 20:55:26, jamesr wrote: > I believe all the mojo-specific symbols we need to ...
5 years, 11 months ago (2015-01-13 11:19:01 UTC) #19
Torne
I'm going to investigate slightly different ways of achieving my aims here and see if ...
5 years, 11 months ago (2015-01-13 14:19:50 UTC) #20
Torne
OK, I've filed http://crbug.com/448386 to cover the more general problem of "android builds have too ...
5 years, 11 months ago (2015-01-13 15:53:08 UTC) #21
jamesr
lgtm
5 years, 11 months ago (2015-01-14 01:53:10 UTC) #22
Torne
+cjhopman, rmcilroy OK, I've uploaded a new patch that uses a blacklist approach to specifically ...
5 years, 10 months ago (2015-01-29 14:22:14 UTC) #25
rmcilroy
base/android lgtm when equivalent GN changes have been made too. https://codereview.chromium.org/843103003/diff/60001/build/android/android_exports.gyp File build/android/android_exports.gyp (right): https://codereview.chromium.org/843103003/diff/60001/build/android/android_exports.gyp#newcode15 ...
5 years, 10 months ago (2015-02-03 13:43:56 UTC) #26
cjhopman
Yeah, this approach works for me.
5 years, 10 months ago (2015-02-03 21:04:28 UTC) #27
Torne
+brettw Brett, does this look okay for the GN configuration?
5 years, 10 months ago (2015-02-18 15:33:04 UTC) #29
brettw
gn lgtm
5 years, 10 months ago (2015-02-18 21:27:26 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/843103003/80001
5 years, 10 months ago (2015-02-18 21:33:51 UTC) #32
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 10 months ago (2015-02-18 21:37:30 UTC) #33
commit-bot: I haz the power
5 years, 10 months ago (2015-02-18 21:38:16 UTC) #34
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/9d90d85f73ca46847047ccbda270f25b637ccc86
Cr-Commit-Position: refs/heads/master@{#316896}

Powered by Google App Engine
This is Rietveld 408576698