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

Compilation of python (modules) for foreign target platform problem. #71288

Closed
complement mannequin opened this issue May 24, 2016 · 10 comments
Closed

Compilation of python (modules) for foreign target platform problem. #71288

complement mannequin opened this issue May 24, 2016 · 10 comments
Labels
build The build process and cross-build

Comments

@complement
Copy link
Mannequin

complement mannequin commented May 24, 2016

BPO 27101
Nosy @doko42, @moreati, @iritkatriel
Files
  • 0001-Compilation-modules-for-foreign-target-platform.patch: [PATCH 1/2] Compilation modules for foreign target platform
  • 0002-Compilation-ssl-module-for-foreign-target-platform.patch: [PATCH 2/2] Compilation ssl module for foreign target platform
  • 0001-Compilation-modules-for-foreign-target-platform.patch: [PATCH 1/2] Compilation modules for foreign target platform
  • 0002-Compilation-ssl-module-for-foreign-target-platform.patch: [PATCH 2/2] Compilation ssl module for foreign target platform
  • 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 2022-01-29.18:37:52.567>
    created_at = <Date 2016-05-24.05:14:47.680>
    labels = ['build']
    title = 'Compilation of python (modules) for foreign target platform problem.'
    updated_at = <Date 2022-01-29.18:37:52.566>
    user = 'https://bugs.python.org/complement'

    bugs.python.org fields:

    activity = <Date 2022-01-29.18:37:52.566>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-29.18:37:52.567>
    closer = 'iritkatriel'
    components = ['Cross-Build']
    creation = <Date 2016-05-24.05:14:47.680>
    creator = 'complement'
    dependencies = []
    files = ['42981', '42982', '42983', '42984']
    hgrepos = []
    issue_num = 27101
    keywords = ['patch']
    message_count = 10.0
    messages = ['266225', '266298', '266299', '266300', '266301', '267345', '267520', '267533', '267538', '412092']
    nosy_count = 4.0
    nosy_names = ['doko', 'Alex.Willmer', 'complement', 'iritkatriel']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue27101'
    versions = ['Python 2.7', 'Python 3.5']

    @complement
    Copy link
    Mannequin Author

    complement mannequin commented May 24, 2016

    Compilation of python for foreign target platform problem.

    Host arch is x86_64, target arch is arm (arm32).

    Configuration is (target arch part):

        (cd build-python && \
        DESTDIR=${SYSROOT} \
        PKG_CONFIG=true \
        LIBFFI_INCLUDEDIR= \
        PATH=${CURDIR}/host-python-home/bin:$$PATH \
        PYTHONHOME=${CURDIR}/host-python-home/lib \
        PYTHONPATH=${CURDIR}/host-python-home/lib/python3.5 \
        ../cpython/configure \
          --host=${TARGET_CROSS} \
          --build=${BUILD_M_ARCH}-unknown-linux-gnu \
          --prefix=/usr \
          --sysconfdir=/etc \
          --localstatedir=/var \
          --enable-shared \
          --disable-ipv6 \
          --with-system-ffi \
          --with-system-expat \
          --without-ensurepip \
          --cache-file=config.cache\
        )
        sed -e 's/#define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1/#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE/' -i build-python/pyconfig.h
        sed -e '/^PGEN=/ s|=.*$$|=\t\t${CURDIR}/build-python-native/Parser/pgen|' -e '/^LDFLAGS=/ s|=.*$$|=\t\t-L.|' -e '/^\$$(PGEN):/,+1d' -e '/^LIBFFI_INCLUDEDIR=/ s|=.*$$|=|' -i build-python/Makefile
    

    Problem: option -I/usr/include passed to compiler during modules compilation. This lead to fails, due to target platform is different from host.

    Suggested patch resolve the issue for me.

    BTW, pass -I/usr/include is useless even for native builds.

    @complement complement mannequin added build The build process and cross-build labels May 24, 2016
    @complement
    Copy link
    Mannequin Author

    complement mannequin commented May 25, 2016

    for 3.5 branch

    1 similar comment
    @complement
    Copy link
    Mannequin Author

    complement mannequin commented May 25, 2016

    for 3.5 branch

    @complement
    Copy link
    Mannequin Author

    complement mannequin commented May 25, 2016

    for 2.7 branch

    1 similar comment
    @complement
    Copy link
    Mannequin Author

    complement mannequin commented May 25, 2016

    for 2.7 branch

    @doko42
    Copy link
    Member

    doko42 commented Jun 4, 2016

    The 0002-* patches look fine, however the 0001-* patches are wrong if you are in a Multi-Arch environment, where you can find valid headers in /usr/include. From my point of view, the set of include and header directories should be directly initialized from the compiler defaults, and not hard coded.

    @complement
    Copy link
    Mannequin Author

    complement mannequin commented Jun 6, 2016

    Matthias,

    This question is really for you:

    fc19031 (doko 2012-09-21 13:52:29 +0200 422) if multiarch_path_component != '':
    fc19031 (doko 2012-09-21 13:52:29 +0200 423) add_dir_to_list(self.compiler.library_dirs,
    fc19031 (doko 2012-09-21 13:52:29 +0200 424) '/usr/lib/' + multiarch_path_component)
    fc19031 (doko 2012-09-21 13:52:29 +0200 425) add_dir_to_list(self.compiler.include_dirs,
    fc19031 (doko 2012-09-21 13:52:29 +0200 426) '/usr/include/' + multiarch_path_component)
    fc19031 (doko 2012-09-21 13:52:29 +0200 427) return

    @doko42
    Copy link
    Member

    doko42 commented Jun 6, 2016

    sorry, I don't understand your last comment.

    @complement
    Copy link
    Mannequin Author

    complement mannequin commented Jun 6, 2016

    This mean that code for search in /usr/include/... in multiarch environment was added by you in commit fc19031 2012-09-21 13:52:29 +0200, so in my suggestion I just don't change behaviour of you code.

    As for my opinion, any additions of -I/usr/include/... are wrong: compiler either see it without such -I... or shouldn't see it at all (as for cross), or require hint from builder (something like CURSES_CFLAGS=-I/home/bluser/new_curses/include).

    @iritkatriel
    Copy link
    Member

    2.7 and 3.5 are no longer maintained. Please create a new issue if you are still having this problem with a current version (>= 3.9).

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants