* [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed
@ 2020-12-20 23:28 Gerald Pfeifer
2020-12-21 11:58 ` Sebastian Huber
2020-12-21 13:44 ` Nathan Sidwell
0 siblings, 2 replies; 5+ messages in thread
From: Gerald Pfeifer @ 2020-12-20 23:28 UTC (permalink / raw)
To: gcc-patches, Nathan Sidwell
libcody as originally added to GCC fails to build on *-unknown-freebsd11.4
and presumably others:
c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c
-o netclient.o
.../libcody/netclient.cc:114:3: error: unknown type sockaddr_in6 addr;
^~~~~~~~~~~~
sockaddr_in6 is declared in /usr/include/netinet6/in6.h,
which is included by /usr/include/netinet/in.h.
Indeed, per https://man7.org/linux/man-pages/man7/ipv6.7.html
#include <sys/socket.h>
#include <netinet/in.h>
should be included, and our own gcc/ada/gsocket.h also has
#if !(defined (VMS) || defined (__MINGW32__))
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
:
#endif
Okay to push?
Gerald
libcody/ChangeLog:
2020-12-21 Gerald Pfeifer <gerald@pfeifer.com>
* netclient.cc: Include <netinet/in.h>.
* netserver.cc: Ditto.
---
libcody/netclient.cc | 1 +
libcody/netserver.cc | 1 +
2 files changed, 2 insertions(+)
diff --git a/libcody/netclient.cc b/libcody/netclient.cc
index 8cccface71c..c97ed4ca126 100644
--- a/libcody/netclient.cc
+++ b/libcody/netclient.cc
@@ -14,6 +14,7 @@
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/un.h>
+#include <netinet/in.h>
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0
diff --git a/libcody/netserver.cc b/libcody/netserver.cc
index 7e43eb033f4..4e55089161e 100644
--- a/libcody/netserver.cc
+++ b/libcody/netserver.cc
@@ -13,6 +13,7 @@
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/un.h>
+#include <netinet/in.h>
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0
--
2.29.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed
2020-12-20 23:28 [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed Gerald Pfeifer
@ 2020-12-21 11:58 ` Sebastian Huber
2020-12-21 13:44 ` Nathan Sidwell
1 sibling, 0 replies; 5+ messages in thread
From: Sebastian Huber @ 2020-12-21 11:58 UTC (permalink / raw)
To: Gerald Pfeifer, gcc-patches, Nathan Sidwell
On 21/12/2020 00:28, Gerald Pfeifer wrote:
> libcody as originally added to GCC fails to build on *-unknown-freebsd11.4
> and presumably others:
I experienced the same issue with FreeBSD 12 building a cross-compiler.
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed
2020-12-20 23:28 [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed Gerald Pfeifer
2020-12-21 11:58 ` Sebastian Huber
@ 2020-12-21 13:44 ` Nathan Sidwell
2020-12-21 16:19 ` Gerald Pfeifer
1 sibling, 1 reply; 5+ messages in thread
From: Nathan Sidwell @ 2020-12-21 13:44 UTC (permalink / raw)
To: Gerald Pfeifer, gcc-patches
On 12/20/20 6:28 PM, Gerald Pfeifer wrote:
> libcody as originally added to GCC fails to build on *-unknown-freebsd11.4
> and presumably others:
>
> c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c
> -o netclient.o
> .../libcody/netclient.cc:114:3: error: unknown type sockaddr_in6 addr;
> ^~~~~~~~~~~~
>
That should be fixed now
--
Nathan Sidwell
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed
2020-12-21 13:44 ` Nathan Sidwell
@ 2020-12-21 16:19 ` Gerald Pfeifer
2020-12-21 16:44 ` Nathan Sidwell
0 siblings, 1 reply; 5+ messages in thread
From: Gerald Pfeifer @ 2020-12-21 16:19 UTC (permalink / raw)
To: Nathan Sidwell; +Cc: gcc-patches
On Mon, 21 Dec 2020, Nathan Sidwell wrote:
> On 12/20/20 6:28 PM, Gerald Pfeifer wrote:
>> libcody as originally added to GCC fails to build on *-unknown-freebsd11.4
>> and presumably others:
>>
>> c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c
>> -o netclient.o
>> .../libcody/netclient.cc:114:3: error: unknown type sockaddr_in6 addr;
>> ^~~~~~~~~~~~
> That should be fixed now
libcody/netclient.cc is indeed fixed, after
commit 31705b068fa5d6cbd04aa4ac5f5275bad37d2222
Author: Nathan Sidwell <nathan@acm.org>
Date: Mon Dec 21 05:36:32 2020 -0800
libcody: Add netinet.h
We explicitly need to inlude netinet.h, (despite what happened on my test systems)
libcody/
* netclient.cc: Add netinet.h.
Note, though, that my patch also fixed libcody/netserver.cc, which still
failed. Seeing that your commit essentially matches my proposed patch, I
went ahead and committed the remaining part.
With that libcody now builds (and I'll look into the follow-up patch
you shared).
Thanks,
Gerald
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed
2020-12-21 16:19 ` Gerald Pfeifer
@ 2020-12-21 16:44 ` Nathan Sidwell
0 siblings, 0 replies; 5+ messages in thread
From: Nathan Sidwell @ 2020-12-21 16:44 UTC (permalink / raw)
To: Gerald Pfeifer; +Cc: gcc-patches
On 12/21/20 11:19 AM, Gerald Pfeifer wrote:
> We explicitly need to inlude netinet.h, (despite what happened on my test systems)
>
> libcody/
> * netclient.cc: Add netinet.h.
>
> Note, though, that my patch also fixed libcody/netserver.cc, which still
> failed. Seeing that your commit essentially matches my proposed patch, I
> went ahead and committed the remaining part.
>
> With that libcody now builds (and I'll look into the follow-up patch
> you shared).
thanks, I didn't realize you had a patch already.
nathan
--
Nathan Sidwell
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-21 16:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-20 23:28 [PATCH, fix bootstrap] libcody: Include <netinet/in.h> as needed Gerald Pfeifer
2020-12-21 11:58 ` Sebastian Huber
2020-12-21 13:44 ` Nathan Sidwell
2020-12-21 16:19 ` Gerald Pfeifer
2020-12-21 16:44 ` Nathan Sidwell
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).