[all-commits] [llvm/llvm-project] d988b3: [clang][Driver] Include stdc-predef.h by default o...

Jonathan Thackray via All-commits all-commits at lists.llvm.org
Tue Jun 16 03:13:00 PDT 2026


  Branch: refs/heads/users/jthackray/resurrect_stdc-predef_h_patch
  Home:   https://github.com/llvm/llvm-project
  Commit: d988b381e3461880d5b3b62b524d0de3aea75291
      https://github.com/llvm/llvm-project/commit/d988b381e3461880d5b3b62b524d0de3aea75291
  Author: Jonathan Thackray <jonathan.thackray at arm.com>
  Date:   2026-06-15 (Mon, 15 Jun 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Driver/ToolChains/Linux.cpp
    A clang/test/Driver/Inputs/stdc-predef/preprocessed.i
    A clang/test/Driver/Inputs/stdc-predef/usr/include/stdc-predef.h
    A clang/test/Driver/stdc-predef.c

  Log Message:
  -----------
  [clang][Driver] Include stdc-predef.h by default on musl

Match GCC behavior for musl-based Linux targets by implicitly passing
`-include stdc-predef.h` for non-freestanding compilations.

Unlike glibc, musl does not arrange for this header to be included through
its normal system headers. As a result, Clang may miss predefined C macros
provided by musl's stdc-predef.h unless users include it manually, while the
same code works with GCC.

Add Driver tests covering musl, non-musl, freestanding, preprocessed input,
missing-header diagnostics, and actual macro visibility.

This patch is based on: https://reviews.llvm.org/D137043 and
slightly tweaks it, as the code has drifted since 2023 when
that was authored.

Co-authored-by: Tao Liang <Origami404 at foxmail.com>
Co-authored-by: YingChi Long <me at inclyc.cn>


  Commit: 2fd832d0115539f7e31b4a7779b0bfbe52b45c00
      https://github.com/llvm/llvm-project/commit/2fd832d0115539f7e31b4a7779b0bfbe52b45c00
  Author: Jonathan Thackray <jonathan.thackray at arm.com>
  Date:   2026-06-16 (Tue, 16 Jun 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/test/Driver/stdc-predef.c

  Log Message:
  -----------
  fixup! Address PR comments


Compare: https://github.com/llvm/llvm-project/compare/c08d5cd16f17...2fd832d01155

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