Skip to content

Build with --enable-shared fails #54729

Closed

Description

@skrah
mannequin
BPO 10520
Nosy @warsaw, @doko42, @pitrou, @benjaminp, @tarekziade, @merwok, @skrah, @ambv

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/warsaw'
closed_at = <Date 2010-11-27.20:03:24.187>
created_at = <Date 2010-11-24.14:00:02.599>
labels = ['type-bug', 'build']
title = 'Build with --enable-shared fails'
updated_at = <Date 2010-11-27.20:03:24.186>
user = 'https://github.com/skrah'

bugs.python.org fields:

activity = <Date 2010-11-27.20:03:24.186>
actor = 'barry'
assignee = 'barry'
closed = True
closed_date = <Date 2010-11-27.20:03:24.187>
closer = 'barry'
components = ['Build']
creation = <Date 2010-11-24.14:00:02.599>
creator = 'skrah'
dependencies = []
files = []
hgrepos = []
issue_num = 10520
keywords = []
message_count = 10.0
messages = ['122278', '122282', '122283', '122286', '122291', '122307', '122308', '122407', '122540', '122546']
nosy_count = 9.0
nosy_names = ['barry', 'doko', 'pitrou', 'benjamin.peterson', 'tarek', 'eric.araujo', 'rpetrov', 'skrah', 'lukasz.langa']
pr_nums = []
priority = 'high'
resolution = 'fixed'
stage = 'commit review'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue10520'
versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

Activity

  1. skrah commented on Nov 24, 2010

    skrahmannequin
    MannequinAuthor

    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".

  2. added
    buildThe build process and cross-build
    type-bugAn unexpected behavior, bug, or error
    on Nov 24, 2010
  3. warsaw commented on Nov 24, 2010

    @warsaw
    Member

    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.

  4. warsaw commented on Nov 24, 2010

    @warsaw
    Member

    I'm bumping the status down since this likely won't affect the average user, only developers who do their own source installs.

  5. self-assigned this
    on Nov 24, 2010
  6. doko42 commented on Nov 24, 2010

    @doko42
    Member

    -L. should appear before -L/usr/local/lib.

  7. skrah commented on Nov 24, 2010

    skrahmannequin
    MannequinAuthor

    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.

  8. warsaw commented on Nov 24, 2010

    @warsaw
    Member

    r86734

  9. warsaw commented on Nov 24, 2010

    @warsaw
    Member

    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.

  10. rpetrov commented on Nov 25, 2010

    rpetrovmannequin
    Mannequin

    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)
  11. ambv commented on Nov 27, 2010

    @ambv
    Contributor

    Roumen's patch fixes a regression where readline extension would fail to build on Mac OS X 10.6.5.

  12. reopened this on Nov 27, 2010
  13. warsaw commented on Nov 27, 2010

    @warsaw
    Member

    r86837

  14. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions