<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">We added some support newlib with NaCl / PNaCl. IIRC we didn’t do anything for long double because it mapped to double on our target, which might be what you want to do in your case.<div class=""><br class=""></div><div class="">However, if you do want to support long double in some form, check out e.g. <a href="http://reviews.llvm.org/D7888" class="">http://reviews.llvm.org/D7888</a>. include/__config is probably where you want to look, and see how other platforms handle types like that.<br class=""><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 2, 2019, at 11:25 AM, Dionna Glaze via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Heya folks, new contributor here. I work at Google on the Asylo project for enclave development. I'm in the process of switching our toolchain over to clang from GCC, and I've found that I have some minor problems doing so with newlib as our libc implementation.<div class=""><br class=""></div><div class="">Mainly, long double math operations are not supported by newlib. In libstdc++, if long double functions weren't defined in libc (#ifndef HAVE_HYPOTL, etc, ...), it'd define them itself. That's not the case in libc++, so I was wondering what y'all thought would be the best course of action.</div><div class=""><br class=""></div><div class="">Mainly, should libc++ act like libstdc++ and define its own long double implementations of math operations, or should it not add the functions to the std:: namespace if they're not available?</div><div class=""><br class=""></div><div class="">If not adding them, then the following headers would guard given declarations within _LIBCPP_HAS_NO_LONG_DOUBLE/#endif:</div><div class=""><br class=""></div><div class="">#include <cmath>:</div><div class="">using ::nexttoward;<br class="">using ::nexttowardf;<br class=""></div><div class=""><br class=""></div><div class="">using ::acosl;<br class="">[...contiguously down to...]</div><div class="">using ::truncl;<br class=""></div><div class=""><br class=""></div><div class="">inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double x, long double y, long double z ) { return sqrt(x*x + y*y + z*z); }<br class=""></div><div class=""><br class=""></div><div class="">#include <cstdlib>:</div><div class="">using ::strtold;<br class=""></div><div class=""><br class=""></div><div class="">#include <locale>:</div><div class="">[...] long double __do_strtod<long double> [...]<br class=""></div><div class=""><br class=""></div><div class="">#include <math.h>:</div><div class="">[...everything that mentions long double in its prototype...]</div><div class=""><br class=""></div><div class="">I can produce a patch quickly if this is an acceptable change to folks.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">-Dionna Glaze, PhD (she/her)</div></div>
_______________________________________________<br class="">libcxx-dev mailing list<br class=""><a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev<br class=""></div></blockquote></div><br class=""></div></body></html>