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

ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) #48555

Closed
doko42 opened this issue Nov 12, 2008 · 13 comments
Closed
Assignees
Labels
build The build process and cross-build topic-ctypes

Comments

@doko42
Copy link
Member

doko42 commented Nov 12, 2008

BPO 4305
Nosy @theller, @doko42
Files
  • mips-ffi.patch: Patch to re-insert logic for libffi when dealing with MIPS targets
  • py-issue-4305.patch
  • py-issue-4305+configure.patch
  • 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/theller'
    closed_at = <Date 2009-05-03.14:21:36.311>
    created_at = <Date 2008-11-12.10:00:00.307>
    labels = ['ctypes', 'build']
    title = 'ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel)'
    updated_at = <Date 2009-05-03.14:21:36.285>
    user = 'https://github.com/doko42'

    bugs.python.org fields:

    activity = <Date 2009-05-03.14:21:36.285>
    actor = 'theller'
    assignee = 'theller'
    closed = True
    closed_date = <Date 2009-05-03.14:21:36.311>
    closer = 'theller'
    components = ['ctypes']
    creation = <Date 2008-11-12.10:00:00.307>
    creator = 'doko'
    dependencies = []
    files = ['12617', '13083', '13084']
    hgrepos = []
    issue_num = 4305
    keywords = ['patch']
    message_count = 13.0
    messages = ['75781', '79232', '79234', '81987', '82027', '82046', '82069', '86055', '86063', '86535', '86601', '86762', '87046']
    nosy_count = 5.0
    nosy_names = ['theller', 'doko', 'rpetrov', 'mirell', 'kumba']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue4305'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    @doko42
    Copy link
    Member Author

    doko42 commented Nov 12, 2008

    seen on the mipsel buildbot

    running build
    running build_ext
    INFO: Can't locate Tcl/Tk libs and/or headers
    Traceback (most recent call last):
      File "./setup.py", line 1880, in <module>
        main()
      File "./setup.py", line 1875, in main
        'Lib/smtpd.py']
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/core.py",
    line 152, in setup
        dist.run_commands()
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
    line 975, in run_commands
        self.run_command(cmd)
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
    line 995, in run_command
        cmd_obj.run()
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build.py",
    line 134, in run
        self.run_command(cmd_name)
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/cmd.py",
    line 333, in run_command
        self.distribution.run_command(command)
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/dist.py",
    line 995, in run_command
        cmd_obj.run()
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build_ext.py",
    line 343, in run
        self.build_extensions()
      File "./setup.py", line 201, in build_extensions
        build_ext.build_extensions(self)
      File
    "/home/doko/buildarea/trunk.klose-debian-mipsel/build/Lib/distutils/command/build_ext.py",
    line 469, in build_extensions
        self.build_extension(ext)
      File "./setup.py", line 234, in build_extension
        if not self.configure_ctypes(ext):
      File "./setup.py", line 1684, in configure_ctypes
        execfile(ffi_configfile, globals(), fficonfig)
      File "build/temp.linux-mips-2.7-pydebug/libffi/fficonfig.py", line 32,
    in <module>
        ffi_sources += ffi_platforms['MIPS']
    KeyError: 'MIPS'
    [47349 refs]
    make: *** [sharedmods] Error 1

    @mirell
    Copy link
    Mannequin

    mirell mannequin commented Jan 6, 2009

    It's actually due to the merge of the libffi3 branch back in March,
    which removed the logic for configure to deal with MIPS in
    fficonfig.py.in. I've attached a patch which allows the build to work
    correctly on the QEMU instance of the MIPSEL machine I have.

    @mirell
    Copy link
    Mannequin

    mirell mannequin commented Jan 6, 2009

    Adding this as affecting the 2.6 branch as well, since I initially
    tested on a 2.6.1 tarball with this problem.

    @mirell
    Copy link
    Mannequin

    mirell mannequin commented Feb 14, 2009

    Would it be possible to get some feedback as to whether this is a
    candidate for Python 2.6 on this patch?

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Feb 14, 2009

    May I propose a simple py-issue-4305.patch. Let me know if patch work
    for you.

    @mirell
    Copy link
    Mannequin

    mirell mannequin commented Feb 14, 2009

    Not entirely. I applied what you had for the autoconf section to my
    configure, since I do not have autoconf installed in my environment.

    Specifically, this part of configure is what's messing with the build:

    if test x$TARGET = xMIPS; then
    MIPS_TRUE=
    MIPS_FALSE='#'
    else
    MIPS_TRUE='#'
    MIPS_FALSE=
    fi

    Since the target is being renamed to MIPS_LINUX or MIPS_IRIX, this test
    assumes the target is not MIPS.

    The patch you have gets past the build break, but doesn't actually
    compile what I believe is a working libffi for MIPS.

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Feb 14, 2009

    So I attach patch with changes in Modules/_ctypes/libffi/configure for
    the tests.

    @kumba
    Copy link
    Mannequin

    kumba mannequin commented Apr 17, 2009

    Is there any movement on this perchance? Just bumped into this on my
    MIPS platform and discovered this bug.

    @theller
    Copy link

    theller commented Apr 17, 2009

    Joshua Kinard schrieb:

    Joshua Kinard <kumba@gentoo.org> added the comment:

    Is there any movement on this perchance? Just bumped into this on my
    MIPS platform and discovered this bug.

    There is no MIPS buildbot at the moment, and I'm unclear which one
    of the patches solves the issue.

    @theller theller changed the title ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) Apr 17, 2009
    @theller
    Copy link

    theller commented Apr 25, 2009

    I wonder if fixes for issues like these (ctypes build errors on some
    plaforms) could be verified by using cross compilers on linux?

    @rpetrov
    Copy link
    Mannequin

    rpetrov mannequin commented Apr 26, 2009

    Thomas, the report is for:
    ------------
    ffi_sources += ffi_platforms['MIPS']
    KeyError: 'MIPS'
    ------------
    you may test patch without to cross-compile. As example create two
    directories.

    In first one run:
    ..../Modules/_ctypes/libffi/configure --host=mips-pc-linux F77=no CXX=no
    and in the second one:
    ..../Modules/_ctypes/libffi/configure --host=mips-sgi-irix5.0 FC=no

    Compare directories as example:
    $ diff -ur --exclude=config.* [DIR1] [DIR2]

    @theller
    Copy link

    theller commented Apr 28, 2009

    I've applied py-issue-4305.patch and reran configure 2.61. Committed as
    rev 72081 (trunk), 72082 (py3k branch), 72083 (release26-maint branch),
    72084 (release30-maint branch).

    Can someone please confirm that it works now, so that I can close this
    issue?

    @theller theller changed the title ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) ctypes fails to build on mipsel-linux-gnu (detects mips instead of mipsel) Apr 28, 2009
    @theller theller added the build The build process and cross-build label Apr 28, 2009
    @theller
    Copy link

    theller commented May 3, 2009

    Tested myself, on a mipsel debian qemu instance.

    @theller theller closed this as completed May 3, 2009
    @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
    build The build process and cross-build topic-ctypes
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants