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

Tom Stellard via All-commits all-commits at lists.llvm.org
Wed Aug 18 12:55:40 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 98feb20df14e6cf9ce77f097ceb8dd188c9070a7
      https://github.com/llvm/llvm-project/commit/98feb20df14e6cf9ce77f097ceb8dd188c9070a7
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2021-08-18 (Wed, 18 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

(cherry picked from commit 779714f89bef33f153841b7ec969578ee22b3694)




More information about the All-commits mailing list