[New-bugs-announce] [issue37518] Python-2.7.16 fails to build with --enable-shared

Willie Lopez report at bugs.python.org
Sat Jul 6 22:43:59 EDT 2019


New submission from Willie Lopez <willie.lopez at yahoo.com>:

When building Python-2.7.16 on CentOS-7.4, building with --enable-shared through ./configure will cause Python to fail its build without errors and will install python-2.7.5, the wrong version. If Python is built without --enable-shared, other compilations that need Python will fail with the cryptic error in the following. Recompiling the app such as Apache will continue fail even when explicitly defining -fPIC in CFLAGS. However, trying to build Python with the shared flag appears to succeed, but in fact it fails and installs Python-2.7.5, the wrong version. 

/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC 

I have tried to build manually build Python with the following:
./buildconf (with and without running buildconf)
CFLAGS='-fPIC -g -O2' ./configure --prefix=$HOME/tools 
make
make altinstall %{buildroot}%{prefix} 

What am I missing? What am I doing wrong in the build?

----------
components: Build
messages: 347461
nosy: lopez at ucar.edu
priority: normal
severity: normal
status: open
title: Python-2.7.16 fails to build with --enable-shared
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list