Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_dbm requires -lgdbm if gdbm is built as static libraries #73626

Closed
yan12125 mannequin opened this issue Feb 4, 2017 · 4 comments
Closed

_dbm requires -lgdbm if gdbm is built as static libraries #73626

yan12125 mannequin opened this issue Feb 4, 2017 · 4 comments
Labels
3.7 (EOL) end of life build The build process and cross-build

Comments

@yan12125
Copy link
Mannequin

yan12125 mannequin commented Feb 4, 2017

BPO 29440
Nosy @ncoghlan, @yan12125
Files
  • gdbm.patch
  • gdbm.patch: The correct patch, please ignore previous one
  • 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 = None
    closed_at = <Date 2019-03-02.14:37:49.745>
    created_at = <Date 2017-02-04.05:18:54.230>
    labels = ['build', '3.7']
    title = '_dbm requires -lgdbm if gdbm is built as static libraries'
    updated_at = <Date 2019-03-02.14:37:49.741>
    user = 'https://github.com/yan12125'

    bugs.python.org fields:

    activity = <Date 2019-03-02.14:37:49.741>
    actor = 'yan12125'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-02.14:37:49.745>
    closer = 'yan12125'
    components = ['Build']
    creation = <Date 2017-02-04.05:18:54.230>
    creator = 'yan12125'
    dependencies = []
    files = ['46507', '46517']
    hgrepos = []
    issue_num = 29440
    keywords = ['patch']
    message_count = 4.0
    messages = ['286907', '286908', '286971', '337012']
    nosy_count = 2.0
    nosy_names = ['ncoghlan', 'yan12125']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue29440'
    versions = ['Python 3.6', 'Python 3.7']

    @yan12125
    Copy link
    Mannequin Author

    yan12125 mannequin commented Feb 4, 2017

    In setup.py, _dbm links to gdbm_compat only. If gdbm is built as dynamic libraries, libgdbm_compat.so has a NEEDED flag for libgdbm.so, so both symbols in libgdbm and libgdbm_compat can be used. However, as static libraries does not provide such a flag, importing _dbm raises ImportError:

    shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -c 'import _dbm'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: dlopen failed: cannot locate symbol "gdbm_errno" referenced by "/data/local/tmp/python3/usr/lib/python3.7/lib-dynload/_dbm.cpython-37m.so"...

    gdbm_errno is a symbol in libgdbm.a.

    gdbm manual [1] suggests linking to both libraries, too.

    [1] http://www.gnu.org.ua/software/gdbm/manual/html_node/Compatibility.html

    @yan12125 yan12125 mannequin added 3.7 (EOL) end of life build The build process and cross-build labels Feb 4, 2017
    @yan12125
    Copy link
    Mannequin Author

    yan12125 mannequin commented Feb 4, 2017

    Add the developer who wrote this line (bpo-15044)

    @yan12125
    Copy link
    Mannequin Author

    yan12125 mannequin commented Feb 4, 2017

    Sorry, -lgdbm should come after -lgdbm_compat, or symbols in libgdbm.a are still not resolved. I don't know why - linking is a magic :(

    @yan12125
    Copy link
    Mannequin Author

    yan12125 mannequin commented Mar 2, 2019

    I gave up building gdbm as a static library. It brings more headache than benefits.

    @yan12125 yan12125 mannequin closed this as completed Mar 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants