public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS
  2014-08-12 14:31 [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Joel Sherrill
@ 2014-08-12 14:31 ` Joel Sherrill
  2014-08-12 17:32   ` Arnaud Charlet
  2014-08-12 17:33 ` [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Arnaud Charlet
  1 sibling, 1 reply; 8+ messages in thread
From: Joel Sherrill @ 2014-08-12 14:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joel Sherrill

Hopefully this addresses the comments.

OK to comment?

2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>

	* socket.c: For RTEMS, use correct prototype of gethostbyname_r().
	* gsocket.h Add include of <unistd.h> on RTEMS.
---
 gcc/ada/gsocket.h | 5 +++++
 gcc/ada/socket.c  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h
index f139d72..2034137 100644
--- a/gcc/ada/gsocket.h
+++ b/gcc/ada/gsocket.h
@@ -184,6 +184,11 @@
 #include <sys/time.h>
 #endif
 
+#if defined(__rtems__)
+#include <unistd.h>
+/* Required, for read(), write(), and close() */
+#endif
+
 /*
  * RTEMS has these .h files but not until you have built and installed RTEMS.
  * When building a C/C++ toolset, you also build the newlib C library, so the
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index 4a9e6ad..ad88268 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -184,7 +184,7 @@ __gnat_gethostbyname (const char *name,
   struct hostent *rh;
   int ri;
 
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
   (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
 #else
   rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);
-- 
1.9.3

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

* [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
@ 2014-08-12 14:31 Joel Sherrill
  2014-08-12 14:31 ` [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS Joel Sherrill
  2014-08-12 17:33 ` [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Arnaud Charlet
  0 siblings, 2 replies; 8+ messages in thread
From: Joel Sherrill @ 2014-08-12 14:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joel Sherrill

This didn't get any comments earlier. Is it OK to comment?

Somewhere along the way, the Ada run-time Makefile's quit
honoring CFLAGS_FOR_TARGET. This just adds it back.

2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>

	* Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
---
 libada/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libada/Makefile.in b/libada/Makefile.in
index c307b99..93da740 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -60,7 +60,7 @@ CFLAGS=-g
 PICFLAG = @PICFLAG@
 GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
 GNATLIBCFLAGS= -g -O2
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
 	-fexceptions -DIN_RTS @have_getipinfo@
 
 host_subdir = @host_subdir@
-- 
1.9.3

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

* Re: [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS
  2014-08-12 14:31 ` [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS Joel Sherrill
@ 2014-08-12 17:32   ` Arnaud Charlet
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaud Charlet @ 2014-08-12 17:32 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gcc-patches

> Hopefully this addresses the comments.
> 
> OK to comment?
> 
> 2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
> 
> 	* socket.c: For RTEMS, use correct prototype of gethostbyname_r().
> 	* gsocket.h Add include of <unistd.h> on RTEMS.

OK

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

* Re: [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
  2014-08-12 14:31 [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Joel Sherrill
  2014-08-12 14:31 ` [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS Joel Sherrill
@ 2014-08-12 17:33 ` Arnaud Charlet
  2014-08-12 19:20   ` Joel Sherrill
  1 sibling, 1 reply; 8+ messages in thread
From: Arnaud Charlet @ 2014-08-12 17:33 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gcc-patches

> This didn't get any comments earlier. Is it OK to comment?

This one is a bit tricky so requires more thoughts. On which targets did
you test it?

> Somewhere along the way, the Ada run-time Makefile's quit
> honoring CFLAGS_FOR_TARGET. This just adds it back.
> 
> 2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
> 
> 	* Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.

I guess this is OK on principle, but if someone reports an issue with this
patch, we might need to revert it.

Arno

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

* Re: [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
  2014-08-12 17:33 ` [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Arnaud Charlet
@ 2014-08-12 19:20   ` Joel Sherrill
  2014-08-12 19:23     ` Arnaud Charlet
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Sherrill @ 2014-08-12 19:20 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc-patches


On 8/12/2014 12:33 PM, Arnaud Charlet wrote:
>> This didn't get any comments earlier. Is it OK to comment?
> This one is a bit tricky so requires more thoughts. On which targets did
> you test it?
native CentOS and sparc-rtems4.11.  I don't have access to much else
except *-rtems* which is basically the same thing with different backend
gcc issues.

The build needs a way to see the RTEMS network .h files since they are
not installed with the libc files. libc/gcc .h files are part of the
normal GNU toolset. The others are part of the BSP install.
>> Somewhere along the way, the Ada run-time Makefile's quit
>> honoring CFLAGS_FOR_TARGET. This just adds it back.
>>
>> 2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
>>
>> 	* Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C.
> I guess this is OK on principle, but if someone reports an issue with this
> patch, we might need to revert it.
It was in the rts Makefile back when it was under gcc. I suspect it
disappeared when this
all moved to libada. Could check the history if we need to.
> Arno

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@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: [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
  2014-08-12 19:20   ` Joel Sherrill
@ 2014-08-12 19:23     ` Arnaud Charlet
  2014-08-12 19:29       ` Joel Sherrill
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaud Charlet @ 2014-08-12 19:23 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gcc-patches

> It was in the rts Makefile back when it was under gcc. I suspect it
> disappeared when this
> all moved to libada. Could check the history if we need to.

Well, libada has been introduced many many years ago. Are you saying you
haven't built Ada since then, or were using local patches?

Arno

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

* Re: [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
  2014-08-12 19:23     ` Arnaud Charlet
@ 2014-08-12 19:29       ` Joel Sherrill
  2014-08-12 19:30         ` Arnaud Charlet
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Sherrill @ 2014-08-12 19:29 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc-patches


On 8/12/2014 2:22 PM, Arnaud Charlet wrote:
>> It was in the rts Makefile back when it was under gcc. I suspect it
>> disappeared when this
>> all moved to libada. Could check the history if we need to.
> Well, libada has been introduced many many years ago. Are you saying you
> haven't built Ada since then, or were using local patches?
I don't know when I last built it but it has been broken for a while and
I didn't get
a chance to track it down and submit patches.

I have had local patches but didn't like them.  Ada is just a volunteer
activity at this
point for me. If AdaCore would like to include one RTEMS target in your
automated
testing, that would help.

> Arno

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@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: [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C
  2014-08-12 19:29       ` Joel Sherrill
@ 2014-08-12 19:30         ` Arnaud Charlet
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaud Charlet @ 2014-08-12 19:30 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gcc-patches

> I don't know when I last built it but it has been broken for a while and
> I didn't get a chance to track it down and submit patches.

OK well as I said, as long as your change doesn't break other targets, that's
OK.

> I have had local patches but didn't like them.  Ada is just a volunteer
> activity at this
> point for me. If AdaCore would like to include one RTEMS target in your
> automated testing, that would help.

Thanks, but no thanks :-)

Arno

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

end of thread, other threads:[~2014-08-12 19:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12 14:31 [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Joel Sherrill
2014-08-12 14:31 ` [PATCH 2/2] gcc/ada/socket.c, gsocket.h: Add conditionals for RTEMS Joel Sherrill
2014-08-12 17:32   ` Arnaud Charlet
2014-08-12 17:33 ` [PATCH 1/2] libada/Makefile.in: Add CFLAGS_FOR_TARGET to GNATLIBCFLAGS_FOR_C Arnaud Charlet
2014-08-12 19:20   ` Joel Sherrill
2014-08-12 19:23     ` Arnaud Charlet
2014-08-12 19:29       ` Joel Sherrill
2014-08-12 19:30         ` 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).