[all-commits] [llvm/llvm-project] b8cc84: [bazel] Correct config.h definitions for musl (#20...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Wed Jul 8 14:14:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b8cc84591b6a9b314b1e486b0db643f9f399cf90
      https://github.com/llvm/llvm-project/commit/b8cc84591b6a9b314b1e486b0db643f9f399cf90
  Author: Reid Kleckner <rkleckner at nvidia.com>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M utils/bazel/llvm-project-overlay/llvm/config.bzl

  Log Message:
  -----------
  [bazel] Correct config.h definitions for musl (#207295)

The Bazel overlay encodes several configure-time config.h results
manually. It currently treats all Linux platforms as having
execinfo.h/backtrace() and mallinfo(). That matches glibc, but is false
when the build is configured for musl libc.

The upstream .bazelrc provides --config=hermetic-toolchain. A musl build
can be selected by pairing that with the platform labels from the
external Bazel module named llvm, for example:

  bazel build --config=hermetic-toolchain \
    --platforms=@llvm//platforms:linux_x86_64_musl \
    --extra_execution_platforms=@llvm//toolchain:linux_x86_64_platform \
    @llvm-project//llvm:not

Only define HAVE_BACKTRACE/BACKTRACE_HEADER when not targeting musl, and
only define HAVE_MALLINFO for GNU libc. With the old definitions, this
fails in LLVM Support, e.g.:

Unix/Process.inc:95:19: error: variable has incomplete type 'struct
mallinfo'
  Unix/Signals.inc:51:10: fatal error: 'execinfo.h' file not found

Drafted with LLM assistance.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list