On Mon, 29 Jul 2024 at 19:07, Sven Bieg via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > cmath doesn't compile in freestanding mode, please explain me why or fix it! Because in C++23 (and earlier standards) none of the contents of <cmath> are required for a freestanding environment. Practically, the reason is that most of <cmath> requires libm, which is part of a hosted implementation and not present for freestanding. C++26 will add the overloads of std::abs as required by https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2338r4.html but we don't support that in GCC yet. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109814 tracks this.