Re: Ada Broken with h_errno change
* Joel Sherrill <[EMAIL PROTECTED]>, 2005-11-16 : > RTEMS has networking functions but they are not available at this stage > during the build. I am not sure I understand how this can happen (I am not familiar at all with the RTEMS build process). If the network functions are available on RTEMS, isn't it the case that corresponding header files should be present as well? If so why aren't they available when you build the Ada runtime library? If not how are these functions made available to applications? > this patch is needed to make *-rtems compile again. OK to commit? I'd first like to understand what exactly the situation is. -- Thomas Quinot, Ph.D. ** [EMAIL PROTECTED] ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA
Re: Ada Broken with h_errno change
* Joel Sherrill <[EMAIL PROTECTED]>, 2005-11-17 : > I hope the explanation above helps make it clearer. Yes, thanks for the clarification. In light of this explanation the proposed fix seems appropriate; maybe a comment could be added along with the extern declaration to note that it is necessary because of the way the bootstrap procedure is organized. -- Thomas Quinot, Ph.D. ** [EMAIL PROTECTED] ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA
Re: Ada Broken with h_errno change
* Joel Sherrill <[EMAIL PROTECTED]>, 2005-11-21 : > How about this? Can I commit it? Looks good, please go ahead. Thanks! Thomas. -- Thomas Quinot, Ph.D. ** [EMAIL PROTECTED] ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA
Re: g-socket.adb error
* Laurent GUERBY, 2009-07-04 : > > Apparently no one has hit this case. RTEMS does > > not have two error codes that g-socket.adb > > maps back. From s-oscons.ads: > > > >ESHUTDOWN : constant := -1; -- Cannot send once > > shutdown > >ESOCKTNOSUPPORT : constant := -1; -- Socket type not > > supported > > > > This results in a compilation error in g-socket.adb > > in the switch since they both have the same value: > > > > g-socket.adb:1775:15: duplication of choice value at line 1773 I really wonder how nobody stumbled on this in the past since this code has been essentially untouched for a very long time. Is it really the case that both ESHUTDOWN and ESOCKTNOSUPPORT are undefined in RTEMS (as in, has this been checked manually in errno.h, and can't proper definitions be given there???) > Just above the case there is already one case of duplicate > error code handled by an explicit "if" instead of "case": > > if EAGAIN /= EWOULDBLOCK and then Error_Value = EAGAIN then > return Resource_Temporarily_Unavailable; > end if; > > I guess moving from case to if would be an appropriate way to fix > this RTEMS issue (assuming this is the only conflict), Thomas is in Cc. I'm not very happy with this proposal, since the chain of IF statements would be much less efficient than the CASE (which currently generates an indexed jump). What we could do would be to build an array mapping errno to Error_Type values at initialization time, and then index that array (however that means we'd have to know the maximum range of errnos). Or alternatively we could assign distinct junk invalid values to ESHUTDOWN and ESOCKNOTSUPPORT in s-oscons-tmplt.c (eg -1 and -2, instead of -1 for both). Thomas. -- Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA
Re: g-socket.adb error
* Joel Sherrill, 2009-07-06 : > It got tripped because newlib-cvs has been reworked and > a number of errno's conditionalized as Linux specific. I was > enabling the ones which were also used by RTEMS via > the BSD TCP/IP stack. > > Some were not used by RTEMS so I left them turned off. OK, understood, so my advice would be to resurrect in newlib those errno values that are known by g-socket so that they have distinct values. Thomas. -- Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA
Re: s-oscons technique does not work for RTEMS
* Arnaud Charlet, 2008-08-07 : > > As I warned in http://gcc.gnu.org/ml/gcc/2008-07/msg00387.html, > > the new technique for generating s-oscons.ads does not work > > for RTEMS. The OS .h files are not available when the compiler > > is built -- only those strictly owned by the newlib C library. > > > > As indicated by this from the build log, you have neither > > termios nor network .h files available when the compiler > > is built. > > Then what I'd suggest is that you first build a C (or C and C++) > compiler, build newlib and co, install the system, and then > from there, redo a build with Ada enabled. > > That's I believe how such bootstrap issue is resolved in general. As an alternative to Arno's suggestion, maybe you could use the --with-sysroot configure parameter to make the required headers available to the build process. I know others have used this method on some cross targets. Thomas. -- Thomas Quinot, Ph.D. ** [EMAIL PROTECTED] ** Senior Software Engineer AdaCore -- Paris, France -- New York, USA