[llvm-dev] LLD's default --build-id choice

Ed Maste via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 2 07:51:50 PDT 2016


On 1 June 2016 at 19:57, Joerg Sonnenberger via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> On Wed, Jun 01, 2016 at 03:21:08PM -0700, Rui Ueyama via llvm-dev wrote:
> > In the first place, I believe it was not a good decision to make GCC (and
> > therefore Clang) to pass --build-id option to the linker by default (it was
> > done in 2009 <https://lists.debian.org/debian-gcc/2009/07/msg00082.html>).
> > Build ID is sometimes useful, particularly when distributing linked objects
> > to users, but in most cases it is not needed. Spending 10% more time on
> > usual build-link-debug cycle is a waste of time. It should not have been
> > added that casually.
>
> I fully agree on this (not passing it down by default automatically),
> since it doesn't create a very useful key.

I agree that it probably doesn't provide enough benefit in a usual
edit-compile-test development cycle to justify a slowdown.

build-id has two main use cases for debugging:
- make core dumps self-identifying (so you can just run "lldb
foo.core" and load foo automatically)
- avoid checksumming the whole file when loading standalone debug files
In the case of released, prebuilt software (i.e., distribution
packages) I'd argue that build-id does in fact create a useful key.

That said, rather than having the default built into the compiler, a
distribution or OS package build infrastructure should just pass in
the --build-id option through CFLAGS somehow.


More information about the llvm-dev mailing list