[New-bugs-announce] [issue37930] make fails when compiling Python 2.6 from source (posixmodule.c)

Oguz_eren report at bugs.python.org
Fri Aug 23 09:49:47 EDT 2019


New submission from Oguz_eren <oguzeren at gmail.com>:

I'm trying to compile Python 2.6.8 on Kubuntu 19.04.

Current system version is Python 2.7.16. See below the error message I receive, during make.

oguz at dikanka:~$ tar -xvzf Python-2.6.8.tgz
oguz at dikanka:~$ cd Python-2.6.8/


oguz at dikanka:~/Python-2.6.8$ ./configure
…
…

oguz at dikanka:~/Python-2.6.8$ make

…
…
gcc -pthread  -Xlinker -export-dynamic -o python \ 
               Modules/python.o \ 
               libpython2.6.a -lpthread -ldl  -lutil   -lm   
/usr/bin/ld: libpython2.6.a(posixmodule.o): in function `posix_tmpnam': 
/home/oguz/Python-2.6.8/./Modules/posixmodule.c:7261: warning: the use of `tmpnam_r' is dangerous, better use `
mkstemp' 
/usr/bin/ld: libpython2.6.a(posixmodule.o): in function `posix_tempnam': 
/home/oguz/Python-2.6.8/./Modules/posixmodule.c:7216: warning: the use of `tempnam' is dangerous, better use `m
kstemp' 
Segmentation fault (core dumped) 
make: *** [Makefile:414: sharedmods] Error 139 

I found this python bug to be very similar to my case, but it's a rather old bug : https://bugs.python.org/issue535545

Here it says, posixmodule fails because resource.h is not detected properly by configure. Similarly in my case, pyconfig.h file's HAVE_SYS_RESOURCE_H line is commented out. I also realized that my c lib headers are not under /usr/include/sys and /usr/include/bits. Instead, I can find them under the following locations :

oguz at dikanka:/usr/include/linux$ find /usr/include -name resource.h
/usr/include/asm-generic/resource.h
/usr/include/linux/resource.h
/usr/include/x86_64-linux-gnu/asm/resource.h
/usr/include/x86_64-linux-gnu/bits/resource.h
/usr/include/x86_64-linux-gnu/sys/resource.h

I tried symlinks to x86_64-linux-gnu/sys and x86_64-linux-gnu/bits, but the the issue persists.

Any ideas ? Thanks in advance!

----------
components: Installation
messages: 350283
nosy: Oguz_eren
priority: normal
severity: normal
status: open
title: make fails when compiling Python 2.6 from source (posixmodule.c)
type: compile error

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37930>
_______________________________________


More information about the New-bugs-announce mailing list