https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79903
Bug ID: 79903 Summary: When building RTEMS for SPARC with Ada support, the build fails because of missing #ifdef Product: gcc Version: 6.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: ttsiodras at gmail dot com Target Milestone: --- I have just successfully built the latest GCC cross-compiling toolchain for RTEMS/SPARC with Ada support - but to do so, I had to patch the GCC 6.3 source in one place: diff --git a/gcc-6.3.0/gcc/ada/socket.c b/gcc-6.3.0/gcc/ada/socket.c index f5fb663..5cdd656 100644 --- a/gcc-6.3.0/gcc/ada/socket.c +++ b/gcc-6.3.0/gcc/ada/socket.c @@ -202,7 +202,7 @@ __gnat_gethostbyaddr (const char *addr, int len, int type, struct hostent *rh; int ri; -#if defined(__linux__) || defined(__GLIBC__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__) (void) gethostbyaddr_r (addr, len, type, ret, buf, buflen, &rh, h_errnop); #else rh = gethostbyaddr_r (addr, len, type, ret, buf, buflen, h_errnop); Without that patch, the RTEMS RSB build fails - at least for the following version of the RSB: $ # RTEMS Source Builder: commit 4c5eb8969451c4ea0997b3caa98bfe80fe15da69 $ ../source-builder/sb-set-builder --log=sparc2.log --prefix=/opt/rtems-4.12 --without-rtems --with-ada 4.12/rtems-sparc Hope this helps. Kind regards, Thanassis. -- Thanassis Tsiodras Real-time Embedded Software Engineer European Space Agency System, Software and Technology Department