This is an archive of the discontinued LLVM Phabricator instance.

[profile] Only use NT_GNU_BUILD_ID if supported
ClosedPublic

Authored by ro on Aug 5 2021, 4:50 AM.

Details

Summary

The Solaris buildbots have been broken for some time by the unconditional use of
NT_GNU_BUILD_ID, e.g. Solaris/sparcv9 and Solaris/amd64. Being a GNU extension, it is not defined in <sys/elf.h>. However,
providing a fallback definition doesn't help because the code also relies on __ehdr_start,
another unportable GNU extension that most likely never will be implemented in
Solaris ld. Besides, there's reallly no point in supporting build ids since they aren't used
on Solaris at all.

This patch fixes this by make the relevant code conditional on the definition of
NT_GNU_BUILD_ID.

Tested on amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

Diff Detail

Event Timeline

ro created this revision.Aug 5 2021, 4:50 AM
ro requested review of this revision.Aug 5 2021, 4:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2021, 4:50 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
gulfem added inline comments.Aug 5 2021, 10:57 AM
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
192

Thanks for the fix! Could you please add the comment here like the simplified version of your commit message?

gulfem accepted this revision.Aug 5 2021, 10:57 AM
This revision is now accepted and ready to land.Aug 5 2021, 10:57 AM
ro updated this revision to Diff 364745.Aug 6 2021, 5:03 AM

Add comment.

ro marked an inline comment as done.Aug 6 2021, 5:03 AM
ro added inline comments.
compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
192

Sure, will commit as updated. Thanks.

This revision was landed with ongoing or failed builds.Aug 6 2021, 5:04 AM
This revision was automatically updated to reflect the committed changes.
ro marked an inline comment as done.