DescriptionStatically link libprotobuf_lite on Linux component builds
Chrome has a direct dependency on a custom libprotobuf_lite in
third_party, but Xenial and Yakkety add a dependency on the system
libprotobuf-lite via Mir (which gets loaded from Gtk).
Our third_party protobuf is not compatible with the upstream protobuf.
Combine this with the fact that Xenial uses version 2 while Yakkety
uses version 3, and it's basically impossible to make our third_party
protobuf cooperate with the system one. The solution is to always
statically link protobuf on Linux.
This alone, however, is not enough to fix the issue on component
builds. If components A and B both have private copies of
libprotobuf_lite, they have their own sets of globals. A problematic
global is "std::string* google::protobuf::internal::empty_string_".
Protobuf does pointer comparison against this string to determine if
strings are empty. This is problematic when data is passed from
component A to B, each of which have an empty_string_ at a different
address.
This CL also extracts these types of globals into their own shared
library so they can be shared among Chromium components. It also
adds a 'cr_' prefix to them so they cannot conflict with the system
protobuf.
This change only affects desktop Linux component builds. Release
binaries and debug binaries on other platforms should be unaffected.
Finally, this CL is a hack, and it should be reverted when a
longer-term solution is implemented.
BUG=79722, 700120
R=pkasting@chromium.org
TBR=bengr@chromium.org
CC=dpranke@chromium.org,rsimha@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_dbg_ng;master.tryserver.chromium.mac:mac_chromium_dbg_ng;master.tryserver.chromium.win:win_chromium_dbg_ng
patch from issue 2746493002 at patchset 260001 (http://crrev.com/2746493002#ps260001)
Review-Url: https://codereview.chromium.org/2756543002
Cr-Commit-Position: refs/heads/master@{#458016}
Committed: https://chromium.googlesource.com/chromium/src/+/77bec4dfd9e172a99543b9bfe9daf2580721bfdd
Patch Set 1 #
Total comments: 4
Patch Set 2 : Extract all global data to globals.cc #Messages
Total messages: 48 (41 generated)
|