This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to debug what I am doing wrong?


> Um, stupid question.  How does the build ID get set?  I'm using
> make-kpkg, which I didn't think knew how to set the build ID.  (I have
> some vague memory of a magic flag to the linker, or some
> post-processing via some elfutils tool?)

ld generates a build ID when given the --build-id option.
The kernel makefiles pass it by default when it's supported.
Sometimes gcc's default ld run for normal executables/DSOs
passes --build-id too (Fedora's gcc does since F8).

When a final link (or a "quasi-final" -r link for a .ko) is done without
generating a build ID at that time, one is never added in later.

There has not yet been any elfutils tool that generates or changes build IDs.

The rpmbuild magic scripts that do separate debuginfo splitting also
(first) use an rpmbuild tool (/usr/lib/rpm/debugedit) that edits the
DWARF information.  (It rewrites the source directory names from the
package build directory into the installed locations in /usr/src/debug
where the -debuginfo rpm will install copies of all the referenced
source files.)  This tool now also regenerates the build ID based on the
editted binary's contents.  Doing this ensures that two rpmbuild runs
that generate completely identical binaries and .debug files but use
different _builddir settings reproduce the identical build IDs in the
identical binaries.  (In some buildsystems that directory name is
different every time.)

If a packaging system is not editting the binaries after they are linked
(aside from strip-to-debug), or is not concerned with 100% reproducible
builds (identical binaries from identical constituents), then it never
has any reason to meddle with the build ID bits.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]