This is an archive of the discontinued LLVM Phabricator instance.

WIP: [clang] customizable build-id style
AbandonedPublic

Authored by kwk on Nov 16 2021, 6:21 AM.

Details

Reviewers
tbaeder
tstellar
Summary

This is work in progress. I'm evaluating the patch now.

This change introduces the possibility to specify a style of build-id
generation that must be one of "md5", "sha1", "fast", "uuid", or
"0x<hexstring>". To set this style, one can set
DEFAULT_LINKER_BUILD_ID_STYLE. Setting the style will automatically
turn ON ENABLE_LINKER_BUILD_ID.

The effect is that invocations of the compiler will link with
--build-id=<style> by default, where <style> must be one of the
above.

Background:

Currently you can have clang invoke the linker (e.g. ld or lld)
automatically with --build-id when the CMake boolean option
ENABLE_LINKER_BUILD_ID is set to ON.

There's currently no way to specify what type of build-id generation
algorithm (e.g. md5, sha1, uuuid, fast) to choose by default. In [1]
we can see that the default build-id generation algorithm being
choosen is not large enough to because of overlaps with other build
ids.

An upstream bug for not choosing a different build-id generation
algorithm by default is shown in [2].

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2023666
[2]: https://bugs.llvm.org/show_bug.cgi?id=44138

Diff Detail

Event Timeline

kwk created this revision.Nov 16 2021, 6:21 AM
kwk requested review of this revision.Nov 16 2021, 6:21 AM
kwk updated this revision to Diff 387606.Nov 16 2021, 6:36 AM
kwk edited the summary of this revision. (Show Details)

Renamed: ENABLE_LINKER_BUILD_ID_STYLE to DEFAULT_LINKER_BUILD_ID_STYLE.
Fixed issues with CMake (not done yet)

kwk updated this revision to Diff 387608.Nov 16 2021, 6:43 AM

Use correct CMake variable type: BOOLEAN -> BOOL

kwk updated this revision to Diff 387610.Nov 16 2021, 6:44 AM
kwk updated this revision to Diff 387650.Nov 16 2021, 8:13 AM

enabled DEFAULT_LINKER_BUILD_ID_STYLE in linux

kwk abandoned this revision.Jan 13 2022, 8:01 AM