This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Declare sethostname in socketmodule.c for SOLARIS
Type: compile error Stage:
Components: Build Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: John Harrison, rbelio
Priority: normal Keywords:

Created on 2018-07-31 07:32 by rbelio, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg322742 - (view) Author: Roy Belio (rbelio) Date: 2018-07-31 07:32
Following issue 18259 which was solved by extern sethostname I managed to build python 3.7 on solaris only after patching away the ifdef for _AIX.
We need to add SOLARIS flag and check for that also in the same line of 
#ifdef _AIX.

This error only appears in 3.7 since a new CFLAG was turned on -Werror=no-implicit-declaration. and during build time it fails on sethostname function, not build _socket.
msg342581 - (view) Author: John Harrison (John Harrison) Date: 2019-05-15 15:53
On Solaris 10 i386 I successfully built _socket on 3.7.3 by patching *in* a Solaris test (by cloning the test for the INET_ADDRSTRLEN definition currently on line 268) rather than by patching away the _AIX ifdef

$ diff -u ../socketmodule.c Modules/socketmodule.c
--- ../socketmodule.c   Wed May 15 16:36:32 2019
+++ Modules/socketmodule.c      Wed May 15 15:34:50 2019
@@ -5212,6 +5212,10 @@
 extern int sethostname(const char *, size_t);

+#if (defined(__sun) && defined(__SVR4))
+extern int sethostname(const char *, size_t);
     if (!PyArg_ParseTuple(args, "S:sethostname", &hnobj)) {
         if (!PyArg_ParseTuple(args, "O&:sethostname",
Date User Action Args
2022-04-11 14:59:04adminsetgithub: 78469
2019-05-15 15:53:46John Harrisonsetnosy: + John Harrison
messages: + msg342581
2018-07-31 07:32:32rbeliocreate