| Summary: | [CMake] Use ld.lld by default for development builds where available | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> | ||||||
| Component: | CMake | Assignee: | Adrian Perez <aperez> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | annulen, aperez, bugs-noreply, cgarcia, darin, don.olmstead, ews-watchlist, gyuyoung.kim, mcatanzaro, mrobinson, pgriffis, ross.kirsling, ryuan.choi, sergio | ||||||
| Priority: | P2 | ||||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=236362 https://bugs.webkit.org/show_bug.cgi?id=236506 |
||||||||
| Bug Depends on: | 235476, 235975 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Adrian Perez
2022-02-01 15:03:33 PST
For the record, I did some numbers while checking the Mold linker, you can read here: https://bugs.webkit.org/show_bug.cgi?id=236362#c7 The TL;DR is that LLD is about 4.00x faster than the BFD linker, and even slightly faster (1.12x) than Gold. Created attachment 451527 [details]
Patch
Comment on attachment 451527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451527&action=review > Source/cmake/OptionsCommon.cmake:30 > + if (CMAKE_BUILD_TYPE STREQUAL Debug) What makes debug builds special? I guess you cannot enable it for RelWithDebInfo builds because it doesn't support LTO and that would risk trouble with distro builds... but this still seems weird to distinguish between RelWithDebInfo and Debug like this. Maybe it would make more sense to check for DEVELOPER_MODE instead? (In reply to Michael Catanzaro from comment #3) > Comment on attachment 451527 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=451527&action=review > > > Source/cmake/OptionsCommon.cmake:30 > > + if (CMAKE_BUILD_TYPE STREQUAL Debug) > > What makes debug builds special? I guess you cannot enable it for > RelWithDebInfo builds because it doesn't support LTO and that would risk > trouble with distro builds... but this still seems weird to distinguish > between RelWithDebInfo and Debug like this. Maybe it would make more sense > to check for DEVELOPER_MODE instead? The LLD linker can do LTO just fine, I routinely do Clang+LLD builds here. I was trying to think of speeding up the workflow of developers working on WebKit because every minute counts there, but a few minutes more in a build for distro package don't matter as much. You are right and indeed checking for DEVELOPER_MODE makes more sense for what I am trying to do here — a developer using “build-webkit --release” will also want a faster edit-compile-test cycle! (In reply to Adrian Perez from comment #4) > The LLD linker can do LTO just fine, I routinely do Clang+LLD builds here. Sorry, I confused it with mold. So many linkers. Comment on attachment 451527 [details]
Patch
Seems we agree to check DEVELOPER_MODE instead.
Created attachment 451582 [details]
Patch v2
Committed r289611 (247124@main): <https://commits.webkit.org/247124@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451582 [details]. |