Skip to content

[libc++] Remove libc++'s <float.h> (backport of llvm/llvm-project#175849) - #148

Open
bdeitte wants to merge 2 commits into
ClickHouse:ClickHouse/release-22.xfrom
bdeitte:ClickHouse/remove-libcxx-float-h
Open

bdeitte wants to merge 2 commits into
ClickHouse:ClickHouse/release-22.xfrom
bdeitte:ClickHouse/remove-libcxx-float-h

Conversation

@bdeitte

@bdeitte bdeitte commented Oct 31, 2026 •

Copy link
Copy Markdown

Backport of llvm#175849, cherry-picked with -x without conflicts. The branch starts at daf4510ca312, the commit ClickHouse master pins, so the ClickHouse submodule bump contains only this change. It merges into ClickHouse/release-22.x without conflicts.

According to the upstream PR, the only loss is FLT_EVAL_METHOD and DECIMAL_DIG in C++03 mode, which ClickHouse does not use.

With this commit as the submodule pin, the full ClickHouse clickhouse target builds natively on macOS 27 (arm64, Homebrew Clang 22.1.8) against MacOSX27.0.sdk.

The paired ClickHouse submodule bump is ClickHouse/ClickHouse#128398.

Related: ClickHouse/ClickHouse#127601

The existence of <float.h> in libc++ leads to difficulties with modules,
especially when it comes to supporting the various __need macros
supported by the Clang builtin headers.

Fortunately, libc++'s <float.h> only defines FLT_EVAL_METHOD and
DECIMAL_DIG, which are already defined by the Clang builtin headers in
C++11 mode. Hence, removing the header entirely should have no impact,
apart from not defining FLT_EVAL_METHOD and DECIMAL_DIG in C++03 mode.
However, that is arguably something that libc++ shouldn't be doing: if
the underlying C library doesn't want to provide these definitions, then
libc++ shouldn't force it to.

(cherry picked from commit 501645c)
@CLAassistant

CLAassistant commented Oct 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ bdeitte
❌ ian-twilightcoder
You have signed the CLA already but the status is still pending? Let us recheck it.

@bdeitte bdeitte changed the title [libc++] Remove libc++'s <float.h> (backport of #175849) [libc++] Remove libc++'s <float.h> (backport of llvm/llvm-project#175849) Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants