-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Output all headers with LIBC_CONF_OUTPUT_ALL_HEADERS #144114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libc Author: William Huynh (saturn691) ChangesFollowing discussion from https://discourse.llvm.org/t/missing-declarations-in-header-files/86678, we decided to add a flag to output all headers. Requires #144049.
Full diff: https://github.com/llvm/llvm-project/pull/144114.diff 2 Files Affected:
diff --git a/libc/cmake/modules/LLVMLibCHeaderRules.cmake b/libc/cmake/modules/LLVMLibCHeaderRules.cmake
index 99f90244e0134..add58756dfc17 100644
--- a/libc/cmake/modules/LLVMLibCHeaderRules.cmake
+++ b/libc/cmake/modules/LLVMLibCHeaderRules.cmake
@@ -97,8 +97,13 @@ function(add_gen_header target_name)
set(out_file ${LIBC_INCLUDE_DIR}/${relative_path})
set(dep_file "${out_file}.d")
set(yaml_file ${CMAKE_SOURCE_DIR}/${ADD_GEN_HDR_YAML_FILE})
+
+ if(LIBC_CONF_OUTPUT_ALL_HEADERS)
+ set(entry_points "")
+ else()
+ set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}")
+ endif()
- set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}")
list(TRANSFORM entry_points PREPEND "--entry-point=")
add_custom_command(
diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index b0a3a7431c222..c32809da577d4 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -35,7 +35,7 @@ function(add_unittest_framework_library name)
else()
_get_common_test_compile_options(compile_options "" "")
target_compile_options(${name}.unit PRIVATE ${compile_options})
-endif()
+ endif()
_get_hermetic_test_compile_options(compile_options "")
target_include_directories(${name}.hermetic PRIVATE ${LIBC_INCLUDE_DIR})
|
@@ -97,8 +97,13 @@ function(add_gen_header target_name) | |||
set(out_file ${LIBC_INCLUDE_DIR}/${relative_path}) | |||
set(dep_file "${out_file}.d") | |||
set(yaml_file ${CMAKE_SOURCE_DIR}/${ADD_GEN_HDR_YAML_FILE}) | |||
|
|||
if(LIBC_CONF_OUTPUT_ALL_HEADERS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag looks good, but you should add an option
in the cmake to the top level CMakeLists: https://github.com/llvm/llvm-project/blob/main/libc/CMakeLists.txt#L138
Also the CONF
options are intended to come from config.json
, this user-exposed cmake flag can just be LIBC_OUTPUT_ALL_HEADERS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor phrasing suggestion, but otherwise LGTM
Co-authored-by: Michael Jones <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll merge this once the presubmits finish
Fixes a couple of bugs found when building. The PR to enable the headers can be found here: #144114. - math.yaml: float128 guard - wchar.yaml: __restrict keyword order
Fixes a couple of bugs found when building. The PR to enable the headers can be found here: llvm#144114. - math.yaml: float128 guard - wchar.yaml: __restrict keyword order
) Following discussion from https://discourse.llvm.org/t/missing-declarations-in-header-files/86678, we decided to add a flag to output all headers. Requires llvm#144049. - Allows outputting all headers - Minor whitespace change for alignment --------- Co-authored-by: Michael Jones <[email protected]>
Follows from llvm/llvm-project#144114 LLVM-libc doesn't provide all functions, but it is reasonable to expect the signature in the header file, consistent with picolibc. This allows the user to implement it later.
Follows from llvm/llvm-project#144114 LLVM-libc doesn't provide all functions, but it is reasonable to expect the signature in the header file, consistent with picolibc. This allows the user to implement it later.
Follows from llvm/llvm-project#144114 LLVM-libc doesn't provide all functions, but it is reasonable to expect the signature in the header file, consistent with picolibc. This allows the user to implement it later.
Fixes a couple of bugs found when building. The PR to enable the headers can be found here: llvm#144114. - math.yaml: float128 guard - wchar.yaml: __restrict keyword order
) Following discussion from https://discourse.llvm.org/t/missing-declarations-in-header-files/86678, we decided to add a flag to output all headers. Requires llvm#144049. - Allows outputting all headers - Minor whitespace change for alignment --------- Co-authored-by: Michael Jones <[email protected]>
Following discussion from https://discourse.llvm.org/t/missing-declarations-in-header-files/86678, we decided to add a flag to output all headers. Requires #144049.