It would probably make sense to add the following block to include/__config and clean up all the duplication.
#ifndef ELAST
#if defined(__linux__)
#define ELAST 4095
#elif defined(_NEWLIB_VERSION) && defined(__ELASTERROR)
#define ELAST __ELASTERROR
#endif
#endif
http://reviews.llvm.org/D5079