Skip to content

Conversation

@statham-arm
Copy link
Collaborator

complex.yaml declares types cfloat16, cfloat128 and float128 in its 'types' section, causing the output complex.h to #include three headers with names of the form "llvm-libc-types/cfloat16.h". But include/CMakeLists.txt doesn't mention those types as dependencies in the add_header_macro call for complex.h. As a result, cfloat16.h and cfloat128.h are not installed by the 'install' target, but complex.h still tries to to include them.

The third type header, float128.h, doesn't have this problem because the add_header_macro math.h does mention it as a dependency. So I've added all three headers as dependencies in complex.h, following the same pattern, and now the install target installs the missing two headers.

complex.yaml declares types cfloat16, cfloat128 and float128 in its
'types' section, causing the output complex.h to #include three
headers with names of the form "llvm-libc-types/cfloat16.h". But
include/CMakeLists.txt doesn't mention those types as dependencies in
the `add_header_macro` call for complex.h. As a result, cfloat16.h and
cfloat128.h are not installed by the 'install' target, but complex.h
still tries to to include them.

The third type header, float128.h, doesn't have this problem because
the `add_header_macro` math.h does mention it as a dependency. So I've
added all three headers as dependencies in complex.h, following the
same pattern, and now the install target installs the missing two
headers.
@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-libc

Author: Simon Tatham (statham-arm)

Changes

complex.yaml declares types cfloat16, cfloat128 and float128 in its 'types' section, causing the output complex.h to #include three headers with names of the form "llvm-libc-types/cfloat16.h". But include/CMakeLists.txt doesn't mention those types as dependencies in the add_header_macro call for complex.h. As a result, cfloat16.h and cfloat128.h are not installed by the 'install' target, but complex.h still tries to to include them.

The third type header, float128.h, doesn't have this problem because the add_header_macro math.h does mention it as a dependency. So I've added all three headers as dependencies in complex.h, following the same pattern, and now the install target installs the missing two headers.


Full diff: https://github.com/llvm/llvm-project/pull/164422.diff

1 Files Affected:

  • (modified) libc/include/CMakeLists.txt (+3)
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 81360aac984e0..a5c18785ef891 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -218,6 +218,9 @@ add_header_macro(
   DEPENDS
     .llvm_libc_common_h
     .llvm-libc-macros.complex_macros
+    .llvm-libc-types.float128
+    .llvm-libc-types.cfloat128
+    .llvm-libc-types.cfloat16
 )
 
 add_header_macro(

@statham-arm statham-arm merged commit 48a99ad into llvm:main Oct 21, 2025
22 checks passed
@statham-arm statham-arm deleted the libc-cfloat16-cfloat128-deps branch October 21, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants