summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpauljensen <pauljensen@chromium.org>2016-02-22 04:59:25 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-22 13:00:23 +0000
commitc909504fac9d6cef3ec04113d872e6e13afc7b69 (patch)
tree613fc94086393151ee628e178f0dc2353ef03aed
parent5ac6fa949c5ab820b7289f8e9627a8466e684a95 (diff)
downloadchromium_src-c909504fac9d6cef3ec04113d872e6e13afc7b69.zip
chromium_src-c909504fac9d6cef3ec04113d872e6e13afc7b69.tar.gz
chromium_src-c909504fac9d6cef3ec04113d872e6e13afc7b69.tar.bz2
[Cronet] Hide all symbols besides JNI_OnLoad from libcronet.so
Any other exported symbols run the risk of causing duplicates for embedders. Review URL: https://codereview.chromium.org/1690243002 Cr-Commit-Position: refs/heads/master@{#376716}
-rw-r--r--components/cronet.gypi6
-rw-r--r--components/cronet/android/BUILD.gn5
-rw-r--r--components/cronet/android/only_jni_exports.lst10
3 files changed, 21 insertions, 0 deletions
diff --git a/components/cronet.gypi b/components/cronet.gypi
index 99fece9..a3e1629 100644
--- a/components/cronet.gypi
+++ b/components/cronet.gypi
@@ -243,6 +243,9 @@
'../base/base.gyp:base',
'../net/net.gyp:net_small',
],
+ 'ldflags': [
+ '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/components/cronet/android/only_jni_exports.lst',
+ ],
},
{ # cronet_api.jar defines Cronet API and provides implementation of
# legacy api using HttpUrlConnection (not the Chromium stack).
@@ -408,6 +411,9 @@
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
],
+ 'ldflags': [
+ '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/components/cronet/android/only_jni_exports.lst',
+ ],
'conditions': [
['enable_data_reduction_proxy_support==1',
{
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn
index 64c3fd2..ba38401 100644
--- a/components/cronet/android/BUILD.gn
+++ b/components/cronet/android/BUILD.gn
@@ -240,6 +240,8 @@ shared_library("cronet") {
"//base",
"//net:net_small",
]
+ ldflags = [ "-Wl,--version-script=" +
+ rebase_path("//components/cronet/android/only_jni_exports.lst") ]
}
# cronet_api.jar defines Cronet API and provides implementation of
@@ -422,6 +424,9 @@ shared_library("cronet_tests") {
include_dirs = [ _cronet_version_header_include_dir ]
+ ldflags = [ "-Wl,--version-script=" +
+ rebase_path("//components/cronet/android/only_jni_exports.lst") ]
+
if (cronet_enable_data_reduction_proxy_support) {
deps += [ "//components/data_reduction_proxy/core/browser" ]
}
diff --git a/components/cronet/android/only_jni_exports.lst b/components/cronet/android/only_jni_exports.lst
new file mode 100644
index 0000000..322201c
--- /dev/null
+++ b/components/cronet/android/only_jni_exports.lst
@@ -0,0 +1,10 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ /* Make sure we don't export anything unneeded as it could cause conflicts
+ with symbols from embedders. */
+ global: JNI_OnLoad;
+ local: *;
+};