Title: selectmodule build fails
Type: compile error Stage:
Components: Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, offby1, sxsns243, vstinner
Priority: normal Keywords: patch

Created on 2016-12-09 00:35 by sxsns243, last changed 2018-01-12 17:16 by offby1.

File name Uploaded Description Edit
selectmodule.patch sxsns243, 2016-12-09 00:35 review
Messages (5)
msg282746 - (view) Author: Wataru Matsumoto (sxsns243) * Date: 2016-12-09 00:35
selectmodule build fails with the linux without epoll_create1(before kernel 2.6.27).

building 'select' extension
gcc -pthread -fPIC -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I. -I/usr/local/include -I/home/wmatsumo/download/cpython/Include -I/home/wmatsumo/download/cpython -c /home/wmatsumo/download/cpython/Modules/selectmodule.c -o build/temp.linux-x86_64-3.7-pydebug/home/wmatsumo/download/cpython/Modules/selectmodule.o
/home/wmatsumo/download/cpython/Modules/selectmodule.c: In function 'pyepoll_new':
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: (Each undeclared identifier is reported only once
/home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: for each function it appears in.)

It seems due to the below change.
It have to check HAVE_EPOLL_CREATE1 is defined before using EPOLL_CLOEXEC.
msg282750 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-12-09 01:16
Probably a regression caused by the change ac24e5c2fd3e.

I'm curious: what is your Linux distribution? (Can't you get a more Linux kernel?)
msg282757 - (view) Author: Wataru Matsumoto (sxsns243) * Date: 2016-12-09 03:07
I'm using Red Hat Enterprise.
cat /proc/version 
Linux version 2.6.18-238.9.1.el5 ( (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Mar 18 12:42:39 EDT 2011
msg309864 - (view) Author: Chris Rose (offby1) * Date: 2018-01-12 17:14
Is this patch mergeable? I'm trialing the 3.7.0a4 build on some systems here and am unable to build due to this issue, on libc 2.12:

± /lib/
GNU C Library stable release version 2.12, by Roland McGrath et al.
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Compiled by GNU CC version 4.4.6 20110731 XXXXXXXXXXXX.
Compiled on a Linux 3.2.5 system on 2017-10-20.
Available extensions:
	The C stubs add-on version 2.1.2.
	crypt add-on version 2.1 by Michael Glad and others
	GNU Libidn by Simon Josefsson
	Native POSIX Threads Library by Ulrich Drepper et al
	RT using linux kernel aio
msg309865 - (view) Author: Chris Rose (offby1) * Date: 2018-01-12 17:16
Ach; ignore the libc version below; that's a PEBKAC error on my part. The libc version on the system that's failing is older (and hard to get; just trust me, it's older) and doesn't have the relevant epoll value.
Date User Action Args
2018-01-12 17:16:20offby1setmessages: + msg309865
2018-01-12 17:14:47offby1setnosy: + offby1
messages: + msg309864
2016-12-09 03:07:30sxsns243setmessages: + msg282757
2016-12-09 01:16:25vstinnersetnosy: + vstinner
messages: + msg282750
2016-12-09 00:41:01ned.deilysetnosy: + berker.peksag
2016-12-09 00:35:21sxsns243create