Skip to content

Clang generates the fake /usr/include/tgmath.h dependency #120891

@hjl-tools

Description

@hjl-tools

On Linux, the fake /usr/include/tgmath.h dependency is generated by clang even though
clang never reads /usr/include/tgmath.h:

[hjl@gnu-tgl-3 tmp]$ cat f.c
#include <tgmath.h>
[hjl@gnu-tgl-3 tmp]$ clang -M -c f.c
f.o: f.c /usr/bin/../lib/clang/19/include/tgmath.h /usr/include/math.h \
  /usr/include/bits/libc-header-start.h /usr/include/features.h \
  /usr/include/features-time64.h /usr/include/bits/wordsize.h \
  /usr/include/bits/timesize.h /usr/include/stdc-predef.h \
  /usr/include/sys/cdefs.h /usr/include/bits/long-double.h \
  /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
  /usr/include/bits/time64.h /usr/include/bits/math-vector.h \
  /usr/include/bits/libm-simd-decl-stubs.h /usr/include/bits/floatn.h \
  /usr/include/bits/floatn-common.h /usr/include/bits/flt-eval-method.h \
  /usr/include/bits/fp-logb.h /usr/include/bits/fp-fast.h \
  /usr/include/bits/mathcalls-helper-functions.h \
  /usr/include/bits/mathcalls.h /usr/include/complex.h \
  /usr/include/bits/mathdef.h /usr/include/bits/cmathcalls.h
[hjl@gnu-tgl-3 tmp]$ ls /usr/include/tgmath.h*
/usr/include/tgmath.h.saved
[hjl@gnu-tgl-3 tmp]$ clang -M -c f.c
f.o: f.c /usr/bin/../lib/clang/19/include/tgmath.h /usr/include/math.h \
  /usr/include/bits/libc-header-start.h /usr/include/features.h \
  /usr/include/features-time64.h /usr/include/bits/wordsize.h \
  /usr/include/bits/timesize.h /usr/include/stdc-predef.h \
  /usr/include/sys/cdefs.h /usr/include/bits/long-double.h \
  /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
  /usr/include/bits/types.h /usr/include/bits/typesizes.h \
  /usr/include/bits/time64.h /usr/include/bits/math-vector.h \
  /usr/include/bits/libm-simd-decl-stubs.h /usr/include/bits/floatn.h \
  /usr/include/bits/floatn-common.h /usr/include/bits/flt-eval-method.h \
  /usr/include/bits/fp-logb.h /usr/include/bits/fp-fast.h \
  /usr/include/bits/mathcalls-helper-functions.h \
  /usr/include/bits/mathcalls.h /usr/include/complex.h \
  /usr/include/bits/mathdef.h /usr/include/bits/cmathcalls.h
[hjl@gnu-tgl-3 tmp]$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"clang:headersHeaders provided by Clang, e.g. for intrinsics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions