[all-commits] [llvm/llvm-project] 779714: [profile] Only use NT_GNU_BUILD_ID if supported

rorth via All-commits all-commits at lists.llvm.org
Fri Aug 6 05:04:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 779714f89bef33f153841b7ec969578ee22b3694
      https://github.com/llvm/llvm-project/commit/779714f89bef33f153841b7ec969578ee22b3694
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2021-08-06 (Fri, 06 Aug 2021)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingPlatformLinux.c

  Log Message:
  -----------
  [profile] Only use NT_GNU_BUILD_ID if supported

The Solaris buildbots have been broken for some time by the unconditional
use of `NT_GNU_BUILD_ID`, e.g. Solaris/sparcv9
<https://lab.llvm.org/staging/#/builders/50/builds/4910> and Solaris/amd64
<https://lab.llvm.org/staging/#/builders/101/builds/3751>.  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 making the relevant code conditional on the
definition of `NT_GNU_BUILD_ID`.

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

Differential Revision: https://reviews.llvm.org/D107556




More information about the All-commits mailing list