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

[MinGW] Can't compile Python/dynload_win.c due to static strcasecmp #72456

Closed
vmurashev mannequin opened this issue Sep 25, 2016 · 5 comments
Closed

[MinGW] Can't compile Python/dynload_win.c due to static strcasecmp #72456

vmurashev mannequin opened this issue Sep 25, 2016 · 5 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes build The build process and cross-build OS-windows

Comments

@vmurashev
Copy link
Mannequin

vmurashev mannequin commented Sep 25, 2016

BPO 28269
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba, @vmurashev, @miss-islington
PRs
  • bpo-28269: Replace strcasecmp with system function stricmp #13095
  • [3.8] bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095) #14740
  • [3.7] bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095) #14741
  • Files
  • dynload_win.c.3.5.mingw.patch
  • dynload_win.c.2.7.mingw.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 = None
    closed_at = <Date 2019-08-24.10:31:25.927>
    created_at = <Date 2016-09-25.10:48:03.295>
    labels = ['build', '3.8', '3.9', 'OS-windows']
    title = "[MinGW] Can't compile Python/dynload_win.c due to static strcasecmp"
    updated_at = <Date 2019-08-24.10:31:25.915>
    user = 'https://github.com/vmurashev'

    bugs.python.org fields:

    activity = <Date 2019-08-24.10:31:25.915>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-24.10:31:25.927>
    closer = 'serhiy.storchaka'
    components = ['Build', 'Windows']
    creation = <Date 2016-09-25.10:48:03.295>
    creator = 'vmurashev'
    dependencies = []
    files = ['44808', '44809']
    hgrepos = []
    issue_num = 28269
    keywords = ['patch']
    message_count = 5.0
    messages = ['277362', '277761', '347812', '350362', '350363']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'vmurashev', 'miss-islington']
    pr_nums = ['13095', '14740', '14741']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue28269'
    versions = ['Python 3.8', 'Python 3.9']

    @vmurashev
    Copy link
    Mannequin Author

    vmurashev mannequin commented Sep 25, 2016

    Attempt to complile Python/dynload_win.c by MinGW fails
    due to static reimplementation of strcasecmp function in this file:

    ---
    /* Case insensitive string compare, to avoid any dependencies on particular
    C RTL implementations */

    static int strcasecmp (char *string1, char *string2)
    {
        int first, second;
    do {
        first  = tolower(*string1);
        second = tolower(*string2);
        string1++;
        string2++;
    } while (first && first == second);
    
    return (first - second);
    

    }
    ---

    And this reimplementation clashed with native declaration of strcasecmp()
    which one is a part of MinGW runtime

    So suggested patch (for 3.5.2 and 2.7.12)
    just disables static reimplementation of strcasecmp for MinGW

    @vmurashev vmurashev mannequin added build The build process and cross-build labels Sep 25, 2016
    @zooba
    Copy link
    Member

    zooba commented Sep 30, 2016

    Why not replace it entirely with stricmp? Does it behave differently?

    @serhiy-storchaka
    Copy link
    Member

    New changeset 05f2d84 by Serhiy Storchaka (Minmin Gong) in branch 'master':
    bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)
    05f2d84

    @miss-islington
    Copy link
    Contributor

    New changeset 920ec4b by Miss Islington (bot) in branch '3.8':
    bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)
    920ec4b

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your PR Minmin. It was decided to not backport it to 3.7.

    @serhiy-storchaka serhiy-storchaka added 3.8 (EOL) end of life 3.9 only security fixes labels Aug 24, 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.8 (EOL) end of life 3.9 only security fixes build The build process and cross-build OS-windows
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants