classification
Title: Build with --enable-shared fails
Type: behavior Stage: commit review
Components: Build Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, benjamin.peterson, doko, eric.araujo, lukasz.langa, pitrou, rpetrov, skrah, tarek
Priority: high Keywords:

Created on 2010-11-24 14:00 by skrah, last changed 2010-11-27 20:03 by barry. This issue is now closed.

Messages (10)
msg122278 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-11-24 14:05
Building the modules fails if --enable-shared is used. The linker picks
up an existing library from /usr/local/lib, which has not been compiled
with -fPIC:


gcc -pthread -shared build/temp.linux-x86_64-3.2/home/stefan/svn/py3k/Modules/_struct.o -L/usr/local/lib -L. -lpython3.2m -o build/lib.linux-x86_64-3.2/_struct.cpython-32m.so
/usr/bin/ld: /usr/local/lib/libpython3.2m.a(abstract.o): relocation R_X86_64_32S against `_PyObject_NextNotImplemented' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython3.2m.a: could not read symbols: Bad value
collect2: ld returned 1 exit status


Linking works if the order of the flags is changed to "-L. L/usr/local/lib".
msg122282 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-24 15:31
So, you must have done a 'make install' or 'make altinstall' to get a build into /usr/local, right?  Without that of course it works fine.

You're probably still right about changing the order so it picks up the local copy first.
msg122283 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-24 15:32
I'm bumping the status down since this likely won't affect the average user, only developers who do their own source installs.
msg122286 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2010-11-24 16:18
-L. should appear before -L/usr/local/lib.
msg122291 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-11-24 17:03
Since I'm on Linux, I did a prior install into /usr/local. But I'm pretty
sure that BSD ports (which you might view as the system install) also use
/usr/local.
msg122307 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-24 20:30
r86734
msg122308 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-24 20:30
BTW, I am not sure it's worth backporting this to 3.1 and 2.7.  It seems like a corner case that will not affect most users.
msg122407 - (view) Author: Roumen Petrov (rpetrov) * Date: 2010-11-25 20:40
It is wort to fix regression if all directories are absolute. 

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,8 @@
     for i, path in enumerate(dirlist):
         if not os.path.isabs(path):
             dirlist.insert(i + 1, dir)
-            break
+            return
+    dirlist.insert(0, dir)
msg122540 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2010-11-27 18:44
Roumen's patch fixes a regression where readline extension would fail to build on Mac OS X 10.6.5.
msg122546 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-27 20:03
r86837
History
Date User Action Args
2010-11-27 20:03:24barrysetstatus: open -> closed
resolution: fixed
messages: + msg122546
2010-11-27 18:44:17lukasz.langasetstatus: closed -> open

nosy: + lukasz.langa
messages: + msg122540

resolution: fixed -> (no value)
stage: commit review
2010-11-25 20:40:48rpetrovsetnosy: + rpetrov
messages: + msg122407
2010-11-24 20:42:19eric.araujosetnosy: + benjamin.peterson, eric.araujo
2010-11-24 20:30:44barrysetmessages: + msg122308
2010-11-24 20:30:17barrysetstatus: open -> closed
resolution: fixed
messages: + msg122307
2010-11-24 17:03:42skrahsetmessages: + msg122291
2010-11-24 16:18:01dokosetnosy: + doko
messages: + msg122286
2010-11-24 15:32:06barrysetpriority: critical -> high
assignee: barry
messages: + msg122283
2010-11-24 15:31:00barrysetmessages: + msg122282
2010-11-24 14:13:44pitrousetnosy: + barry
2010-11-24 14:05:48skrahsetpriority: normal -> critical

type: behavior
components: + Build
versions: + Python 3.1, Python 2.7, Python 3.2
nosy: + tarek, pitrou

messages: + msg122278
2010-11-24 14:00:02skrahcreate