<div dir="ltr">Thanks, I've gone ahead and made <a href="https://reviews.llvm.org/D64105">https://reviews.llvm.org/D64105</a> since sizeof(long double) != sizeof(double) for our platform and I don't have software implementations of long double math operations to contribute.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 2, 2019 at 1:26 PM JF Bastien <<a href="mailto:jfbastien@apple.com" target="_blank">jfbastien@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>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><br></div><div>However, if you do want to support long double in some form, check out e.g. <a href="http://reviews.llvm.org/D7888" target="_blank">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><div><br></div><div><br><blockquote type="cite"><div>On Jul 2, 2019, at 11:25 AM, Dionna Glaze via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="gmail-m_8546965453617776879gmail-m_-1060852942032596369Apple-interchange-newline"><div><div dir="ltr">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><br></div><div>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><br></div><div>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><br></div><div>If not adding them, then the following headers would guard given declarations within _LIBCPP_HAS_NO_LONG_DOUBLE/#endif:</div><div><br></div><div>#include <cmath>:</div><div>using ::nexttoward;<br>using ::nexttowardf;<br></div><div><br></div><div>using ::acosl;<br>[...contiguously down to...]</div><div>using ::truncl;<br></div><div><br></div><div>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></div><div><br></div><div>#include <cstdlib>:</div><div>using ::strtold;<br></div><div><br></div><div>#include <locale>:</div><div>[...] long double __do_strtod<long double> [...]<br></div><div><br></div><div>#include <math.h>:</div><div>[...everything that mentions long double in its prototype...]</div><div><br></div><div>I can produce a patch quickly if this is an acceptable change to folks.</div><div><br></div><div>Regards,</div><div>-Dionna Glaze, PhD (she/her)</div></div>
_______________________________________________<br>libcxx-dev mailing list<br><a href="mailto:libcxx-dev@lists.llvm.org" target="_blank">libcxx-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br></div></blockquote></div><br></div></div></blockquote></div>