HAVE_PIPE2 is defined on FreeBSD 10.0. Parts of the problem requires O_CLOEXEC. Problem code) Python-3.2.5/Modules/_posixsubprocess.c #ifdef HAVE_PIPE2 Py_BEGIN_ALLOW_THREADS res = pipe2(fds, O_CLOEXEC); Py_END_ALLOW_THREADS if (res != 0 && errno == ENOSYS) { { #endif _XOPEN_SOURCE is set to 600 by configure. When _XOPEN_SOURCE is 600, _POSIX_C_SOURCE 200112 and __POSIX_VISIBLE 200112 are defined by sys/cdefs.h. However, to get O_CLOEXEC, __POSIX_VISIBLE >= 200809 is required to define on FreeBSD. Reproducible: Always Steps to Reproduce: 1. emerge =dev-lang/python-3.2.5-r3 2. 3. Actual Results: building '_posixsubprocess' extension x86_64-gentoo-freebsd10.0-gcc -pthread -fPIC -DNDEBUG -O2 -pipe -mtune=generic -fwrapv -DNDEBUG -O2 -pipe -mtune=generic -fwrapv -IInclude -I. -I/var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Include -I/var/tmp/portage/dev-lang/python-3.2.5-r3/work/x86_64-gentoo-freebsd10.0 -c /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Modules/_posixsubprocess.c -o build/temp.freebsd-10.0_beta1-Gentoo-amd64-3.2/var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Modules/_posixsubprocess.o /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Modules/_posixsubprocess.c: In function 'subprocess_cloexec_pipe': /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Modules/_posixsubprocess.c:738:22: error: 'O_CLOEXEC' undeclared (first use in this function) res = pipe2(fds, O_CLOEXEC); ^ /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Modules/_posixsubprocess.c:738:22: note: each undeclared identifier is reported only once for each function it appears in <snip> Python build finished, but the necessary bits to build these modules were not found: _tkinter ossaudiodev spwd To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: _posixsubprocess running build_scripts creating build/scripts-3.2 copying and adjusting /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Tools/scripts/pydoc3 -> build/scripts-3.2 copying and adjusting /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Tools/scripts/idle3 -> build/scripts-3.2 copying and adjusting /var/tmp/portage/dev-lang/python-3.2.5-r3/work/Python-3.2.5/Tools/scripts/2to3 -> build/scripts-3.2 changing mode of build/scripts-3.2/pydoc3 from 644 to 755 changing mode of build/scripts-3.2/idle3 from 644 to 755 changing mode of build/scripts-3.2/2to3 from 644 to 755 renaming build/scripts-3.2/pydoc3 to build/scripts-3.2/pydoc3.2 renaming build/scripts-3.2/idle3 to build/scripts-3.2/idle3.2 renaming build/scripts-3.2/2to3 to build/scripts-3.2/2to3-3.2 gmake: *** [sharedmods] Error 1 * ERROR: dev-lang/python-3.2.5-r3::gentoo failed (compile phase): * emake failed FYI, x86_64-gentoo-freebsd10.0/pyconfig.h:#define HAVE_PIPE2 1 x86_64-gentoo-freebsd9.0/pyconfig.h:/* #undef HAVE_PIPE2 */ configure.ac if test $define_xopen_source = yes then AC_DEFINE(_XOPEN_SOURCE, 600, Define to the level of X/Open that your system supports) sys/cdefs.h http://svnweb.freebsd.org/base/stable/10/sys/sys/cdefs.h?revision=256281&view=co /* Deal with various X/Open Portability Guides and Single UNIX Spec. */ #ifdef _XOPEN_SOURCE #if _XOPEN_SOURCE - 0 >= 700 #define __XSI_VISIBLE 700 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809 #elif _XOPEN_SOURCE - 0 >= 600 #define __XSI_VISIBLE 600 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112 #elif _XOPEN_SOURCE - 0 >= 500 <snip> /* * Deal with all versions of POSIX. The ordering relative to the tests above is * important. */ #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 198808 #endif #ifdef _POSIX_C_SOURCE #if _POSIX_C_SOURCE >= 200809 #define __POSIX_VISIBLE 200809 #define __ISO_C_VISIBLE 1999 #elif _POSIX_C_SOURCE >= 200112 #define __POSIX_VISIBLE 200112 #define __ISO_C_VISIBLE 1999 #elif _POSIX_C_SOURCE >= 199506 <snip> fcntl.h http://svnweb.freebsd.org/base/stable/10/sys/sys/fcntl.h?revision=256281&view=co #if __POSIX_VISIBLE >= 200809 /* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */ #define O_TTY_INIT 0x00080000 /* Restore default termios attributes */ #define O_CLOEXEC 0x00100000 #endif Note, python-2.x does not require O_CLOEXEC. python-3.3.2, Set _XOPEN_SOURCE to 700. (Issue #12852)
Created attachment 362382 [details, diff] sample patch for Python-3.2.5/Modules/_posixsubprocess.c If you don't want to change source code, please add the following line to src_configure() of ebuild. use elibc_FreeBSD && export ac_cv_func_pipe2=no
Is problem present in Python 3.3 or 3.4? Is it sufficient to backport configure.in part of http://hg.python.org/cpython/rev/92842e347d98 ?: --- a/configure.in +++ b/configure.in @@ -408,8 +408,7 @@ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Define to activate Unix95-and-earlier features) - AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001) - + AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008) fi #
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #2) > Is problem present in Python 3.3 or 3.4? no. It was fixed in python 3.3. > Is it sufficient to backport configure.in part of > http://hg.python.org/cpython/rev/92842e347d98 ?: > > --- a/configure.in > +++ b/configure.in > @@ -408,8 +408,7 @@ > AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, > Define to activate Unix95-and-earlier features) > > - AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE > Stds 1003.1-2001) > - > + AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE > Stds 1003.1-2008) > fi > > # will also need the following code. http://hg.python.org/cpython/rev/cf66578d03d1 --- a/configure.in +++ b/configure.in @@ -397,7 +397,8 @@ esac if test $define_xopen_source = yes then - AC_DEFINE(_XOPEN_SOURCE, 600, + # X/Open 7, incorporating POSIX.1-2008 + AC_DEFINE(_XOPEN_SOURCE, 700, Define to the level of X/Open that your system supports) # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
python-3.2.5 is no longer in the tree. closing.