Skip to content

Add some extra content check in configure process for some empty header file who has been deprecated by glibc #85277

Closed

Description

@Zheaoli
mannequin
BPO 41105
Nosy @tiran, @lilydjwg, @serhiy-storchaka, @Zheaoli, @akulakov, @etale-cohomology

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 = None
created_at = <Date 2020-06-24.15:16:58.262>
labels = ['build', '3.8', '3.9', '3.10']
title = 'Add some extra content check  in configure process for some empty header file who has been deprecated by glibc'
updated_at = <Date 2021-11-03.18:32:16.444>
user = 'https://github.com/Zheaoli'

bugs.python.org fields:

activity = <Date 2021-11-03.18:32:16.444>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Build']
creation = <Date 2020-06-24.15:16:58.262>
creator = 'Manjusaka'
dependencies = []
files = []
hgrepos = []
issue_num = 41105
keywords = []
message_count = 6.0
messages = ['372254', '372255', '403404', '405635', '405637', '405639']
nosy_count = 7.0
nosy_names = ['christian.heimes', 'lilydjwg', 'serhiy.storchaka', 'Manjusaka', 'Jiachen Yang', 'andrei.avk', 'etale-cohomology']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue41105'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

Linked PRs

Activity

  1. Zheaoli commented on Jun 24, 2020

    Zheaolimannequin
    MannequinAuthor

    Hello everyone

    When I try to compile the code from the master branch on my Manjaro, one of the Linux system based on the Arch and based on the glibc-2.31 && gcc-10.1.0 . the compiler show me that the fcntl module has been failed to be compiled

    Here's the message

    /home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: error: ‘I_PUSH’ undeclared (first use in this function)
    618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
    | ^~~~~~
    ./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
    146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
    | ^
    /home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: note: each undeclared identifier is reported only once for each function it appears in
    618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
    | ^~~~~~
    ./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
    146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
    | ^
    /home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:619:33: error: ‘I_POP’ undeclared (first use in this function)
    619 | if (PyModule_AddIntMacro(m, I_POP)) return -1;
    | ^~~~~
    ./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
    146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
    | ^
    /home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:620:33: error: ‘I_LOOK’ undeclared (first use in this function); did you mean ‘F_LOCK’?
    620 | if (PyModule_AddIntMacro(m, I_LOOK)) return -1;
    | ^~~~~~

    I have figured out the reason because the stropts.h has been deprecated since the glic-2.30, but some of the distribution of Linux keep an empty file on the /usr/include, so the configure process will recognize stropts.h is existed and open HAVE_STROPTS_H flag.

    So should we add an extra content check in the configure process to avoid the empty file problem?

  2. Zheaoli commented on Jun 24, 2020

    Zheaolimannequin
    MannequinAuthor
  3. changed the title [-]Add some extra content check for some who has been deprecated by glibc[/-] [+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+] on Jun 24, 2020
  4. changed the title [-]Add some extra content check for some who has been deprecated by glibc[/-] [+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+] on Jun 24, 2020
  5. etale-cohomology commented on Oct 7, 2021

    etale-cohomologymannequin
    Mannequin

    Yes, I have the same problem. The empty file is needed to avoid compilation errors in certain builds, but in this case it creates an error...

  6. akulakov commented on Nov 3, 2021

    @akulakov
    Contributor

    I think adding this code in the configure script may fix it:

    as_ac_Header=`$as_echo "ac_cv_header_stropts.h" | $as_tr_sh`
    ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "$as_ac_Header" "$ac_includes_default"
    if eval test \"x\$"$as_ac_Header"\" = x"yes" && [ -s stropts.h ]; then :
      cat >>confdefs.h <<_ACEOF
    #define `$as_echo "HAVE_stropts.h" | $as_tr_cpp` 1
    _ACEOF
    fi

    here: https://github.com/akulakov/cpython/blob/8f24b7dbcbd83311dad510863d8cb41f0e91b464/configure#L8144

    .. but I wasn't able to test it. I have a MacOS system and for me even with a non-empty stropts.h, configure does not pick it up.

  7. tiran commented on Nov 3, 2021

    @tiran
    Member

    The configure script is auto-generated from configure.ac. Any chance must be applied to configure.ac.

    We could replace the AC_CHECK_HEADERS() for stropt.h with a more elaborate AC_COMPILE_IFELSE() block that checks for presence of I_PUSH.

    Could you please report the issue to your Linux vendor, too? The empty file seems to break Open Group Unix 98 standard.

  8. serhiy-storchaka commented on Nov 3, 2021

    @serhiy-storchaka
    Member

    Rather of using AC_COMPILE_IFELSE() in configure.ac, would not be easier to use #ifdef in the C file?

  9. transferred this issue fromon Apr 10, 2022
  10. added
    type-featureA feature request or enhancement
    and removed on Jan 7, 2026
  11. added a commit that references this issue on Mar 10, 2026
  12. vstinner commented on Mar 10, 2026

    @vstinner
    Member

    The stropts.h issues (I_PUSH) should be fixed by #143521.

  13. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions