Commit 791b7080 authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Commit Bot

Make gvr_shim a component.

This is really what we ought to be doing to avoid ODR violations
caused by linking the prebuilt .a into multiple components, but
I previously couldn't see a way to link the .a into the component
.so with --whole-archive. However, it turns out that it's possible
using ldflags. This is a little hackish but it's probably better than
dealing with ODR violations.

Bug: 749784
Change-Id: I1ae275d57f36bc4a2c816d7f0ee8fdc4c000cf63
Reviewed-on: https://chromium-review.googlesource.com/1016092Reviewed-by: default avataragrieve <agrieve@chromium.org>
Reviewed-by: default avatarBiao She <bshe@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551711}
parent 8a8a1cae
...@@ -98,13 +98,27 @@ config("libgvr_config") { ...@@ -98,13 +98,27 @@ config("libgvr_config") {
include_dirs = [ "src/libraries/headers/" ] include_dirs = [ "src/libraries/headers/" ]
} }
source_set("gvr_shim") { component("gvr_shim") {
libs = [
"android",
"log",
]
if (enable_chrome_android_internal && !is_official_build) { if (enable_chrome_android_internal && !is_official_build) {
deps = [ deps = [
"//clank/third_party/gvr_shim", "//clank/third_party/gvr_shim",
] ]
} else { } else {
libs = libs +=
[ "//third_party/gvr-android-sdk/libgvr_shim_static_${current_cpu}.a" ] [ "//third_party/gvr-android-sdk/libgvr_shim_static_${current_cpu}.a" ]
if (is_component_build) {
ldflags = [
"-Wl,--whole-archive",
rebase_path(
"//third_party/gvr-android-sdk/libgvr_shim_static_${current_cpu}.a",
root_build_dir),
"-Wl,--no-whole-archive",
]
}
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment