Skip to content

ctypes not building under OS X because of ffi_closure_free not being defined early enough #53871

Closed

Description

@brettcannon
BPO 9662
Nosy @smontanaro, @brettcannon, @theller, @birkenfeld, @ronaldoussoren, @benjaminp, @ned-deily, @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/ronaldoussoren'
closed_at = <Date 2010-09-16.11:35:42.682>
created_at = <Date 2010-08-22.20:45:22.589>
labels = ['ctypes', 'build', 'release-blocker']
title = 'ctypes not building under OS X because of ffi_closure_free not being defined early enough'
updated_at = <Date 2010-09-16.11:35:42.680>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2010-09-16.11:35:42.680>
actor = 'ronaldoussoren'
assignee = 'ronaldoussoren'
closed = True
closed_date = <Date 2010-09-16.11:35:42.682>
closer = 'ronaldoussoren'
components = ['ctypes']
creation = <Date 2010-08-22.20:45:22.589>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 9662
keywords = []
message_count = 12.0
messages = ['114704', '114707', '114709', '115629', '115632', '115633', '115641', '115649', '115650', '115653', '115666', '116522']
nosy_count = 8.0
nosy_names = ['skip.montanaro', 'brett.cannon', 'theller', 'georg.brandl', 'ronaldoussoren', 'benjamin.peterson', 'ned.deily', 'lukasz.langa']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue9662'
versions = ['Python 2.7', 'Python 3.2']

Activity

  1. brettcannon commented on Aug 22, 2010

    @brettcannon
    MemberAuthor

    When I build under OS X 10.6 with LLVM I get four warnings of the type:

    /Users/brett/Dev/python/3.x/scratch/Modules/_ctypes/callbacks.c:20:9: warning:
    implicit declaration of function 'ffi_closure_free' is invalid in C99
    [-Wimplicit-function-declaration]
    ffi_closure_free(self->pcl_write);
    ^

    They are for ffi_closure_free, ffi_closure_alloc, and ffi_prep_closure_loc.

  2. benjaminp commented on Aug 22, 2010

    @benjaminp
    Contributor

    Is LLVM a supported platform?

  3. brettcannon commented on Aug 22, 2010

    @brettcannon
    MemberAuthor

    It might as well be. OS X ships with it and is working towards making it their default compiler over gcc. Unladen also relies on it.

    This compiler issue is a fairly new one (I would guess past week or so), so making sure LLVM can compile Python shouldn't be a big deal. I would have added the proper function declarations myself to fix this but I wanted to let Thomas put them where he wanted them to go.

  4. birkenfeld commented on Sep 5, 2010

    @birkenfeld
    Member

    I don't think this should block 3.2a2.

    +1 for supporting LLVM in general. BTW, why doesn't it build because of warnings?

  5. ned-deily commented on Sep 5, 2010

    @ned-deily
    Member

    It's not just LLVM. Building a standard OS X installer on OS X 10.5 (gcc-4.0, 10.4u SDK, i386/ppc, deployment target=10.3) or 10.6 (gcc-4.2, 10.6 SDK, i386/x86_64, dept target 10.6), _ctypes fails:

    *** WARNING: renaming "_ctypes" since importing it failed: dlopen(build/lib.macosx-10.3-fat-3.2/_ctypes.so, 2): Symbol not found: _ffi_closure_alloc

    That is definitely a regression.

  6. birkenfeld commented on Sep 5, 2010

    @birkenfeld
    Member

    OK. Assigning to Ronald for now; he'll have to deal with it when building the binaries anyway.

  7. ambv commented on Sep 5, 2010

    @ambv
    Contributor

    This was broken in r83837 with a patch for issue bpo-5504.

  8. ronaldoussoren commented on Sep 5, 2010

    @ronaldoussoren
    Contributor

    I'm looking into this issue.

    One problem is that the version of libffi used on OSX is no longer in sync with the version that is used on other platforms. The version that is used on OSX does not have some of the symbols expected by ctypes, such as 'ffi_prep_closure_loc'.

  9. ambv commented on Sep 5, 2010

    @ambv
    Contributor

    Ronald, please see bpo-5504.

  10. ronaldoussoren commented on Sep 5, 2010

    @ronaldoussoren
    Contributor

    Thanks! That patch fixes the issue for me and I will commit it later today.

  11. ronaldoussoren commented on Sep 5, 2010

    @ronaldoussoren
    Contributor

    I've committed the patch in bpo-5504 in r84535 (3.2) and that fixes this issue.

    The same problem affects 2.7, I'm currently running the testsuite with the backport of this commit.

  12. ronaldoussoren commented on Sep 16, 2010

    @ronaldoussoren
    Contributor

    (Finally...) Checked in for 2.7 in r84846

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions