Title: Multiprocessing module fails to build on Solaris 11.3
Type: compile error Stage:
Components: Extension Modules Versions: Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: clallen, spackard
Priority: normal Keywords: patch

Created on 2018-07-10 07:54 by clallen, last changed 2018-12-09 16:47 by clallen.

File name Uploaded Description Edit
Python-2.7.15-Modules_multiprocessing_h.patch clallen, 2018-07-10 07:58 GNU diff patch for Modules/_multiprocessing/multiprocessing.h
solaris_gcc_mutiprocessing.diff spackard, 2018-10-09 16:07 GNU diff path for Modules/_multiprocessing/multiprocessing.h
Messages (3)
msg321364 - (view) Author: Clint Allen (clallen) * Date: 2018-07-10 07:54
The build of this module fails with this error:

In file included from /usr/include/limits.h:12:0,
                 from /usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:168,
                 from /usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/syslimits.h:7,
                 from /usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:34,
                 from Include/Python.h:19,
                 from /opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.h:12,
                 from /opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.c:9:
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/sys/feature_tests.h:363:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications        and pre-2001 POSIX applications"

Changing the value of _XOPEN_SOURCE from 500 to 600 in Modules/_multiprocessing/multiprocessing.h fixes it.
msg327425 - (view) Author: Steven Packard (spackard) Date: 2018-10-09 16:07
I don't think you can blindly change that value of that definition. It will likely break the compilation of the module using Solaris Sun Studio while fixing compilation with gcc. The attached patch should do the correct thing in the presence of either toolchain.
msg331440 - (view) Author: Clint Allen (clallen) * Date: 2018-12-09 16:47
Agreed, that is a better approach.
I have tested your patch successfully with gcc on Solaris 11.3.
Date User Action Args
2018-12-09 16:47:16clallensetmessages: + msg331440
2018-10-09 16:07:39spackardsetfiles: + solaris_gcc_mutiprocessing.diff
nosy: + spackard
messages: + msg327425

2018-07-10 07:58:07clallensetfiles: + Python-2.7.15-Modules_multiprocessing_h.patch
keywords: + patch
2018-07-10 07:54:31clallencreate