public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Ada Broken with h_errno change
@ 2005-11-16 20:49 Joel Sherrill <joel@OARcorp.com>
  2005-11-17  8:44 ` Arnaud Charlet
  2005-11-17 22:32 ` Thomas Quinot
  0 siblings, 2 replies; 8+ messages in thread
From: Joel Sherrill <joel@OARcorp.com> @ 2005-11-16 20:49 UTC (permalink / raw)
  To: gcc, Thomas Quinot



As of this morning, Ada no longer compiles for *-rtems.
I think this change broke it.

2005-11-14 Thomas Quinot  <quinot@adacore.com>

  * socket.c (__gnat_get_h_errno): New function to retrieve h_errno, the
    hosts database last error code.

RTEMS has networking functions but they are not available at this stage
during the build.  You only have the .h files provided with newlib.  So
this patch is needed to make *-rtems compile again.  OK to commit?


Index: gcc/ada/socket.c
===================================================================
--- gcc/ada/socket.c    (revision 107093)
+++ gcc/ada/socket.c    (working copy)
@@ -190,6 +190,10 @@
  #elif defined(VMS)
    return errno;
  #else
+#if defined(__rtems__)
+  /* No networking .h files are available from newlib so extern this. */
+  extern int h_errno;
+#endif
    return h_errno;
  #endif
  }




-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-16 20:49 Ada Broken with h_errno change Joel Sherrill <joel@OARcorp.com>
@ 2005-11-17  8:44 ` Arnaud Charlet
  2005-11-17 22:32 ` Thomas Quinot
  1 sibling, 0 replies; 8+ messages in thread
From: Arnaud Charlet @ 2005-11-17  8:44 UTC (permalink / raw)
  To: Joel Sherrill <joel@OARcorp.com>; +Cc: gcc, Thomas Quinot

> RTEMS has networking functions but they are not available at this stage
> during the build.  You only have the .h files provided with newlib.  So
> this patch is needed to make *-rtems compile again.  OK to commit?

Please post the corresponding ChangeLog so that this patch can be reviewed
and approved, thanks.

> Index: gcc/ada/socket.c
> ===================================================================
> --- gcc/ada/socket.c    (revision 107093)
> +++ gcc/ada/socket.c    (working copy)
> @@ -190,6 +190,10 @@
>  #elif defined(VMS)
>    return errno;
>  #else
> +#if defined(__rtems__)
> +  /* No networking .h files are available from newlib so extern this. */
> +  extern int h_errno;
> +#endif
>    return h_errno;
>  #endif
>  }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-16 20:49 Ada Broken with h_errno change Joel Sherrill <joel@OARcorp.com>
  2005-11-17  8:44 ` Arnaud Charlet
@ 2005-11-17 22:32 ` Thomas Quinot
  2005-11-17 22:39   ` Joel Sherrill <joel@OARcorp.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Quinot @ 2005-11-17 22:32 UTC (permalink / raw)
  To: Joel Sherrill <joel@OARcorp.com>; +Cc: gcc

* Joel Sherrill <joel@OARcorp.com>, 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. ** quinot@adacore.com ** Senior Software Engineer
               AdaCore -- Paris, France -- New York, USA

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-17 22:32 ` Thomas Quinot
@ 2005-11-17 22:39   ` Joel Sherrill <joel@OARcorp.com>
  2005-11-18 17:32     ` Thomas Quinot
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Sherrill <joel@OARcorp.com> @ 2005-11-17 22:39 UTC (permalink / raw)
  To: Thomas Quinot; +Cc: gcc

Thomas Quinot wrote:
> * Joel Sherrill <joel@OARcorp.com>, 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?

You build RTEMS proper after you build the toolset with which you will 
build it.  So when you gcc, you only have access to .h files which are
properly associated with libc or libm.  Those are provided by newlib.
Headers files for networking, most tasking, and other functionality
is only available later when you build the OS.

To look at it another way, RTEMS doesn't use prebuilt binaries for the 
run-time libraries when building the tools.  We start with a fresh slate 
every time we build gcc and bootstrap our way up.  That way every object 
on the target is compiled by the same gcc.

This lets us get the full benefit of a newer and better gcc every time
we update.

>>this patch is needed to make *-rtems compile again.  OK to commit?
> 
> 
> I'd first like to understand what exactly the situation is.

I hope the explanation above helps make it clearer.

FWIW the extern might be better stylistically outside the function.  The
function already has more than enough conditional compilation going on.

--joel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-17 22:39   ` Joel Sherrill <joel@OARcorp.com>
@ 2005-11-18 17:32     ` Thomas Quinot
  2005-11-21 15:27       ` Joel Sherrill <joel@OARcorp.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Quinot @ 2005-11-18 17:32 UTC (permalink / raw)
  To: Joel Sherrill <joel@OARcorp.com>; +Cc: gcc

* Joel Sherrill <joel@OARcorp.com>, 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. ** quinot@adacore.com ** Senior Software Engineer
               AdaCore -- Paris, France -- New York, USA

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-18 17:32     ` Thomas Quinot
@ 2005-11-21 15:27       ` Joel Sherrill <joel@OARcorp.com>
  2005-11-21 15:33         ` Thomas Quinot
  2005-11-21 15:46         ` Arnaud Charlet
  0 siblings, 2 replies; 8+ messages in thread
From: Joel Sherrill <joel@OARcorp.com> @ 2005-11-21 15:27 UTC (permalink / raw)
  To: Thomas Quinot; +Cc: gcc

Thomas Quinot wrote:
> * Joel Sherrill <joel@OARcorp.com>, 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.

How about this?  Can I commit it?

Index: gcc/ada/socket.c
===================================================================
--- gcc/ada/socket.c    (revision 107308)
+++ gcc/ada/socket.c    (working copy)
@@ -189,6 +189,13 @@
    }
  #elif defined(VMS)
    return errno;
+#elif defined(__rtems__)
+  /* At this stage in the tool build, no networking .h files are available.
+     Newlib does not provide networking .h files and RTEMS is not built 
yet.
+     So we need to explicitly extern h_errno to access it.
+   */
+  extern int h_errno;
+  return h_errno;
  #else
    return h_errno;
  #endif


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-21 15:27       ` Joel Sherrill <joel@OARcorp.com>
@ 2005-11-21 15:33         ` Thomas Quinot
  2005-11-21 15:46         ` Arnaud Charlet
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Quinot @ 2005-11-21 15:33 UTC (permalink / raw)
  To: Joel Sherrill <joel@OARcorp.com>; +Cc: gcc

* Joel Sherrill <joel@OARcorp.com>, 2005-11-21 :

> How about this?  Can I commit it?

Looks good, please go ahead.

Thanks!
Thomas.

-- 
Thomas Quinot, Ph.D. ** quinot@adacore.com ** Senior Software Engineer
               AdaCore -- Paris, France -- New York, USA

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada Broken with h_errno change
  2005-11-21 15:27       ` Joel Sherrill <joel@OARcorp.com>
  2005-11-21 15:33         ` Thomas Quinot
@ 2005-11-21 15:46         ` Arnaud Charlet
  1 sibling, 0 replies; 8+ messages in thread
From: Arnaud Charlet @ 2005-11-21 15:46 UTC (permalink / raw)
  To: Joel Sherrill <joel@OARcorp.com>; +Cc: Thomas Quinot, gcc

> How about this?  Can I commit it?

Please always remember to provide a changelog when submitting a patch,
thanks ;-)

Patch is OK, assuming reasonable changelog entry.

Arno

> Index: gcc/ada/socket.c
> ===================================================================
> --- gcc/ada/socket.c    (revision 107308)
> +++ gcc/ada/socket.c    (working copy)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-21 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-16 20:49 Ada Broken with h_errno change Joel Sherrill <joel@OARcorp.com>
2005-11-17  8:44 ` Arnaud Charlet
2005-11-17 22:32 ` Thomas Quinot
2005-11-17 22:39   ` Joel Sherrill <joel@OARcorp.com>
2005-11-18 17:32     ` Thomas Quinot
2005-11-21 15:27       ` Joel Sherrill <joel@OARcorp.com>
2005-11-21 15:33         ` Thomas Quinot
2005-11-21 15:46         ` Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).