FS#58072 - [chromium] Disable build-id creation during linking

Attached to Project: Arch Linux
Opened by xsmile (xsmile) - Monday, 02 April 2018, 14:20 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 03 April 2018, 05:02 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The GN build flag 'is_official_build' causes the linker to create a build ID using SHA1 which slows down the linking process.

Relevant part in build/config/compiler/BUILD.gn [1]:
if (is_official_build) {
# 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.
ldflags += [ "-Wl,--build-id=sha1" ]
}

As the crash infrastructure is not utilized, the build ID can be omitted to speed up linking.

Additional info:
* package version: chromium 65.0.3325.181-5

Steps to reproduce:
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -316,7 +316,7 @@ config("compiler") {
}
}

- if (is_official_build) {
+ if (false) {
# 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

1: https://chromium.googlesource.com/chromium/src/+/65.0.3325.181/build/config/compiler/BUILD.gn#317
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Tuesday, 03 April 2018, 05:02 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Build id computation appears to take less than a second.
Comment by Evangelos Foutras (foutrelis) - Monday, 02 April 2018, 18:54 GMT
I am measuring about 0.25% (~600ms on my old 1090T CPU) increase in the time needed to link the main chrome binary (with jumbo enabled and purged thinlto cache).

It's really not worth the effort to remove --build-id even if it's of no use currently.
Comment by xsmile (xsmile) - Monday, 02 April 2018, 20:04 GMT
I had the impression that the difference was greater, didn't do any benchmark though.

Thanks for the tests.
Comment by Evangelos Foutras (foutrelis) - Tuesday, 03 April 2018, 05:01 GMT
A quick look at LLD's sources confirms that the build id is simply "a hash of all sections of the output file" (which also appears to be computed in parallel over 1 MiB chunks).

Cheers for looking out though. :)

Loading...