Commit 25261375 authored by Mike Wittman's avatar Mike Wittman Committed by Commit Bot

Use --build-id link flag in unofficial builds

The sampling profiler expects build ids to be present in Chrome's
modules. Enabling in unofficial builds permits testing its behavior on
the commit queue.

Bug: 870919
Change-Id: I08c69070155ff572a63fc1e1f8959e6c308a8569
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236753Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Mike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776312}
parent 04190d84
......@@ -121,9 +121,6 @@ declare_args() {
thin_lto_enable_optimizations =
(is_chromeos || is_android || is_win) && is_official_build
# By default only the binaries in official builds get build IDs.
force_local_build_id = false
# Initialize all local variables with a pattern. This flag will fill
# uninitialized floating-point types (and 32-bit pointers) with 0xFF and the
# rest with 0xAA. This makes behavior of uninitialized memory bugs consistent,
......@@ -332,14 +329,16 @@ config("compiler") {
}
}
if (is_official_build || force_local_build_id) {
# Explicitly pass --build-id to ld. Compilers used to always pass this
# implicitly but don't any more (in particular clang when built without
# ENABLE_LINKER_BUILD_ID=ON). The crash infrastructure does need a build
# id, so explicitly enable it in official builds. It's not needed in
# unofficial builds and computing it does slow down the link, so go with
# faster links in unofficial builds.
# Explicitly pass --build-id to ld. Compilers used to always pass this
# implicitly but don't any more (in particular clang when built without
# ENABLE_LINKER_BUILD_ID=ON).
if (is_official_build) {
# The sha1 build id has lower risk of collision but is more expensive to
# compute, so only use it in the official build to avoid slowing down
# links.
ldflags += [ "-Wl,--build-id=sha1" ]
} else {
ldflags += [ "-Wl,--build-id" ]
}
if (!is_android) {
......
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