[libcxx-commits] [PATCH] D134938: [libc++] Add option to disable long double math support in libc++

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 1 04:38:36 PDT 2022


philnik added a comment.

In D134938#3827170 <https://reviews.llvm.org/D134938#3827170>, @michaelplatings wrote:

> Hi Nikolas, thanks for the quick response.
>
> The errors look like:
>
>   include/c++/v1/math.h:794:93: error: no member named 'acosl' in the global namespace
>   inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
>                                                                                             ~~^
>
> I've added a runner as you suggested and updated the tests accordingly.

Ok, this looks like it could be fixed another way. I'm currently working on a patch that uses builtins for all the functions in `math.h`. That should fix the immediate error you see and allow you to use the functions during constant evaluation (once that's implemented). The only thing that would change is that you might get a linker error instead of a compile time error when you try to pass a `long double` to the functions. You probably shouldn't use `long double`s at all when using a libc that doesn't support it though, so I guess it should be fine. This approach would result in a lot fewer `#ifndef`s and would remove the need for testing another configuration. I'll try to upload the patch in the next few days.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134938/new/

https://reviews.llvm.org/D134938



More information about the libcxx-commits mailing list