-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare sethostname in socketmodule.c for SOLARIS #78469
Comments
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. |
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);
#endif +#if (defined(__sun) && defined(__SVR4))
+extern int sethostname(const char *, size_t);
+#endif
+
if (!PyArg_ParseTuple(args, "S:sethostname", &hnobj)) {
PyErr_Clear();
if (!PyArg_ParseTuple(args, "O&:sethostname", |
Hi, since this is reported in Solaris 10 (which is before Solaris was first opened, so only Sun/Oracle is affected here), I had to dive into history a little bit.
I don't think it's a secret that we don't plan to release any new official Python 3.x package for Solaris 10 (which is in the extended support stage intended for critical fixes only), so this is not relevant to us. But that also means that those still using it might want to build newer Python for it themselves. What's unfortunate is that simply adding the definition would cause at least redefinition warnings on current Solaris. |
Can't you test the Solaris version in the preprocessor (#ifdef)? Feel free to propose a PR. |
Developer Studio compiler provides handy macros like I guess I can define something like that via configure with |
Yeah, that should be good enough. |
I looked into it and prepared #109447 - I was worried that more would be necessary, but I think it worked out pretty well. |
Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
Thanks for the report, @r-bit-rry, and thanks for the fix, @kulikjak, and thanks for the review, @vstinner. Marking this as resolved; the backports are approved and queued for merging. |
…9447) Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: