https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86377
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- NEED_DECLARATION_ERRNO should not be defined for most targets/hosts. You need to figure out why it is being defined here. Look at config.log to figure that out.