Add NewLib support (#60345)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60345
Add support for NewLib, an embedded libc variant by re-using existing Android library stubs plus few NewLib specific guards
Problem:
Newlib is a C standard library intended for embedded use, similarly to how Android uses bionic. This causes some incompatibility with the math functions that are present in glibc but not Newlib (and some versions bionic) and makes porting PyTorch to environments such as SGX hard.
Solution:
Subscribed Newlib to the same fixes present for older versions of Android and add fixes specific for Newlib
Test Plan: Run the PyTorch tests.
Reviewed By: malfet
Differential Revision: D29022623
fbshipit-source-id: 028dd7ff9b3ee394371c275642c90c9ef108e639